ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Editing Namespace / KnowledgeGraphProvenanceDescription Class
Members Example

In This Topic
    KnowledgeGraphProvenanceDescription Class
    In This Topic
    Represents the information in a knowledge graph provenance row.
    Object Model
    KnowledgeGraphProvenanceDescription ClassRowHandle ClassRowHandle Class
    Syntax
    public sealed class KnowledgeGraphProvenanceDescription 
    Public NotInheritable Class KnowledgeGraphProvenanceDescription 
    Remarks
    A KnowledgeGraphProvenanceDescription is used to create provenance records Provenance describes where information in the knowledge graph originates. Each provenance record associates the value stored in a property of an entity or a relationship with a specific source. A property of an entity or a relationship can have many provenance records because many sources can confirm the same piece of information.

    Once defined use EditOperation.Create to create a provenance record.

    Example
    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
      }
    
    });
    
    Create an Entity, a Document, a HasDocument and a Provenance record
    await QueuedTask.Run(() =>
    {
      //Instantiate an operation for the Create
      var edit_op = new EditOperation()
      {
        Name = "Create a records",
        SelectNewFeatures = true
      };
    
      // create the entity
      var personToken = edit_op.Create(personLayer, personAtts);
    
      // create the document
      var kgDocDesc = new KnowledgeGraphDocumentDescription(@"D:\Data\BirthCertificate.jpg");
      var docToken = edit_op.Create(docLayer, kgDocDesc);
    
      // create RowHandles from the returned RowTokens
      var personHandle = new RowHandle(personToken);
      var docHandle = new RowHandle(docToken);
    
      // create the "hasDocument" relationship
      var rd = new KnowledgeGraphRelationshipDescription(personHandle, docHandle);
      edit_op.Create(hasDocLayer, rd);
    
      // create the provenance record for the person entity using the document entity
      // provenance record is on the "name" field 
      var pd = new KnowledgeGraphProvenanceDescription(personHandle, "name", docHandle, "", "comments");
      edit_op.Create(pd);
    
      // execute - create all the entities and relationship rows _together_
      edit_op.Execute();
    });
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Editing.KnowledgeGraphProvenanceDescription

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also