コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: DBCreationManager.cs プロジェクト: loubo/sones
        /// <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);
        }
コード例 #4
0
ファイル: DBCreationManager.cs プロジェクト: anukat2015/sones
        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);
            }

        }