• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TypeManagement.GraphDBType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: DBObjectMR

        public DBObjectMR(DBObjectStream myDBObject, GraphDBType myDBTypeStream, DBContext myTypeManager)
        {
            _ObjectUUID = myDBObject.ObjectUUID;
            _Attributes = new Dictionary<String, Object>();

            foreach (var _Attribute in myDBTypeStream.Attributes)
            {
                _Attributes.Add(_Attribute.Value.Name, myDBObject.GetAttribute(_Attribute.Key));
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:10,代码来源:DBObjectMR.cs


示例17: Execute

        /// <summary>
        /// Execute the renaming of the backwardedge of a given type.
        /// </summary>
        /// <param name="myDBContext"></param>
        /// <param name="myGraphDBType"></param>
        /// <returns></returns>
        public override Exceptional Execute(DBContext myDBContext, GraphDBType myGraphDBType)
        {
            TypeAttribute Attribute = myGraphDBType.GetTypeAttributeByName(OldName);

            if (Attribute == null)
            {
                return new Exceptional(new Error_AttributeIsNotDefined(OldName));
            }

            return myGraphDBType.RenameBackwardedge(Attribute, NewName, myDBContext.DBTypeManager);
        }
开发者ID:TheByte,项目名称:sones,代码行数:17,代码来源:AlterType_RenameBackwardedge.cs


示例18: CreateRenameResult

        protected IEnumerable<Vertex> CreateRenameResult(String myAlterAction, String myFromString, String myToString, GraphDBType myType)
        {
            var payload = new Dictionary<String, Object>();

            payload.Add("TYPE",   myType);
            payload.Add("ACTION", myAlterAction);
            payload.Add("FROM",   myFromString);
            payload.Add("TO",     myToString);

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


示例19: ExtractValue

 public override Exceptional<IObject> ExtractValue(DBObjectStream dbObjectStream, GraphDBType graphDBType, DBContext dbContext)
 {
     var myType = dbContext.DBTypeManager.GetTypeByUUID(dbObjectStream.TypeUUID);
     if (myType != null)
     {
         return new Exceptional<IObject>(new DBString(myType.Name));
     }
     else
     {
         return new Exceptional<IObject>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
     }
 }
开发者ID:TheByte,项目名称:sones,代码行数:12,代码来源:SpecialTypeAttribute_TYPE.cs


示例20: GetValueForAttribute

        public override Exceptional<IObject> GetValueForAttribute(DBObjectStream aDBObject, DBContext dbContext, GraphDBType _Type)
        {
            #region ListOfDBObjects

            if (AttributeIDChain.LastAttribute.GetDBType(dbContext.DBTypeManager).IsUserDefined)
            {
                //userdefined
                //value = aSetNode.GetCorrespondigDBObjectUUIDs(aTaskNode.AttributeIDNodee, typeManager, dbObjectCache, mySessionToken);

                if (CollectionDefinition.CollectionType == CollectionType.SetOfUUIDs)
                {
                    var retVal = CollectionDefinition.TupleDefinition.GetAsUUIDEdge(dbContext, AttributeIDChain.LastAttribute);
                    if (!retVal.Success())
                    {
                        return new Exceptional<IObject>(retVal);
                    }
                    else
                    {
                        return new Exceptional<IObject>(retVal.Value);
                    }
                }
                else
                {
                    var edge = (IEdgeType)(CollectionDefinition.TupleDefinition.GetCorrespondigDBObjectUUIDAsList(_Type, dbContext, AttributeIDChain.LastAttribute.EdgeType.GetNewInstance(), AttributeIDChain.LastAttribute.GetDBType(dbContext.DBTypeManager)).Value);
                    return new Exceptional<IObject>(edge);
                }
            }
            else
            {
                //not userdefined

                var edge = GetBasicList(dbContext);
                if (edge.Failed())
                {
                    return new Exceptional<IObject>(edge);
                }

                // If the collection was declared as a SETOF insert
                if (CollectionDefinition.CollectionType == CollectionType.Set)
                {
                    edge.Value.Distinction();
                }

                return new Exceptional<IObject>(edge.Value);
            }

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BasicTypes.ADBBaseObject类代码示例发布时间:2022-05-26
下一篇:
C# imp.MRPDbContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap