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); }
//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); }
//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); }