ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.KnowledgeGraph Namespace / KnowledgeGraphInvestigationProjectItem Class / GetDatastore Method
Example

In This Topic
    GetDatastore Method (KnowledgeGraphInvestigationProjectItem)
    In This Topic
    Gets the ArcGIS.Core.Data.Knowledge.KnowledgeGraph associated with the workspace corresponding to the ArcGIS.Desktop.Core.Item.Path. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetDatastore() As KnowledgeGraph
    public KnowledgeGraph GetDatastore()

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Get the KnowledgeGraph from a KnowledgeGraphInvestigationProjectItem
    {
      // get an existing investigation
      var investigationProjectItems = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>();
      var investigationProjectItem = investigationProjectItems.FirstOrDefault(ipi => ipi.Name.Equals("myInvestigation"));
      await QueuedTask.Run(() =>
      {
        // get the datasore
        using (var kg = investigationProjectItem.GetDatastore())
        {
          // do something
        }
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.5 or higher.
    See Also