/// <summary> /// Create the base graph via a vertex store. /// </summary> /// <param name="myStore">The vertex store, that stores the base graph.</param> public void CreateBaseGraph(IVertexStore myStore) { myStore.CheckNull("myStore"); var creationDate = DateTime.UtcNow.ToBinary(); AddBasicTypes(myStore, creationDate); AddVertexTypes(myStore, creationDate); AddEdgeTypes(myStore, creationDate); AddIndices(myStore, creationDate); }
public void AddUserDefinedDataTypes(IVertexStore myStore, AComponentPluginManager myPluginManager) { myStore.CheckNull("myStore"); var creationDate = DateTime.UtcNow.ToBinary(); List <AUserdefinedDataType> userdefinedDataTypePlugins = new List <AUserdefinedDataType>(); foreach (var plugin in myPluginManager.GetPluginsForType <AUserdefinedDataType>()) { userdefinedDataTypePlugins.Add((AUserdefinedDataType)plugin); } List <String> userdefinedTypes = new List <String>(); var maxValue = long.MinValue; foreach (var vertex in myStore.GetVerticesByTypeID(_security, _transaction, (long)BaseTypes.BaseType)) { if (vertex.GetProperty <Boolean>((long)AttributeDefinitions.BaseTypeDotIsUserDefined)) { if (!userdefinedDataTypePlugins.Any(item => item.TypeName == vertex.GetProperty <String>((long)AttributeDefinitions.BaseTypeDotName))) { throw new Exception(); } else { userdefinedTypes.Add(vertex.GetProperty <String>((long)AttributeDefinitions.BaseTypeDotName)); } } if (vertex.VertexID > maxValue) { maxValue = vertex.VertexID; } } maxValue++; foreach (var type in userdefinedDataTypePlugins.Select(item => item.TypeName).Except(userdefinedTypes)) { _storageManager.StoreBasicType(myStore, new VertexInformation((long)BaseTypes.BaseType, maxValue++), type, true, "UserdefinedType" + type, creationDate, _security, _transaction); } }
public void AddUserDefinedDataTypes(IVertexStore myStore, AComponentPluginManager myPluginManager) { myStore.CheckNull("myStore"); var creationDate = DateTime.UtcNow.ToBinary(); List<AUserdefinedDataType> userdefinedDataTypePlugins = new List<AUserdefinedDataType>(); foreach (var plugin in myPluginManager.GetPluginsForType<AUserdefinedDataType>()) { userdefinedDataTypePlugins.Add((AUserdefinedDataType)plugin); } List<String> userdefinedTypes = new List<String>(); var maxValue = long.MinValue; foreach (var vertex in myStore.GetVerticesByTypeID(_security, _transaction, (long)BaseTypes.BaseType)) { if(vertex.GetProperty<Boolean>((long)AttributeDefinitions.BaseTypeDotIsUserDefined)) { if (!userdefinedDataTypePlugins.Any(item => item.TypeName == vertex.GetProperty<String>((long)AttributeDefinitions.BaseTypeDotName))) { throw new Exception(); } else { userdefinedTypes.Add(vertex.GetProperty<String>((long)AttributeDefinitions.BaseTypeDotName)); } } if (vertex.VertexID > maxValue) { maxValue = vertex.VertexID; } } maxValue++; foreach (var type in userdefinedDataTypePlugins.Select(item => item.TypeName).Except(userdefinedTypes)) { _storageManager.StoreBasicType(myStore, new VertexInformation((long)BaseTypes.BaseType, maxValue++), type, true, "UserdefinedType" + type, creationDate, _security, _transaction); } }