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


C# IVertex.GetOutgoingHyperEdge方法代码示例

本文整理汇总了C#中IVertex.GetOutgoingHyperEdge方法的典型用法代码示例。如果您正苦于以下问题:C# IVertex.GetOutgoingHyperEdge方法的具体用法?C# IVertex.GetOutgoingHyperEdge怎么用?C# IVertex.GetOutgoingHyperEdge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVertex的用法示例。


在下文中一共展示了IVertex.GetOutgoingHyperEdge方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetHyperEdge

        public static IHyperEdge GetHyperEdge(this IOutgoingEdgeDefinition myProperty, IVertex myVertex)
        {
            if (myProperty == null)
                throw new NullReferenceException();

            return myVertex.GetOutgoingHyperEdge(myProperty.ID);
        }
开发者ID:anukat2015,项目名称:sones,代码行数:7,代码来源:IOutgoingEdgeDefinitionExtension.cs

示例2: CheckIfToBeAddedElementAlreadyExist

        /// <summary>
        /// This method checks if a element inside the to be updated edge already exist,
        /// if it exist an exception is thrown.
        /// </summary>
        /// <param name="myVertex">the to be updated vertex.</param>
        /// <param name="myEdgeDef">The edge definition.</param>
        /// <param name="myEdgePredef">The update edge predefinition.</param>
        /// <param name="myTransaction">TransactionID</param>
        /// <param name="mySecurityToken">SecurityToken</param>
        private void CheckIfToBeAddedElementAlreadyExist(IVertex myVertex,
                                                            IOutgoingEdgeDefinition myEdgeDef,
                                                            EdgePredefinition myEdgePredef,
                                                            Int64 myTransaction,
                                                            SecurityToken mySecurityToken)
        {
            switch (myEdgeDef.Multiplicity)
            {
                case EdgeMultiplicity.HyperEdge:
                    break;
                case EdgeMultiplicity.MultiEdge:
                    var newTargets = GetResultingVertexIDs(myTransaction, mySecurityToken, myEdgePredef, myEdgeDef.TargetVertexType);
                    var existTargets = myVertex.GetOutgoingHyperEdge(myEdgeDef.ID) == null
                                        ? new List<IVertex>()
                                        : myVertex.GetOutgoingHyperEdge(myEdgeDef.ID).GetTargetVertices();

                    if (newTargets == null)
                    {
                        if (myEdgePredef.ContainedEdges != null)
                        {
                            foreach (var innerEdge in myEdgePredef.ContainedEdges)
                            {
                                newTargets = GetResultingVertexIDs(myTransaction, mySecurityToken, innerEdge, myEdgeDef.TargetVertexType);
                                
                                foreach (var target in newTargets)
                                    if (existTargets.Any(item => item.VertexID.Equals(target.VertexID) && 
                                            item.VertexTypeID.Equals(target.VertexTypeID)))
                                        throw new VertexAlreadyExistException(target.VertexTypeID, target.VertexID);
                            }
                        }
                    }
                    else
                        foreach (var target in newTargets)
                            if (existTargets.Any(item => item.VertexID.Equals(target.VertexID) &&
                                        item.VertexTypeID.Equals(target.VertexTypeID)))
                                throw new VertexAlreadyExistException(target.VertexTypeID, target.VertexID);

                    break;
                default: throw new Exception("The EdgeMultiplicity enumeration was changed, but not this switch statement.");
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:50,代码来源:ExecuteVertexHandler.cs

示例3: CreateVertexUpdateDefinition


//.........这里部分代码省略.........

                        var edgeDef = myVertexType.GetOutgoingEdgeDefinition(edge.EdgeName);
                        switch (edgeDef.Multiplicity)
                        {
                            case EdgeMultiplicity.SingleEdge:
                                {
                                    var targets = GetResultingVertexIDs(myTransaction, mySecurity, edge, edgeDef.TargetVertexType);
                                    if (targets == null || !targets.CountIsGreater(0))
                                    {
                                        toBeDeletedSingle = toBeDeletedSingle ?? new List<long>();
                                        toBeDeletedSingle.Add(edgeDef.ID);
                                    }
                                    else if (targets.CountIsGreater(1))
                                    {
                                        throw new Exception("Single edge can not have more than one target.");
                                    }
                                    else
                                    {
                                        ConvertUnknownProperties(edge, edgeDef.EdgeType);
                                        var structured = CreateStructuredUpdate(edge.StructuredProperties, edgeDef.EdgeType);
                                        var unstructured = CreateUnstructuredUpdate(edge.UnstructuredProperties);

                                        toBeUpdatedSingle = toBeUpdatedSingle ?? new Dictionary<long, SingleEdgeUpdateDefinition>();
                                        toBeUpdatedSingle.Add(edgeDef.ID, new SingleEdgeUpdateDefinition(source, targets.First(), edgeDef.EdgeType.ID, edge.Comment, structured, unstructured));
                                    }
                                }
                                break;
                            case EdgeMultiplicity.MultiEdge:
                                {
                                    List<SingleEdgeDeleteDefinition> internSingleDelete = null;
                                    if (myVertex.HasOutgoingEdge(edgeDef.ID))
                                    {
                                        internSingleDelete = new List<SingleEdgeDeleteDefinition>();
                                        foreach (var edgeInstance in myVertex.GetOutgoingHyperEdge(edgeDef.ID).GetTargetVertices())
                                        {
                                            internSingleDelete.Add(new SingleEdgeDeleteDefinition(source, new VertexInformation(edgeInstance.VertexTypeID, edgeInstance.VertexID)));
                                        }
                                    }

                                    List<SingleEdgeUpdateDefinition> internSingleUpdate = null;
                                    var targets = GetResultingVertexIDs(myTransaction, mySecurity, edge, edgeDef.TargetVertexType);

                                    if (targets != null)
                                    {
                                        foreach (var target in targets)
                                        {
                                            internSingleUpdate = internSingleUpdate ?? new List<SingleEdgeUpdateDefinition>();
                                            internSingleUpdate.Add(new SingleEdgeUpdateDefinition(source, target, edgeDef.InnerEdgeType.ID));
                                        }
                                    }
                                    if (edge.ContainedEdges != null)
                                    {
                                        foreach (var innerEdge in edge.ContainedEdges)
                                        {
                                            targets = GetResultingVertexIDs(myTransaction, mySecurity, innerEdge, edgeDef.TargetVertexType);
                                            if (targets != null && targets.CountIsGreater(0))
                                            {
                                                ConvertUnknownProperties(innerEdge, edgeDef.InnerEdgeType);
                                                var structured = CreateStructuredUpdate(innerEdge.StructuredProperties, edgeDef.InnerEdgeType);
                                                var unstructured = CreateUnstructuredUpdate(innerEdge.UnstructuredProperties);

                                                foreach (var target in targets)
                                                {
                                                    internSingleUpdate = internSingleUpdate ?? new List<SingleEdgeUpdateDefinition>();
                                                    internSingleUpdate.Add(new SingleEdgeUpdateDefinition(source, target, edgeDef.InnerEdgeType.ID, innerEdge.Comment, structured, unstructured));
开发者ID:loubo,项目名称:sones,代码行数:66,代码来源:ExecuteVertexHandler.cs

示例4: GetIndexedProperties

        private static IList<IPropertyDefinition> GetIndexedProperties(IVertex myIndexVertex)
        {
            var edge = myIndexVertex.GetOutgoingHyperEdge((long)AttributeDefinitions.IndexDotIndexedProperties);
            if (edge == null)
                throw new UnknownDBException("An index has no vertex that represents its indexed properties.");

            var vertices = edge.GetAllEdges();
            if (vertices == null)
                throw new UnknownDBException("An index has no vertex that represents its indexed properties.");

            vertices = vertices.OrderBy(x => x.GetProperty<int>((long)AttributeDefinitions.OrderableEdgeDotOrder));

            return vertices.Select(x=> CreatePropertyDefinition(x.GetTargetVertex())).ToArray();
        }
开发者ID:loubo,项目名称:sones,代码行数:14,代码来源:BaseGraphStorageManager.cs


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