explain

Explain the traversal strategies used in a traversal.

Synopsis

explain()
Table 1. Legend
Syntax conventions Description
Lowercase and uppercase Literal keyword. Includes ().
Italics Variable value. Replace with a user-defined value.
[] Optional. Square brackets ( [] ) surround optional command arguments. Do not type the square brackets.
{} Group. Braces ( {} ) identify a group to choose from. Do not type the braces.
| Or. A vertical bar ( | ) separates alternative elements. Type any one of the elements. Do not type the vertical bar.
... Repeatable. An ellipsis ( ... ) indicates that you can repeat the syntax element as often as required.

Description

The explain()step is a terminal step that will return a traversal explanation detailing how the traversal is compiled, and the TinkerPop traversal strategies that are used.

Examples

g.V().not(hasLabel('fridgeSensor').or().hasLabel('meal')).
  group().by(label).by('name').explain()
The return of explain() for the example:
Traversal Explanation
=======================================================================================================================================================================================================================
Original Traversal                          [GraphStep(vertex,[]), NotStep([HasStep([~label.eq(fridgeSensor)]), OrStep, HasStep([~label.eq(meal)])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]

ConnectiveStrategy                    [D]   [GraphStep(vertex,[]), NotStep([OrStep([[HasStep([~label.eq(fridgeSensor)])], [HasStep([~label.eq(meal)])]])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
RepeatUnrollStrategy                  [O]   [GraphStep(vertex,[]), NotStep([OrStep([[HasStep([~label.eq(fridgeSensor)])], [HasStep([~label.eq(meal)])]])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
MatchPredicateStrategy                [O]   [GraphStep(vertex,[]), NotStep([OrStep([[HasStep([~label.eq(fridgeSensor)])], [HasStep([~label.eq(meal)])]])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
PathRetractionStrategy                [O]   [GraphStep(vertex,[]), NotStep([OrStep([[HasStep([~label.eq(fridgeSensor)])], [HasStep([~label.eq(meal)])]])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
IncidentToAdjacentStrategy            [O]   [GraphStep(vertex,[]), NotStep([OrStep([[HasStep([~label.eq(fridgeSensor)])], [HasStep([~label.eq(meal)])]])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
FilterRankingStrategy                 [O]   [GraphStep(vertex,[]), NotStep([OrStep([[HasStep([~label.eq(fridgeSensor)])], [HasStep([~label.eq(meal)])]])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
InlineFilterStrategy                  [O]   [GraphStep(vertex,[]), NotStep([HasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
AdjacentToIncidentStrategy            [O]   [GraphStep(vertex,[]), NotStep([HasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
CountStrategy                         [O]   [GraphStep(vertex,[]), NotStep([HasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
LazyBarrierStrategy                   [O]   [GraphStep(vertex,[]), NotStep([HasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
DseIncidentToAdjacentStrategy         [O]   [GraphStep(vertex,[]), NotStep([HasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
HasStepStrategy                       [P]   [GraphStep(vertex,[]), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
QueryStrategy                         [P]   [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
AdjacentVertexFilterOptimizerStrategy [P]   [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
DsegPropertyLoadStrategy              [F]   [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
ProfileStrategy                       [F]   [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
StandardVerificationStrategy          [V]   [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
LambdaRestrictionStrategy             [V]   [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]

Final Traversal                             [DsegGraphStep(vertex,[],true,Unordered), NotStep([DsegHasStep([~label.or(eq(fridgeSensor), eq(meal))])]), GroupStep(label,[TraversalMapStep(value(name)), FoldStep])]
The codes for various steps:
[D]ecoration
There is an application-level feature that can be embedded into the traversal logic.
[O]ptimization
There is a more efficient way to express the traversal at the TinkerPop level.
[P]rovider optimization
There is a more efficient way to express the traversal at the graph system, language, or driver level.
[F]inalization
There are some final adjustments, cleanups, or analyses required before executing the traversal.
[V]erification
There are certain traversals that are not legal for the application or traversal engine.