ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphLayer Class
Members Example

In This Topic
    KnowledgeGraphLayer Class
    In This Topic
    A knowledge graph layer is a composite layer with a knowledge graph as its data source.
    Object Model
    KnowledgeGraphLayer ClassLayer ClassStandaloneTable ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassSpatialReference ClassTimeParameters ClassMap ClassILayerContainer InterfaceEnvelope Class
    The knowledge graph layer contains knowledge graph feature layers and knowledge graph tables. One knowledge graph feature layer is created within the knowledge graph composite layer per entity and relationship type when the entity and relationship instances can have spatial features. A standalone table is created within the knowledge graph composite layer per entity and relationship type that is nonspatial.
    The underlying knowledge graph datasource can be accessed off any of the child entity and relationship featurelayers and/or standalone tables.
    Getting a Connection from a KnowledgeGraphLayer
    var kgLayer = MapView.Active.Map.GetLayersAsFlattenedList()
    //KnowledgeGraphLayer is a composite layer - get the first 
    //child feature layer or standalone table
    QueuedTask.Run(() =>
      var featlayer = kgLayer?.GetLayersAsFlattenedList()?
      KnowledgeGraph kg = null;
      if (featlayer != null)
        using (var fc = featlayer.GetFeatureClass())
          kg = fc.GetDatastore() as KnowledgeGraph;
        //TODO use KnowledgeGraph
        //try standalone table
        var stbl = kgLayer?.GetStandaloneTablesAsFlattenedList()?
        if (stbl != null)
          using (var tbl = stbl.GetTable())
            kg = tbl.GetDatastore() as KnowledgeGraph;
          //TODO use KnowledgeGraph
    Inheritance Hierarchy



    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also