当前位置: 首页>>代码示例>>C#>>正文


C# TypeManagement.GraphDBType类代码示例

本文整理汇总了C#中sones.GraphDB.TypeManagement.GraphDBType的典型用法代码示例。如果您正苦于以下问题:C# GraphDBType类的具体用法?C# GraphDBType怎么用?C# GraphDBType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GraphDBType类属于sones.GraphDB.TypeManagement命名空间,在下文中一共展示了GraphDBType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Error_CouldNotRemoveSetting

 public Error_CouldNotRemoveSetting(ADBSettingsBase mySetting, TypesSettingScope myScope, GraphDBType myType = null, TypeAttribute myAttribute = null)
 {
     Setting = mySetting;
     Scope = myScope;
     Type = myType;
     Attribute = myAttribute;
 }
开发者ID:TheByte,项目名称:sones,代码行数:7,代码来源:Error_CouldNotRemoveSetting.cs

示例2: GetValueForAttribute

        /// <summary>
        /// <seealso cref=" AAttributeAssignOrUpdate"/>
        /// </summary>
        public override Exceptional<IObject> GetValueForAttribute(DBObjectStream myDBObject, DBContext myDBContext, GraphDBType myGraphDBType)
        {
            if (AttributeIDChain.IsUndefinedAttribute)
            {
                return new Exceptional<IObject>(GraphDBTypeMapper.GetBaseObjectFromCSharpType(Value));
            }

            #region Simple value

            var dbType = AttributeIDChain.LastAttribute.GetDBType(myDBContext.DBTypeManager);
            if (AttributeIDChain.LastAttribute is SpecialTypeAttribute_UUID)
            {
                dbType = myDBContext.DBTypeManager.GetTypeByName(GraphDBTypeMapper.GetBaseObjectFromCSharpType(Value).ObjectName);//DBString.Name);
            }
            if (GraphDBTypeMapper.IsAValidAttributeType(dbType, AttributeAssignType, myDBContext, Value))
            {
                return new Exceptional<IObject>(GraphDBTypeMapper.GetGraphObjectFromType(AttributeAssignType, Value)); ;
            }
            else
            {
                return new Exceptional<IObject>(new Error_InvalidAttributeValue(AttributeIDChain.LastAttribute.Name, Value));
            }

            #endregion
        }
开发者ID:Vadi,项目名称:sones,代码行数:28,代码来源:AttributeAssignOrUpdateValue.cs

示例3: UUIDIndex

        public UUIDIndex(string indexName, IndexKeyDefinition idxKey, GraphDBType correspondingType, string indexType = null, string indexEdition = DBConstants.DEFAULTINDEX)
        {
            IndexName          = indexName;
            IndexEdition       = indexEdition;
            IndexKeyDefinition = idxKey;
            IndexRelatedTypeUUID = correspondingType.UUID;

            if (indexEdition == null)
            {
                IndexEdition = DBConstants.DEFAULTINDEX;
            }
            else
            {
                IndexEdition = indexEdition;
            }

            if (String.IsNullOrEmpty(indexType))
            {
                IndexType = "UUIDIndex";
            }
            else
            {
                IndexType = indexType;
            }

            #region Workaround for current IndexOperation of InOperator - just follow the IsListOfBaseObjectsIndex property

            IsListOfBaseObjectsIndex = false;

            #endregion

            FileSystemLocation = (correspondingType.ObjectLocation + "Indices") + (IndexName + "#" + IndexEdition);
        }
开发者ID:ipbi,项目名称:sones,代码行数:33,代码来源:UUIDIndex.cs

示例4: IDNode

 public IDNode(GraphDBType myType, String myReference)
 {
     IDChainDefinition = new Managers.Structures.IDChainDefinition();
     IDChainDefinition.AddPart(new ChainPartTypeOrAttributeDefinition(myType.Name));
     var listOfRefs = new Dictionary<String, GraphDBType>();
     listOfRefs.Add(myReference, myType);
 }
开发者ID:TheByte,项目名称:sones,代码行数:7,代码来源:IDNode.cs

