KnowledgeGraphRelationshipTypeDescription Constructor(String)
Construct a KnowledgeGraphRelationshipTypeDescription with the given name
Delete Entity and Relationship Types with SchemaBuilder
await QueuedTask.Run(() =>
{
using (var kg = GetKnowledgeGraph())
{
if (kg == null)
return;
var entity_name = "PhoneCall";
var relate_name = "WhoCalledWho";
var entityDesc = new KnowledgeGraphEntityTypeDescription(entity_name);
var relateDesc = new KnowledgeGraphRelationshipTypeDescription(relate_name);
//Run the schema builder
try
{
SchemaBuilder sb = new(kg);
sb.Delete(entityDesc);
sb.Delete(relateDesc);
//Use the KnowledgeGraph extension method 'ApplySchemaEdits(...)'
//to refresh the Pro UI
if (!kg.ApplySchemaEdits(sb))
{
var err_msg = string.Join(",", sb.ErrorMessages.ToArray());
System.Diagnostics.Debug.WriteLine($"Entity/Relate Delete error: {err_msg}");
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}
});
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.4 or higher.