dse_graph.query
class TraversalBatch
A TraversalBatch is used to execute multiple graph traversals in a single transaction. If any traversal in the batch fails, the entire batch will fail to apply.
If a TraversalBatch is bounded to a DSE session, it can be executed using traversal_batch.execute().
- Parameters
-
-
session – (Optional) A DSE session
-
execution_profile – (Optional) The execution profile to use for the batch execution
-
Methods
add
(traversal)Add a traversal to the batch.
- Parameters
-
traversal – A gremlin GraphTraversal
add_all
(traversals)Adds a sequence of traversals to the batch.
- Parameters
-
traversals – A sequence of gremlin GraphTraversal
execute
()Execute the traversal batch if bounded to a DSE Session.
as_graph_statement
()Return the traversal batch as GraphStatement.
clear
()Clear a traversal batch for reuse.