internal override GremlinToSqlContext GetContext() { GremlinToSqlContext inputContext = GetInputContext(); FromVertexTraversal?.GetStartOp().InheritedVariableFromParent(inputContext); GremlinToSqlContext fromVertexContext = FromVertexTraversal?.GetEndOp().GetContext(); ToVertexTraversal?.GetStartOp().InheritedVariableFromParent(inputContext); GremlinToSqlContext toVertexContext = ToVertexTraversal?.GetEndOp().GetContext(); List <GremlinProperty> edgeProperties = new List <GremlinProperty>(); edgeProperties.AddRange(EdgePropertyOps.Select(propertyOp => propertyOp.ToGremlinProperty(inputContext))); if (inputContext.PivotVariable == null) { if (fromVertexContext == null || toVertexContext == null) { throw new SyntaxErrorException("The PivotVariable of addE()-step and fromTraversal( or toTraversal) can't be null at the same time."); } GremlinAddETableVariable newTableVariable = new GremlinAddETableVariable(null, EdgeLabel, edgeProperties, fromVertexContext, toVertexContext, true); inputContext.VariableList.Add(newTableVariable); inputContext.TableReferencesInFromClause.Add(newTableVariable); inputContext.SetPivotVariable(newTableVariable); } else { inputContext.PivotVariable.AddE(inputContext, EdgeLabel, edgeProperties, fromVertexContext, toVertexContext); } return(inputContext); }
/// <summary> /// Step Funtions /// </summary> internal virtual void AddE(GremlinToSqlContext currentContext, string edgeLabel) { GremlinAddETableVariable newTableVariable = new GremlinAddETableVariable(this, edgeLabel); currentContext.VariableList.Add(newTableVariable); currentContext.TableReferences.Add(newTableVariable); currentContext.SetPivotVariable(newTableVariable); }
/// <summary> /// Step Funtions /// </summary> internal virtual void AddE(GremlinToSqlContext currentContext, string edgeLabel, List <GremlinProperty> edgeProperties, GremlinToSqlContext fromContext, GremlinToSqlContext toContext) { GremlinAddETableVariable newTableVariable = new GremlinAddETableVariable(this, edgeLabel, edgeProperties, fromContext, toContext); currentContext.VariableList.Add(newTableVariable); currentContext.TableReferences.Add(newTableVariable); currentContext.SetPivotVariable(newTableVariable); }