public IReadOnlyDictionary<string,KnowledgeGraphEntityType> GetMetaEntityTypes()
Public Function GetMetaEntityTypes() As IReadOnlyDictionary(Of String,KnowledgeGraphEntityType)
public IReadOnlyDictionary<string,KnowledgeGraphEntityType> GetMetaEntityTypes()
Public Function GetMetaEntityTypes() As IReadOnlyDictionary(Of String,KnowledgeGraphEntityType)
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
//Provenance entity type is stored as a MetaEntityType QueuedTask.Run(() => { //Create a connection properties var kg_props = new KnowledgeGraphConnectionProperties(new Uri(url)); using (var kg = new KnowledgeGraph(kg_props)) { //Get the KnowledgeGraph Data Model using (var kg_dm = kg.GetDataModel()) { var dict_types = kg_dm.GetMetaEntityTypes(); //If there is no provenance then MetaEntityTypes will be //an empty collection foreach (var kvp in dict_types) { var meta_entity_type = kvp.Value; if (meta_entity_type.GetRole() == KnowledgeGraphNamedObjectTypeRole.Provenance) { //TODO - use the provenance entity type var name = meta_entity_type.GetName(); } } } } });
internal string GetProvenanceEntityTypeName(KnowledgeGraphDataModel kg_dm) { var entity_types = kg_dm.GetMetaEntityTypes(); foreach (var entity_type in entity_types) { if (entity_type.Value.GetRole() == KnowledgeGraphNamedObjectTypeRole.Provenance) return entity_type.Value.GetName(); } return ""; } internal bool KnowledgeGraphSupportsProvenance(KnowledgeGraph kg) { //if there is a provenance entity type then the KnowledgeGraph //supports provenance return !string.IsNullOrEmpty( GetProvenanceEntityTypeName(kg.GetDataModel())); }
internal string GetDocumentEntityTypeName(KnowledgeGraphDataModel kg_dm) { var entity_types = kg_dm.GetEntityTypes(); foreach (var entity_type in entity_types) { var role = entity_type.Value.GetRole(); if (role == KnowledgeGraphNamedObjectTypeRole.Document) return entity_type.Value.GetName(); } return "";//Unusual - probably Neo4j user-managed } internal bool KnowledgeGraphHasDocumentType(KnowledgeGraph kg) { //uncommon for there not to be a document type return !string.IsNullOrEmpty( GetDocumentEntityTypeName(kg.GetDataModel())); }
Target Platforms: Windows 11, Windows 10