예제 #1
0
        internal void Out(GremlinVariable lastVariable, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = lastVariable.GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       labelProperty  = lastVariable.GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable outEdgeTable   = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, labelProperty, WEdgeType.OutEdge);

            VariableList.Add(outEdgeTable);
            TableReferences.Add(outEdgeTable);
            AddLabelPredicateForEdge(outEdgeTable, edgeLabels);

            GremlinVariableProperty    sinkProperty = outEdgeTable.GetVariableProperty(GremlinKeyword.EdgeSinkV);
            GremlinBoundVertexVariable inVertex     = new GremlinBoundVertexVariable(outEdgeTable.GetEdgeType(), sinkProperty);

            VariableList.Add(inVertex);
            TableReferences.Add(inVertex);

            AddPath(new GremlinMatchPath(lastVariable, outEdgeTable, inVertex));

            SetPivotVariable(inVertex);
        }
예제 #2
0
        internal void In(GremlinVariable lastVariable, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = lastVariable.GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinVariableProperty       labelProperty  = lastVariable.GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable inEdgeTable    = new GremlinBoundEdgeTableVariable(sourceProperty, adjReverseEdge,
                                                                                             labelProperty, WEdgeType.InEdge);

            VariableList.Add(inEdgeTable);
            TableReferences.Add(inEdgeTable);
            AddLabelPredicateForEdge(inEdgeTable, edgeLabels);

            GremlinVariableProperty    edgeProperty = inEdgeTable.GetVariableProperty(GremlinKeyword.EdgeSourceV);
            GremlinBoundVertexVariable outVertex    = new GremlinBoundVertexVariable(inEdgeTable.GetEdgeType(), edgeProperty);

            VariableList.Add(outVertex);
            TableReferences.Add(outVertex);

            AddPath(new GremlinMatchPath(outVertex, inEdgeTable, lastVariable));

            SetPivotVariable(outVertex);
        }
예제 #3
0
        internal void Both(GremlinVariable lastVariable, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = lastVariable.GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinVariableProperty       adjEdge        = lastVariable.GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       labelProperty  = lastVariable.GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable bothEdgeTable  = new GremlinBoundEdgeTableVariable(sourceProperty,
                                                                                             adjEdge,
                                                                                             adjReverseEdge,
                                                                                             labelProperty,
                                                                                             WEdgeType.BothEdge);

            VariableList.Add(bothEdgeTable);
            TableReferences.Add(bothEdgeTable);
            AddLabelPredicateForEdge(bothEdgeTable, edgeLabels);

            GremlinVariableProperty    otherProperty = bothEdgeTable.GetVariableProperty(GremlinKeyword.EdgeOtherV);
            GremlinBoundVertexVariable otherVertex   = new GremlinBoundVertexVariable(bothEdgeTable.GetEdgeType(), otherProperty);

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