ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphLayerIDSet Class
Members Example

In This Topic
    KnowledgeGraphLayerIDSet Class
    In This Topic
    A collection of named object types and their corresponding list of records to represent a set of rows in a KnowledgeGraphLayer.
    Object Model
    KnowledgeGraphLayerIDSet ClassKnowledgeGraphLayerIDSet ClassKnowledgeGraphLayerIDSet ClassKnowledgeGraphLayerIDSet ClassKnowledgeGraphLayerIDSet ClassKnowledgeGraphLayerIDSet ClassKnowledgeGraphIDSet Class
    Syntax
    Public NotInheritable Class KnowledgeGraphLayerIDSet 
    public sealed class KnowledgeGraphLayerIDSet 
    Example
    Select records in an investigation view
    {
      // get the active investigation view 
      var iv = KnowledgeGraphInvestigationView.Active;
      var serviceUri = iv.Investigation.ServiceUri;
    
      // build a dictionary of records
      string some_entity = "Entity_Type_Name";
      var dict = new Dictionary<string, List<long>>();
      //Each entry consists of the type name and corresponding lists of ids
      dict.Add(some_entity, new List<long>() { 1, 5, 18, 36, 78 });
    
      //Create the id set...
      var idSet = KnowledgeGraphLayerIDSet.FromDictionary(new Uri(serviceUri), dict);
    
      // select the records on the investigation view
      iv.SetSelectedRecords(idSet, SelectionCombinationMethod.New);
    }
    Clear selected records in an investigation view
    {
      // get the active investigation view 
      var iv = KnowledgeGraphInvestigationView.Active;
    
      // clear the selected records
      iv.ClearSelectedRecords();
    }
    Get Selected records and open in a new link chart
    {
      // get the active investigation view
      var iv = KnowledgeGraphInvestigationView.Active;
    
      await QueuedTask.Run(() =>
      {
        // get the investigation
        var inv = iv.Investigation;
    
        // get the set of selected records
        var idSet = iv.GetSelectedRecords();
    
        // view these records in a link chart
        var map = MapFactory.Instance.CreateLinkChart("myLinkChart", new Uri(inv.ServiceUri), idSet);
        ProApp.Panes.CreateMapPaneAsync(map);
      });
    }
    Create an ID set from a SelectionSet
    {
      await QueuedTask.Run(() =>
      {
        // get the selection set
        var sSet = map.GetSelection();
    
        // translate to an KnowledgeGraphLayerIDSet
        //  if the selectionset does not contain any KG entity or relationship records
        //    then idSet will be null  
        var idSet = KnowledgeGraphLayerIDSet.FromSelectionSet(sSet);
        if (idSet == null)
          return;
    
        // you can use the idSet to create a new linkChart
        //   (using MapFactory.Instance.CreateLinkChart)
      });
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.KnowledgeGraphLayerIDSet

    Requirements

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

    ArcGIS Pro version: 3.3 or higher.
    See Also