Пример #1
0
        internal void OtherV(GremlinVariable lastVariable)
        {
            switch (lastVariable.GetEdgeType())
            {
            case WEdgeType.Undefined:
            case WEdgeType.BothEdge:
                GremlinVariableProperty    otherProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeOtherV);
                GremlinBoundVertexVariable otherVertex   = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), otherProperty);
                VariableList.Add(otherVertex);
                TableReferences.Add(otherVertex);
                SetPivotVariable(otherVertex);
                break;

            case WEdgeType.InEdge:
                OutV(lastVariable);
                break;

            case WEdgeType.OutEdge:
                InV(lastVariable);
                break;
            }
        }
Пример #2
0
        internal void OutV(GremlinVariable lastVariable)
        {
            if (lastVariable is GremlinFreeEdgeTableVariable)
            {
                var path = GetPathFromPathList(lastVariable);

                if (path != null && path.SourceVariable != null)
                {
                    if (IsVariableInCurrentContext(path.SourceVariable))
                    {
                        SetPivotVariable(path.SourceVariable);
                    }
                    else
                    {
                        GremlinContextVariable newContextVariable = GremlinContextVariable.Create(path.SourceVariable);
                        VariableList.Add(newContextVariable);
                        SetPivotVariable(newContextVariable);
                    }
                }
                else
                {
                    GremlinVariableProperty sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
                    GremlinTableVariable    outVertex      = lastVariable.CreateAdjVertex(sourceProperty);
                    if (path != null)
                    {
                        path.SetSourceVariable(outVertex);
                    }

                    VariableList.Add(outVertex);
                    TableReferences.Add(outVertex);
                    SetPivotVariable(outVertex);
                }
            }
            else
            {
                GremlinVariableProperty sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
                GremlinTableVariable    outVertex      = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), sourceProperty);
                VariableList.Add(outVertex);
                TableReferences.Add(outVertex);
                SetPivotVariable(outVertex);
            }
        }
Пример #3
0
        internal void BothV(GremlinVariable lastVariable)
        {
            GremlinVariableProperty    sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
            GremlinVariableProperty    sinkProperty   = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSinkV);
            GremlinBoundVertexVariable bothVertex     = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), sourceProperty, sinkProperty);

            VariableList.Add(bothVertex);
            TableReferences.Add(bothVertex);
            SetPivotVariable(bothVertex);
        }