Esempio n. 1
0
 internal virtual void InheritedContextFromParent(GremlinToSqlContext parentContext)
 {
     if (this is GremlinParentContextOp)
     {
         GremlinParentContextOp rootAsContextOp = this as GremlinParentContextOp;
         rootAsContextOp.InheritedContext = parentContext.Duplicate();
     }
 }
Esempio n. 2
0
        internal virtual void Min(GremlinToSqlContext currentContext)
        {
            GremlinMinVariable newVariable = new GremlinMinVariable(currentContext.Duplicate());

            currentContext.Reset();
            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
            currentContext.SetPivotVariable(newVariable);
        }
Esempio n. 3
0
        internal virtual void Cap(GremlinToSqlContext currentContext, List <string> sideEffectKeys)
        {
            GremlinCapVariable newVariable = new GremlinCapVariable(currentContext.Duplicate(), sideEffectKeys);

            currentContext.Reset();
            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
            currentContext.SetPivotVariable(newVariable);
        }
Esempio n. 4
0
        internal virtual void Tree(GremlinToSqlContext currentContext, List <GraphTraversal2> byList)
        {
            GremlinPathVariable pathVariable = generatePath(currentContext, byList);
            GremlinTreeVariable newVariable  = new GremlinTreeVariable(currentContext.Duplicate(), pathVariable);

            currentContext.Reset();
            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
            currentContext.SetPivotVariable(newVariable);
        }
Esempio n. 5
0
        //internal virtual void ToE(GremlinToSqlContext currentContext, Direction direction, params string[] edgeLabels)
        //internal virtual void ToV(GremlinToSqlContext currentContext, Direction direction)
        internal virtual void Tree(GremlinToSqlContext currentContext)
        {
            GremlinPathVariable pathVariable = new GremlinPathVariable(currentContext.GetGremlinStepList());

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

            GremlinTreeVariable newVariable = new GremlinTreeVariable(currentContext.Duplicate(), pathVariable);

            currentContext.Reset();
            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
            currentContext.SetPivotVariable(newVariable);
        }
Esempio n. 6
0
 public GremlinAddETableVariable(GremlinToSqlContext inputContext, string edgeLabel,
                                 List <GremlinProperty> edgeProperties, GremlinToSqlContext fromContext, GremlinToSqlContext toContext,
                                 bool isFirstTableReference = false)
 {
     this.EdgeProperties = edgeProperties;
     this.EdgeLabel      = edgeLabel;
     this.InputContext   = inputContext?.Duplicate();
     this.EdgeType       = WEdgeType.OutEdge;
     this.OtherVIndex    = 1;
     this.ProjectedProperties.Add(GremlinKeyword.Label);
     this.FromVertexContext     = fromContext;
     this.ToVertexContext       = toContext;
     this.IsFirstTableReference = isFirstTableReference;
     this.ProjectedProperties.Add(GremlinKeyword.EdgeID);
     this.ProjectedProperties.Add(GremlinKeyword.EdgeSourceV);
     this.ProjectedProperties.Add(GremlinKeyword.EdgeSinkV);
     this.ProjectedProperties.Add(GremlinKeyword.EdgeOtherV);
     foreach (var edgeProperty in this.EdgeProperties)
     {
         this.ProjectedProperties.Add(edgeProperty.Key);
     }
 }
Esempio n. 7
0
 public GremlinAddVVariable(GremlinToSqlContext inputContext, string vertexLabel, HashSet <GremlinProperty> vertexProperties, bool isFirstTableReference = false)
 {
     this.InputContext               = inputContext?.Duplicate();
     this.VertexProperties           = new HashSet <GremlinProperty>(vertexProperties);
     this.VertexLabel                = vertexLabel;
     this.IsFirstTableReference      = isFirstTableReference;
     this.PropertyFromAddVParameters = new Dictionary <string, List <GremlinProperty> >();
     this.ProjectedProperties.Add(GremlinKeyword.NodeID);
     this.ProjectedProperties.Add(GremlinKeyword.Label);
     foreach (var property in vertexProperties)
     {
         this.ProjectedProperties.Add(property.Key);
         if (this.PropertyFromAddVParameters.ContainsKey(property.Key))
         {
             this.PropertyFromAddVParameters[property.Key].Add(property);
         }
         else
         {
             this.PropertyFromAddVParameters[property.Key] = new List <GremlinProperty> {
                 property
             };
         }
     }
 }