ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.Knowledge Namespace / KnowledgeGraphDataModel Class
Members Example

In This Topic
    KnowledgeGraphDataModel Class
    In This Topic
    Represents the data model for the knowledge graph.
    Object Model
    KnowledgeGraphDataModel ClassKnowledgeGraphIdentifierInfo ClassSpatialReference Class
    Syntax
    public sealed class KnowledgeGraphDataModel : ArcGIS.Core.CoreObjectsBase, System.IDisposable  
    Public NotInheritable Class KnowledgeGraphDataModel 
       Inherits ArcGIS.Core.CoreObjectsBase
       Implements System.IDisposable 
    Remarks
    The data model includes metadata about the knowledge graph, including but not limited to entity and relationship types, spatial reference, and information about generation of unique identifiers.
    Example
    Retrieving the Data Model
    QueuedTask.Run(() =>
    {
      //Create a connection properties
      var kg_props =
          new KnowledgeGraphConnectionProperties(new Uri(url));
      using (var kg = new KnowledgeGraph(kg_props))
      {
        //Get the KnowledgeGraph Data Model
        using(var kg_dm = kg.GetDataModel())
        {
          //TODO use KG data model...
        }
      }
    });
          
    Get Data Model Properties
    QueuedTask.Run(() =>
    {
      //Create a connection properties
      var kg_props =
          new KnowledgeGraphConnectionProperties(new Uri(url));
      using (var kg = new KnowledgeGraph(kg_props))
      {
        //Get the KnowledgeGraph Data Model
        using (var kg_dm = kg.GetDataModel())
        {
          var kg_name = System.IO.Path.GetFileName(
                   System.IO.Path.GetDirectoryName(kg_props.URL.ToString()));
    
          System.Diagnostics.Debug.WriteLine(
            $"\r\n'{kg_name}' Datamodel:\r\n-----------------");
          var time_stamp = kg_dm.GetTimestamp();
          var sr = kg_dm.GetSpatialReference();
          System.Diagnostics.Debug.WriteLine($"Timestamp: {time_stamp}");
          System.Diagnostics.Debug.WriteLine($"Sref: {sr.Wkid}");
          System.Diagnostics.Debug.WriteLine(
            $"IsStrict: {kg_dm.GetIsStrict()}");
          System.Diagnostics.Debug.WriteLine(
            $"OIDPropertyName: {kg_dm.GetOIDPropertyName()}");
          System.Diagnostics.Debug.WriteLine(
            $"IsArcGISManaged: {kg_dm.GetIsArcGISManaged()}");
        }
      }
    });
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CoreObjectsBase
          ArcGIS.Core.Data.Knowledge.KnowledgeGraphDataModel

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also