public GremlinMatchPath(GremlinFreeVertexVariable sourceVariable, GremlinFreeEdgeVariable edgeVariable, GremlinFreeVertexVariable sinkVariable, bool isReversed) { SourceVariable = sourceVariable; EdgeVariable = edgeVariable; SinkVariable = sinkVariable; IsReversed = isReversed; }
internal static WEdgeColumnReferenceExpression GetEdgeColumnReferenceExpr(GremlinFreeEdgeVariable edgeTable) { return(new WEdgeColumnReferenceExpression() { MultiPartIdentifier = GetMultiPartIdentifier("Edge"), Alias = edgeTable.GetVariableName(), MinLength = 1, MaxLength = 1, EdgeType = edgeTable.EdgeType }); }
internal override void InE(GremlinToSqlContext currentContext, List <string> edgeLabels) { if (this.IsTraversalToBound) { base.InE(currentContext, edgeLabels); return; } GremlinFreeEdgeVariable inEdge = new GremlinFreeEdgeVariable(WEdgeType.InEdge); currentContext.VariableList.Add(inEdge); currentContext.AddLabelPredicateForEdge(inEdge, edgeLabels); currentContext.MatchPathList.Add(new GremlinMatchPath(null, inEdge, this, false)); currentContext.SetPivotVariable(inEdge); }
internal override void OutE(GremlinToSqlContext currentContext, List <string> edgeLabels) { if (this.isTraversalToBound) { base.OutE(currentContext, edgeLabels); return; } GremlinFreeEdgeVariable outEdgeVar = new GremlinFreeEdgeVariable(WEdgeType.OutEdge); currentContext.VariableList.Add(outEdgeVar); currentContext.AddLabelPredicateForEdge(outEdgeVar, edgeLabels); currentContext.MatchPathList.Add(new GremlinMatchPath(this, outEdgeVar, null)); currentContext.SetPivotVariable(outEdgeVar); }
internal override void Out(GremlinToSqlContext currentContext, List <string> edgeLabels) { if (this.IsTraversalToBound) { base.Out(currentContext, edgeLabels); return; } GremlinFreeEdgeVariable outEdge = new GremlinFreeEdgeVariable(WEdgeType.OutEdge); currentContext.VariableList.Add(outEdge); currentContext.AddLabelPredicateForEdge(outEdge, edgeLabels); GremlinFreeVertexVariable outVertex = new GremlinFreeVertexVariable(); currentContext.VariableList.Add(outVertex); currentContext.TableReferencesInFromClause.Add(outVertex); currentContext.MatchPathList.Add(new GremlinMatchPath(this, outEdge, outVertex, false)); currentContext.SetPivotVariable(outVertex); }
internal override void In(GremlinToSqlContext currentContext, List <string> edgeLabels) { if (this.isTraversalToBound) { base.In(currentContext, edgeLabels); return; } GremlinFreeEdgeVariable inEdge = new GremlinFreeEdgeVariable(WEdgeType.InEdge); currentContext.VariableList.Add(inEdge); currentContext.AddLabelPredicateForEdge(inEdge, edgeLabels); GremlinFreeVertexVariable outVertex = new GremlinFreeVertexVariable(); currentContext.VariableList.Add(outVertex); currentContext.TableReferences.Add(outVertex); currentContext.MatchPathList.Add(new GremlinMatchPath(outVertex, inEdge, this)); currentContext.SetPivotVariable(outVertex); }
internal override void Both(GremlinToSqlContext currentContext, List <string> edgeLabels) { if (this.IsTraversalToBound) { base.Both(currentContext, edgeLabels); return; } GremlinFreeEdgeVariable bothEdge = new GremlinFreeEdgeVariable(WEdgeType.BothEdge); currentContext.VariableList.Add(bothEdge); currentContext.AddLabelPredicateForEdge(bothEdge, edgeLabels); GremlinFreeVertexVariable bothVertex = new GremlinFreeVertexVariable(); currentContext.VariableList.Add(bothVertex); // In this case, the both-edgeTable variable is not added to the table-reference list. // Instead, we populate a path this_variable-[bothEdge]->bothVertex in the context currentContext.TableReferencesInFromClause.Add(bothVertex); currentContext.MatchPathList.Add(new GremlinMatchPath(this, bothEdge, bothVertex, false)); currentContext.SetPivotVariable(bothVertex); }
public GremlinMatchPath(GremlinFreeVertexVariable sourceVariable, GremlinFreeEdgeVariable edgeVariable, GremlinFreeVertexVariable sinkVariable) { SourceVariable = sourceVariable; EdgeVariable = edgeVariable; SinkVariable = sinkVariable; }