ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Knowledge Namespace / KnowledgeGraphPropertyInfo Class / SupportsProvenance Property
Example

In This Topic
    SupportsProvenance Property
    In This Topic
    Gets if the knowledge graph supports provenance.
    Syntax
    Public ReadOnly Property SupportsProvenance As Boolean
    public bool SupportsProvenance {get;}
    Example
    Get the KG Provenance using KnowledgeGraphPropertyInfo
    {
      await QueuedTask.Run(() =>
      {
        //Create a connection properties
        var kg_props =
            new KnowledgeGraphConnectionProperties(new Uri(url));
        using (var kg = new KnowledgeGraph(kg_props))
        {
          // use the KnowledgeGraphPropertyInfo
          var propInfo = kg.GetPropertyNameInfo();
          var supportsProvenance = propInfo.SupportsProvenance;
          var provenanceType = propInfo.ProvenanceTypeName;
          var provenanceInfo = propInfo.ProvenancePropertyInfo;
        }
      });
    }
    Create a Provenance Record 2
    {
      await QueuedTask.Run(() =>
      {
        // check if provenance supported
        var propInfo = kg.GetPropertyNameInfo();
        if (!propInfo.SupportsProvenance)
          return;
    
        //Instantiate an operation for the Create
        var edit_op = new EditOperation()
        {
          Name = "Create a new provenance record",
          SelectNewFeatures = true
        };
    
        var provName = propInfo.ProvenanceTypeName;
    
        //we will add a row to the provenance for person entity
        var person_tbl = kg.OpenDataset<Table>("Person");
    
        //Arbitrarily retrieve the first "person" row
        var instance_id = Guid.Empty;
        using (var rc = person_tbl.Search())
        {
          if (!rc.MoveNext())
            return;
          instance_id = rc.Current.GetGlobalID();//Get the global id
        }
    
        var originHandle = new RowHandle(person_tbl, instance_id);
        var pd = new KnowledgeGraphProvenanceDescription(
          originHandle, "name", KnowledgeGraphSourceType.Document,
          "Annual Review 2024", "HR records", "Rock star");
    
        //Create the provenance row
        edit_op.Create(pd);
        if (edit_op.Execute())
        {
          //TODO: Operation succeeded
        }
    
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.4 or higher.
    See Also