示例5: BulkInsertDBO

 /// <summary>
 /// This will be invoked by the BulkInsert class.
 /// </summary>
 /// <param name="myTypeManager"></param>
 /// <param name="myDBTypeStream"></param>
 /// <param name="myDBObjectStream"></param>
 /// <param name="myBulkInsert"></param>
 internal BulkInsertDBO(DBContext myDBContext, GraphDBType myDBTypeStream, DBObjectStream myDBObjectStream, BulkInsert myBulkInsert)
 {
     _DBContext = myDBContext;
     _DBTypeStream = myDBTypeStream;
     _DBObjectStream = myDBObjectStream;
     _BulkInsert = myBulkInsert;
 }
开发者ID:TheByte,项目名称:sones,代码行数:14,代码来源:BulkInsertDBO.cs

示例6: GetValue

        public ADBBaseObject GetValue(GraphDBType myTypeID, TypeAttribute myAttrID, UUID mySettingUUID, DBContext context)
        {
            if (_TypeAttrSetting.ContainsKey(myTypeID.UUID))
            {
                if (_TypeAttrSetting[myTypeID.UUID].ContainsKey(myAttrID.UUID))
                {
                    if (_TypeAttrSetting[myTypeID.UUID][myAttrID.UUID].ContainsKey(mySettingUUID))
                    {
                        return _TypeAttrSetting[myTypeID.UUID][myAttrID.UUID][mySettingUUID];
                    }
                }
                else
                {
                    _TypeAttrSetting[myTypeID.UUID].Add(myAttrID.UUID, new Dictionary<UUID, ADBBaseObject>());
                }
            }
            else
            {
                _TypeAttrSetting.Add(myTypeID.UUID, new Dictionary<AttributeUUID, Dictionary<UUID, ADBBaseObject>>());
                _TypeAttrSetting[myTypeID.UUID].Add(myAttrID.UUID, new Dictionary<UUID, ADBBaseObject>());
            }

            //we are here, so we have to add the setting and return it

            var settingValue = context.DBSettingsManager.GetSettingValue(mySettingUUID, context, TypesSettingScope.ATTRIBUTE, myTypeID, myAttrID).Value.Clone();

            _TypeAttrSetting[myTypeID.UUID][myAttrID.UUID].Add(mySettingUUID, settingValue);

            return settingValue;
        }
开发者ID:TheByte,项目名称:sones,代码行数:30,代码来源:SelectSettingCache.cs

