Ejemplo n.º 1
0
        internal virtual void OutE(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinBoundEdgeTableVariable outEdgeTable   = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, WEdgeType.OutEdge);

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

            currentContext.SetPivotVariable(outEdgeTable);
        }
Ejemplo n.º 2
0
        internal virtual void InE(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinVariableProperty       labelProperty  = GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable inEdgeTable    = new GremlinBoundEdgeTableVariable(sourceProperty, adjReverseEdge, labelProperty, WEdgeType.InEdge);

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

            //currentContext.PathList.Add(new GremlinMatchPath(null, inEdgeTable, this));
            currentContext.SetPivotVariable(inEdgeTable);
        }
Ejemplo n.º 3
0
        internal void OutE(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);

            AddPath(new GremlinMatchPath(lastVariable, outEdgeTable, null));
            SetPivotVariable(outEdgeTable);
        }
Ejemplo n.º 4
0
        internal void BothE(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);

            SetPivotVariable(bothEdgeTable);
        }
Ejemplo n.º 5
0
        internal virtual void In(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjReverseEdge = GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinBoundEdgeTableVariable inEdgeTable    = new GremlinBoundEdgeTableVariable(sourceProperty, adjReverseEdge, WEdgeType.InEdge);

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

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

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

            currentContext.SetPivotVariable(outVertex);
        }
Ejemplo n.º 6
0
        internal virtual void Out(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       labelProperty  = GetVariableProperty(GremlinKeyword.Label);
            GremlinBoundEdgeTableVariable outEdgeTable   = new GremlinBoundEdgeTableVariable(sourceProperty, adjEdge, labelProperty, WEdgeType.OutEdge);

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

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

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

            //currentContext.PathList.Add(new GremlinMatchPath(this, outEdgeTable, inVertex));

            currentContext.SetPivotVariable(inVertex);
        }
Ejemplo n.º 7
0
        internal virtual void Both(GremlinToSqlContext currentContext, List <string> edgeLabels)
        {
            GremlinVariableProperty       sourceProperty = GetVariableProperty(GremlinKeyword.NodeID);
            GremlinVariableProperty       adjEdge        = GetVariableProperty(GremlinKeyword.EdgeAdj);
            GremlinVariableProperty       adjReverseEdge = GetVariableProperty(GremlinKeyword.ReverseEdgeAdj);
            GremlinBoundEdgeTableVariable bothEdgeTable  = new GremlinBoundEdgeTableVariable(
                sourceProperty,
                adjEdge,
                adjReverseEdge,
                WEdgeType.BothEdge);

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

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

            currentContext.VariableList.Add(otherVertex);
            currentContext.TableReferences.Add(otherVertex);
            currentContext.SetPivotVariable(otherVertex);
        }
Ejemplo n.º 8
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);
        }