explain

Explain the traversal strategies used in a traversal.

Synopsis

explain()

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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com