Class GqlMatchStep<S>

Type Parameters:
S - the traverser start type
All Implemented Interfaces:
Serializable, Cloneable, Iterator<Traverser.Admin<Map<String,Object>>>, Step<S,Map<String,Object>>, Configuring, Parameterizing

public final class GqlMatchStep<S> extends DeclarativeMatchStep<S>
Concrete executable replacement for the generic DeclarativeMatchStep that runs TinkerGQL patterns via a GqlPlanner and GqlExecutor.

The planner and executor are normally supplied by GqlDeclarativeMatchStrategy, which caches one pair per graph instance so the planner's parse cache is shared across all traversals on the same graph. When the step is constructed without injected instances (e.g. in tests that use a substitute strategy), they are initialised lazily from the traversal's graph on the first call to processNextStart().

For each incoming traverser the plan is executed against the graph and one output traverser is emitted per result row. Each result row's named variable bindings are recorded in the emitted traverser's path so that downstream select() steps can retrieve them by name.

Only the "gql" query language is supported. If the step's query language is set to any other non-null value, UnsupportedOperationException is thrown.

See Also:
  • Field Details

    • SUPPORTED_QUERY_LANGUAGE

      public static final String SUPPORTED_QUERY_LANGUAGE
      The query language identifier that this step accepts when set explicitly. null is also accepted and is treated as a request to use this native language.
      See Also:
  • Constructor Details

    • GqlMatchStep

      public GqlMatchStep(DeclarativeMatchStep<S> originalStep)
      Constructs a GqlMatchStep without pre-injected planner or executor. Both are initialised lazily from the traversal's graph on the first processNextStart() call. Intended for use in tests where a substitute strategy replaces the placeholder step without access to the shared graph-level cache.
      Parameters:
      originalStep - the step being replaced by this concrete implementation
    • GqlMatchStep

      public GqlMatchStep(DeclarativeMatchStep<S> originalStep, GqlPlanner planner, GqlExecutor executor)
      Constructs a GqlMatchStep with pre-injected planner and executor. When planner and executor are non-null the plan cache is shared across all traversals that use the same objects — normally the per-graph-instance pair cached by GqlDeclarativeMatchStrategy.
      Parameters:
      originalStep - the step being replaced
      planner - the planner to use, or null for lazy init
      executor - the executor to use, or null for lazy init
  • Method Details