示例7: Aggregate

        public override Exceptional<IObject> Aggregate(AAttributeIndex attributeIndex, GraphDBType graphDBType, DBContext dbContext)
        {
            if (attributeIndex is UUIDIndex)
            {
                return new Exceptional<IObject>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true), "Aggregating attribute UUID is not implemented!"));
            }
            else
            {
                var indexRelatedType = dbContext.DBTypeManager.GetTypeByUUID(attributeIndex.IndexRelatedTypeUUID);

                // HACK: rewrite as soon as we have real attribute index keys
                if (attributeIndex.IndexKeyDefinition.IndexKeyAttributeUUIDs.Count != 1)
                {
                    return new Exceptional<IObject>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
                }

                var typeAttr = graphDBType.GetTypeAttributeByUUID(attributeIndex.IndexKeyDefinition.IndexKeyAttributeUUIDs.First());
                ADBBaseObject oneVal = typeAttr.GetADBBaseObjectType(dbContext.DBTypeManager);

                return new Exceptional<IObject>(attributeIndex.GetKeyValues(indexRelatedType, dbContext).AsParallel().Select(kv =>
                {
                    var mul = oneVal.Clone(kv.Key);
                    mul.Mul(oneVal.Clone(kv.Value.Count()));
                    return mul;

                }).Aggregate(oneVal.Clone(), (elem, result) => { result.Add(elem); return result; }));
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:28,代码来源:SumAggregate.cs

示例8: Aggregate

        public override Exceptional<IObject> Aggregate(AAttributeIndex attributeIndex, GraphDBType graphDBType, DBContext dbContext)
        {
            //if (graphDBType.IsAbstract)
            //{
            //    #region For abstract types, count all attribute idx of the subtypes

            //    UInt64 count = 0;

            //    foreach (var aSubType in dbContext.DBTypeManager.GetAllSubtypes(graphDBType, false))
            //    {
            //        if (!aSubType.IsAbstract)
            //        {
            //            count += aSubType.GetUUIDIndex(dbContext.DBTypeManager).GetValueCount();
            //        }
            //    }

            //    return new Exceptional<IObject>(new DBUInt64(count));

            //    #endregion
            //}
            //else
            //{
                #region Return the count of idx values

                var indexRelatedType = dbContext.DBTypeManager.GetTypeByUUID(attributeIndex.IndexRelatedTypeUUID);

                return new Exceptional<IObject>(new DBUInt64(attributeIndex.GetValueCount()));

                #endregion
            //}
        }
开发者ID:TheByte,项目名称:sones,代码行数:31,代码来源:CountAggregate.cs

示例9: Warning_EdgeToNonExistingNode

 public Warning_EdgeToNonExistingNode(DBObjectStream myStartingNode, GraphDBType myTypeOfDBO, TypeAttribute myEdge, IEnumerable<IError> myErrors)
 {
     StartingNode = myStartingNode;
     Errors = myErrors;
     Edge = myEdge;
     TypeOfDBO = myTypeOfDBO;
 }
开发者ID:TheByte,项目名称:sones,代码行数:7,代码来源:Warning_EdgeToNonExistingNode.cs

示例10: CheckUniqueConstraint

        public Exceptional<Boolean> CheckUniqueConstraint(GraphDBType myGraphType, IEnumerable<GraphDBType> myParentTypes, Dictionary<AttributeUUID, IObject> toBeCheckedForUniqueConstraint)
        {
            var UniqueAttributes = myGraphType.GetAllUniqueAttributes(true, _DBContext.DBTypeManager);

            if (!UniqueAttributes.IsNullOrEmpty())
            {
                var dbObjectAttributes = (from aAttribute in toBeCheckedForUniqueConstraint where UniqueAttributes.Contains(aAttribute.Key) select aAttribute);

                if (dbObjectAttributes.Count() != 0)
                {
                    AAttributeIndex AttrIndex = null;

                    foreach (var PType in myParentTypes)
                    {
                        AttrIndex = PType.FindUniqueIndex();

                        if (AttrIndex != null)
                        {
                            var toBeCheckedIdxKey = GenerateIndexKeyForUniqueConstraint(toBeCheckedForUniqueConstraint, AttrIndex.IndexKeyDefinition, myGraphType);

                            if (AttrIndex.Contains(toBeCheckedIdxKey, PType, _DBContext))
                            {
                                return new Exceptional<Boolean>(new Error_UniqueConstrainViolation(PType.Name, AttrIndex.IndexName));
                            }
                        }
                    }
                }
            }

            return new Exceptional<Boolean>(true);
        }
开发者ID:TheByte,项目名称:sones,代码行数:31,代码来源:DBIndexManager.cs

示例11: ExtractValue

        public override Exceptional<IObject> ExtractValue(DBObjectStream dbObjectStream, GraphDBType graphDBType, DBContext dbContext)
        {
            EdgeTypeListOfBaseObjects streams = new EdgeTypeListOfBaseObjects();

            foreach (var item in dbObjectStream.ObjectStreams)
                streams.Add(new DBString(item.Key + " " + item.Value.ToString()));

            return new Exceptional<IObject>(streams);
        }
开发者ID:TheByte,项目名称:sones,代码行数:9,代码来源:SpecialTypeAttribute_STREAMS.cs

示例12: ExtractValue

        public override Exceptional<IObject> ExtractValue(DBObjectStream dbObjectStream, GraphDBType graphDBType, DBContext dbContext)
        {
            EdgeTypeListOfBaseObjects parentRevisions = new EdgeTypeListOfBaseObjects();

            foreach (var item in dbObjectStream.ParentRevisionIDs)
                parentRevisions.Add(new DBString(item.ToString()));

            return new Exceptional<IObject>(parentRevisions);
        }
开发者ID:TheByte,项目名称:sones,代码行数:9,代码来源:SpecialTypeAttribute_PARENTREVISIONS.cs

示例13: AttributeIndex

        public AttributeIndex(string indexName, IndexKeyDefinition idxKey, GraphDBType correspondingType, UInt16 myAttributeIdxShards, string indexType = null, string indexEdition = DBConstants.DEFAULTINDEX, UInt64 myKeyCount = 0, UInt64 myValueCount = 0)
        {
            IndexName          = indexName;
            IndexEdition       = indexEdition;
            IndexKeyDefinition = idxKey;
            IndexRelatedTypeUUID = correspondingType.UUID;
            AttributeIdxShards = myAttributeIdxShards;

            _keyCount = myKeyCount;
            _valueCount = myValueCount;

            if (indexEdition == null)
            {
                IndexEdition = DBConstants.DEFAULTINDEX;
            }
            else
            {
                IndexEdition = indexEdition;
            }

            if (String.IsNullOrEmpty(indexType))
            {
                IndexType = VersionedHashIndexObject.Name;
            }
            else
            {
                IndexType = indexType;
            }

            #region Workaround for current IndexOperation of InOperator - just follow the IsListOfBaseObjectsIndex property

            // better approach, use a special index key for a set of base objects
            if (idxKey.IndexKeyAttributeUUIDs.Any(a =>
            {
                var typeAttr = correspondingType.GetTypeAttributeByUUID(a);
                if (typeAttr != null && (typeAttr.EdgeType is IBaseEdge))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }))
            {
                IsListOfBaseObjectsIndex = true;
            }
            else
            {
                IsListOfBaseObjectsIndex = false;
            }

            #endregion

            FileSystemLocation = (correspondingType.ObjectLocation + "Indices") + (IndexName + "#" + IndexEdition);
        }
开发者ID:TheByte,项目名称:sones,代码行数:56,代码来源:AttributeIndex.cs

示例14: ConvertGraph2CSharp

        public static BasicType ConvertGraph2CSharp(TypeAttribute attributeDefinition, GraphDBType typeOfAttribute)
        {
            if (typeOfAttribute.IsUserDefined)
            {
                if (attributeDefinition.KindOfType != KindsOfType.SetOfReferences && attributeDefinition.KindOfType != KindsOfType.SingleReference)
                    throw new GraphDBException(new Error_ListAttributeNotAllowed(typeOfAttribute.Name));

                return BasicType.Reference;
            }

            else
            {

                if (attributeDefinition.KindOfType == KindsOfType.ListOfNoneReferences || attributeDefinition.KindOfType == KindsOfType.SetOfNoneReferences)
                    return BasicType.SetOfDBObjects;

                switch (typeOfAttribute.Name)
                {

                    case DBConstants.DBInteger:
                        return GraphInteger;

                    case DBConstants.DBInt32:
                        return GraphInt32;

                    case DBConstants.DBUnsignedInteger:
                        return GraphUnsignedInteger;

                    case DBConstants.DBString:
                        return GraphString;

                    case DBConstants.DBDouble:
                        return GraphDouble;

                    case DBConstants.DBDateTime:
                        return GraphDateTime;

                    case DBConstants.DBBoolean:
                        return GraphBoolean;

                    case "NumberLiteral":
                        return BasicType.Unknown;

                    case "StringLiteral":
                        return BasicType.Unknown;

                    case DBConstants.DBObject:
                        return BasicType.Reference;

                    default:
                        throw new GraphDBException(new Error_TypeDoesNotExist(typeOfAttribute.Name));

                }

            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:56,代码来源:GraphDBTypeMapper.cs

示例15: CreateVertex

        public override IEnumerable<Vertex> CreateVertex(DBContext myDBContext, GraphDBType myGraphDBType)
        {
            var payload = new Dictionary<String, Object>();

            payload.Add("TYPE", myGraphDBType);
            payload.Add("ACTION", "CHANGE COMMENT");
            payload.Add("NEW COMMENT", NewComment);

            return new List<Vertex> { new Vertex(payload) };
        }
开发者ID:TheByte,项目名称:sones,代码行数:10,代码来源:AlterType_ChangeComment.cs


注:本文中的sones.GraphDB.TypeManagement.GraphDBType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。