Package org.apache.tinkerpop.gremlin.gql
Class GqlMatchPlan
java.lang.Object
org.apache.tinkerpop.gremlin.gql.GqlMatchPlan
The compiled physical execution plan for a GQL MATCH query. A
GqlMatchPlan is an
ordered sequence of ExtensionStep objects produced by the
TinkerGraphGqlPlanner from a QueryGraph.
The planner selects a seed vertex (lowest-cardinality anchor) and emits one
ExtensionStep per edge in the QueryGraph, ordered so each step's anchor
variable is bound before the step executes. The executor iterates these steps to perform
DFS backtracking pattern matching.
The seed node is described by getSeedVariable(), getSeedLabel(), and
getSeedPredicates(). The executor binds the seed variable first (iterating all
vertices matching the seed label and property predicates) before processing the extension steps.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix used for synthetic variable names assigned to anonymous pattern nodes/edges (those written without an explicit variable, e.g. -
Constructor Summary
ConstructorsConstructorDescriptionGqlMatchPlan(String seedVariable, String seedLabel, List<ExtensionStep> steps, Map<String, Integer> variableIndex, String[] variables) GqlMatchPlan(String seedVariable, String seedLabel, List<ExtensionStep> steps, Map<String, Integer> variableIndex, String[] variables, List<PropertyPredicate> seedPredicates) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the binding-array index for the given variable name.Returns the label constraint of the seed node, ornullif unconstrained.Returns property equality predicates on the seed node derived from its inline filter map.Returns the effective variable name of the seed node.intReturns the index of the seed variable in the binding array.getSteps()Returns the ordered list of extension steps that the executor will process.intReturns the total number of variables (= binding array length).String[]Returns the variable name at each binding-array index.booleanisEmpty()Returns true if the plan has no steps (e.g., a single-node pattern with no edges).toString()
-
Field Details
-
ANON_VAR_PREFIX
Prefix used for synthetic variable names assigned to anonymous pattern nodes/edges (those written without an explicit variable, e.g.()-[:knows]->()). Variables with this prefix are internal bookkeeping and are never exposed in result binding maps or traverser paths.- See Also:
-
-
Constructor Details
-
GqlMatchPlan
public GqlMatchPlan(String seedVariable, String seedLabel, List<ExtensionStep> steps, Map<String, Integer> variableIndex, String[] variables, List<PropertyPredicate> seedPredicates) -
GqlMatchPlan
-
-
Method Details
-
getSeedVariable
Returns the effective variable name of the seed node. May be a synthetic name (prefixed with$anon) if the seed node has no explicit variable. -
getSeedLabel
Returns the label constraint of the seed node, ornullif unconstrained. -
getSeedPredicates
Returns property equality predicates on the seed node derived from its inline filter map. The executor applies these when iterating seed candidates. Empty if no filter was specified on the seed node. -
getSteps
Returns the ordered list of extension steps that the executor will process. -
getSeedVariableIndex
public int getSeedVariableIndex()Returns the index of the seed variable in the binding array. Always 0. -
getIndex
Returns the binding-array index for the given variable name. -
getVariableCount
public int getVariableCount()Returns the total number of variables (= binding array length). -
getVariables
Returns the variable name at each binding-array index. Used byTinkerGraphMatchStepto iterate result rows by index. -
isEmpty
public boolean isEmpty()Returns true if the plan has no steps (e.g., a single-node pattern with no edges). -
toString
-