internal override GremlinPathStepVariable GetAndPopulatePath()
        {
            GremlinPathVariable pathVariable = RepeatContext.PopulateGremlinPath();

            pathVariable.IsInRepeatContext = true;
            return(new GremlinPathStepVariable(pathVariable, this));
        }
Beispiel #2
0
        private GremlinPathVariable generatePath(GremlinToSqlContext currentContext, List <GraphTraversal2> byList = null)
        {
            List <GremlinToSqlContext>     byContexts = new List <GremlinToSqlContext>();
            List <GremlinPathStepVariable> steps      = currentContext.GetGremlinStepList();

            if (byList == null)
            {
                byList = new List <GraphTraversal2> {
                    GraphTraversal2.__()
                };
            }

            foreach (var by in byList)
            {
                GremlinToSqlContext       newContext = new GremlinToSqlContext();
                GremlinDecompose1Variable decompose1 = new GremlinDecompose1Variable(steps);
                newContext.VariableList.Add(decompose1);
                newContext.TableReferences.Add(decompose1);
                newContext.SetPivotVariable(decompose1);

                by.GetStartOp().InheritedContextFromParent(newContext);
                byContexts.Add(by.GetEndOp().GetContext());
            }

            GremlinPathVariable newVariable = new GremlinPathVariable(steps, byContexts);

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

            return(newVariable);
        }
Beispiel #3
0
        internal virtual void Tree(GremlinToSqlContext currentContext, string sideEffectKey, List <GraphTraversal2> byList)
        {
            GremlinPathVariable           pathVariable = generatePath(currentContext, byList);
            GremlinTreeSideEffectVariable newVariable  = new GremlinTreeSideEffectVariable(sideEffectKey, pathVariable);

            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
        }
Beispiel #4
0
        //internal virtual void PageRank()
        //internal virtual void PageRank(double alpha)
        internal virtual void Path(GremlinToSqlContext currentContext)
        {
            GremlinPathVariable newVariable = new GremlinPathVariable(currentContext.GetGremlinStepList());

            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
            currentContext.SetPivotVariable(newVariable);
        }
Beispiel #5
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);
        }
        internal override GremlinPathStepVariable GetAndPopulatePath()
        {
            List <GremlinVariable> pathStepVariableList = new List <GremlinVariable>();

            foreach (var context in UnionContextList)
            {
                GremlinPathVariable newVariable = context.PopulateGremlinPath();
                pathStepVariableList.Add(newVariable);
            }
            return(new GremlinPathStepVariable(pathStepVariableList, this));
        }
Beispiel #7
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);
        }
Beispiel #8
0
 public GremlinSelectVariable(GremlinVariable inputVariable,
                              GremlinPathVariable pathVariable,
                              List <GremlinVariable> sideEffectVariables,
                              GremlinKeyword.Pop pop,
                              List <string> selectKeys,
                              List <GremlinToSqlContext> byContexts)
     : base(GremlinVariableType.Table)
 {
     InputVariable       = inputVariable;
     PathVariable        = pathVariable;
     SideEffectVariables = sideEffectVariables;
     Pop        = pop;
     SelectKeys = selectKeys;
     ByContexts = byContexts;
 }
Beispiel #9
0
        internal void PopulateGremlinPath()
        {
            if (IsPopulateGremlinPath)
            {
                return;
            }

            GremlinPathVariable newVariable = new GremlinPathVariable(GetCurrAndChildGremlinStepList());

            VariableList.Add(newVariable);
            TableReferences.Add(newVariable);
            CurrentContextPath = newVariable;

            IsPopulateGremlinPath = true;
        }
 public GremlinCyclicPathVariable(GremlinPathVariable pathVariable) : base(GremlinVariableType.Table)
 {
     PathVariable = pathVariable;
 }
        internal override GremlinPathStepVariable GetAndPopulatePath()
        {
            GremlinPathVariable pathVariable = LocalContext.PopulateGremlinPath();

            return(new GremlinPathStepVariable(pathVariable, this));
        }
 public GremlinTreeSideEffectVariable(string sideEffectKey, GremlinPathVariable pathVariable)
 {
     SideEffectKey = sideEffectKey;
     PathVariable  = pathVariable;
     Labels.Add(sideEffectKey);
 }
 public GremlinSimplePathVariable(GremlinPathVariable pathVariable) : base(GremlinVariableType.Table)
 {
     PathVariable = pathVariable;
 }
Beispiel #14
0
 public GremlinCyclicPathVariable(GremlinPathVariable pathVariable) : base(pathVariable.GetVariableType())
 {
     this.PathVariable = pathVariable;
 }
 public GremlinTreeSideEffectVariable(string sideEffectKey, GremlinPathVariable pathVariable) : base(GremlinVariableType.Tree)
 {
     this.SideEffectKey = sideEffectKey;
     this.PathVariable  = pathVariable;
     this.Labels.Add(sideEffectKey);
 }