internal override void Unfold(GremlinToSqlContext currentContext) { GremlinTableVariable newVariable = GremlinUnfoldVariable.Create(this); currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }
internal virtual void Optional(GremlinToSqlContext currentContext, GremlinToSqlContext optionalContext) { GremlinTableVariable newVariable = GremlinOptionalVariable.Create(this, optionalContext); currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }
internal virtual void Map(GremlinToSqlContext currentContext, GremlinToSqlContext mapContext) { GremlinTableVariable mapVariable = GremlinMapVariable.Create(mapContext); currentContext.VariableList.Add(mapVariable); currentContext.TableReferences.Add(mapVariable); currentContext.SetPivotVariable(mapVariable); }
internal virtual void Coalesce(GremlinToSqlContext currentContext, List <GremlinToSqlContext> coalesceContextList) { GremlinTableVariable newVariable = GremlinCoalesceVariable.Create(coalesceContextList); currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }
internal virtual void Repeat(GremlinToSqlContext currentContext, GremlinToSqlContext repeatContext, RepeatCondition repeatCondition) { GremlinTableVariable newVariable = GremlinRepeatVariable.Create(this, repeatContext, repeatCondition); currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }
internal virtual void Local(GremlinToSqlContext currentContext, GremlinToSqlContext localContext) { GremlinTableVariable localMapVariable = GremlinLocalVariable.Create(localContext); currentContext.VariableList.Add(localMapVariable); currentContext.VariableList.AddRange(localContext.VariableList); currentContext.TableReferences.Add(localMapVariable); currentContext.SetPivotVariable(localMapVariable); }
internal virtual void Union(ref GremlinToSqlContext currentContext, List <GremlinToSqlContext> unionContexts) { GremlinTableVariable newVariable = GremlinUnionVariable.Create(unionContexts); foreach (var unionContext in unionContexts) { unionContext.HomeVariable = newVariable; } currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }
internal void OutV(GremlinVariable lastVariable) { if (lastVariable is GremlinFreeEdgeTableVariable) { var path = GetPathFromPathList(lastVariable); if (path != null && path.SourceVariable != null) { if (IsVariableInCurrentContext(path.SourceVariable)) { SetPivotVariable(path.SourceVariable); } else { GremlinContextVariable newContextVariable = GremlinContextVariable.Create(path.SourceVariable); VariableList.Add(newContextVariable); SetPivotVariable(newContextVariable); } } else { GremlinVariableProperty sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV); GremlinTableVariable outVertex = lastVariable.CreateAdjVertex(sourceProperty); if (path != null) { path.SetSourceVariable(outVertex); } VariableList.Add(outVertex); TableReferences.Add(outVertex); SetPivotVariable(outVertex); } } else { GremlinVariableProperty sourceProperty = lastVariable.GetVariableProperty(GremlinKeyword.EdgeSourceV); GremlinTableVariable outVertex = new GremlinBoundVertexVariable(lastVariable.GetEdgeType(), sourceProperty); VariableList.Add(outVertex); TableReferences.Add(outVertex); SetPivotVariable(outVertex); } }