ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.KnowledgeGraph Namespace / KnowledgeGraphInvestigation Class
Members Example

In This Topic
    KnowledgeGraphInvestigation Class
    In This Topic
    Represents a Knowledge Graph investigation in a project and provides access to the entities, relationships and other items in the knowledge graph.
    Object Model
    KnowledgeGraphInvestigation ClassCIMWorkspaceConnection Class
    Syntax
    public sealed class KnowledgeGraphInvestigation 
    Public NotInheritable Class KnowledgeGraphInvestigation 
    Remarks

    To create a KnowledgeGraphInvestigation, you must call a create method of the KnowledgeGraphInvestigationFactory class.

    To open a KnowledgeGraphInvestigation, use the ProApp.Panes.CreateInvestigationPane method.

    You need to use a KnowledgeGraphInvestigationView to interact with a KnowledgeGraphInvestigation. Multiple KnowledgeGraphInvestigationViews can be opened for a KnowledgeGraphInvestigation at a given time, but there can only be one active KnowledgeGraphInvestigationView which is returned by the KnowledgeGraphInvestigation.Active static member. Use the KnowledgeGraphInvestigation property to access the KnowledgeGraphInvestigation object associated with the KnowledgeGraphInvestigationView.

    Example
    Create an Investigation
    var URL = @"https://acme.com/server/rest/services/Hosted/Acme_KG/KnowledgeGraphServer";
    
    QueuedTask.Run(() =>
    {
      var investigation = KnowledgeGraphInvestigationFactory.Instance.CreateInvestigation(URL, "myInvestigation");
    
      
    });
    Create and open an investigation pane
    var URL = @"https://acme.com/server/rest/services/Hosted/Acme_KG/KnowledgeGraphServer";
    
    QueuedTask.Run(() =>
    {
      var investigation = KnowledgeGraphInvestigationFactory.Instance.CreateInvestigation(URL, "myInvestigation");
    
      ProApp.Panes.CreateInvestigationPaneAsync(investigation);
    });
    Open an existing investigation
    // open an existing investigation
    var investigationProjectItems = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>();
    var investigationProjectItem = investigationProjectItems.FirstOrDefault(ipi => ipi.Name.Equals("myInvestigation")); 
    await QueuedTask.Run(async () =>
    {
      KnowledgeGraphInvestigation investigation = investigationProjectItem.GetInvestigation();
      await ProApp.Panes.CreateInvestigationPaneAsync(investigation);
    });
    Get the active KnowledgeGraphInvestigationView, KnowledgeGraphInvestigation
    // access the currently active knowledge graph investigation view
    KnowledgeGraphInvestigationView activeView = KnowledgeGraphInvestigationView.Active;
    KnowledgeGraphInvestigation investigation = activeView?.Investigation;
    if (investigation != null)
    {
      // perform some action
    }
    Activate an existing investigation view
    //Confirm if investigation exists as a project item
    KnowledgeGraphInvestigationProjectItem investigationItem = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>().FirstOrDefault(
                                                          item => item.Name.Equals("myInvestigation"));
    if (investigationItem != null)
    {
      KnowledgeGraphInvestigation investigation = await QueuedTask.Run(() => investigationItem.GetInvestigation());
    
      // see if a view is already open that references the same investigation
      foreach (var investigationPane in ProApp.Panes.OfType<IKnowledgeGraphInvestigationPane>())
      {
        //if there is a match, activate the view
        if (investigationPane.InvestigationView.Investigation == investigation)
        {
          (investigationPane as Pane).Activate();
          return;
        }
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.KnowledgeGraph.KnowledgeGraphInvestigation

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also