Public Property ProvenanceBehavior As ProvenanceBehavior
public ProvenanceBehavior ProvenanceBehavior {get; set;}
Public Property ProvenanceBehavior As ProvenanceBehavior
public ProvenanceBehavior ProvenanceBehavior {get; set;}
{
var newQueryDefinition = new CIMKnowledgeGraphQueryDefinition();
newQueryDefinition.Name = "Query1";
newQueryDefinition.ProvenanceBehavior = ProvenanceBehavior.Include;
newQueryDefinition.OpenCypherQuery = "MATCH (n) RETURN n LIMIT 10\""; // return the first 10 entities
// access the currently active knowledge graph investigation view
KnowledgeGraphInvestigationView activeView = KnowledgeGraphInvestigationView.Active;
KnowledgeGraphInvestigation investigation = activeView?.Investigation;
if (investigation != null)
{
await QueuedTask.Run(() =>
{
// add the new query defintiion
investigation.AddQueryDefinition(newQueryDefinition);
});
}
}
{
// access the currently active knowledge graph investigation view
KnowledgeGraphInvestigationView activeView = KnowledgeGraphInvestigationView.Active;
KnowledgeGraphInvestigation investigation = activeView?.Investigation;
if (investigation != null)
{
await QueuedTask.Run(() =>
{
// return the first 20 entities
var newOpenCypherQuery = "MATCH (n) RETURN n LIMIT 20\"";
// update the open cypher query for a query definition
investigation.UpdateQueryDefinition("Query1", newOpenCypherQuery);
// or update other properties
var myQuery = investigation.GetQueryDefinition("Query1");
if (myQuery != null)
{
myQuery.ProvenanceBehavior = ProvenanceBehavior.Exclude;
myQuery.OpenCypherQuery = "MATCH (n) RETURN n LIMIT 30\"";
investigation.UpdateQueryDefinition(myQuery);
}
});
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)