ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphLayerCreationParams Class / KnowledgeGraphLayerCreationParams Constructor / KnowledgeGraphLayerCreationParams Constructor(Uri)
A System.Uri represents the path or url to a knowledge graph.
Example

In This Topic
    KnowledgeGraphLayerCreationParams Constructor(Uri)
    In This Topic
    Creates a parameter object with a System.Uri.
    Syntax
    Public Function New( _
       ByVal uri As Uri _
    )
    public KnowledgeGraphLayerCreationParams( 
       Uri uri
    )

    Parameters

    uri
    A System.Uri represents the path or url to a knowledge graph.
    Remarks

    Some sample paths to:

    A url to a knowledge graph. https://someServer.domain.com/server/rest/services/Hosted/SomeKG/KnowledgeGraphServer
    A path to a local file-based knowledge graph C:\Data\KG_Data_Store\some_local_kg.knowledgegraph

    Example
    Create a KG Layer containing all Entity and Relate types
    {
      await QueuedTask.Run(() =>
      {
        //With a connection to a KG established or source uri available...
        //Create a KnowledgeGraphLayerCreationParams
        var kg_params = new KnowledgeGraphLayerCreationParams(kg)
        {
          Name = "KG_With_All_Types",
          IsVisible = false
        };
        //Or
        var kg_params2 = new KnowledgeGraphLayerCreationParams(new Uri(url))
        {
          Name = "KG_With_All_Types",
          IsVisible = false
        };
        //Call layer factory with map or group layer container. 
        //A KG layer containing a feature layer and/or standalone table per
        //entity and relate type (except provenance) is created
        var kg_layer = LayerFactory.Instance.CreateLayer<KnowledgeGraphLayer>(
            kg_params, map);
    
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also