public class GraphTraversalSource extends Object implements TraversalSource
GraphTraversalSource
is the primary DSL of the Gremlin traversal machine.
It provides access to all the configurations and steps for Turing complete graph computing.
Any DSL can be constructed based on the methods of both GraphTraversalSource
and GraphTraversal
.Modifier and Type | Class and Description |
---|---|
static class |
GraphTraversalSource.Builder
Deprecated.
As of release 3.2.0. Please use
Graph.traversal(Class) . |
Constructor and Description |
---|
GraphTraversalSource(Graph graph) |
GraphTraversalSource(Graph graph,
TraversalStrategies traversalStrategies) |
Modifier and Type | Method and Description |
---|---|
GraphTraversal<Vertex,Vertex> |
addV() |
GraphTraversal<Vertex,Vertex> |
addV(Object... keyValues)
Deprecated.
As of release 3.1.0, replaced by
addV() |
GraphTraversal<Vertex,Vertex> |
addV(String label) |
static GraphTraversalSource.Builder |
build()
Deprecated.
As of release 3.2.0. Please use
Graph.traversal(Class) . |
GraphTraversalSource |
clone()
The clone-method should be used to create immutable traversal sources with each call to a configuration method.
|
static GraphTraversalSource.Builder |
computer()
Deprecated.
As of release 3.2.0. Please use
Graph.traversal(Class) . |
static GraphTraversalSource.Builder |
computer(Class<? extends GraphComputer> graphComputerClass)
Deprecated.
As of release 3.2.0. Please use
Graph.traversal(Class) . |
GraphTraversal<Edge,Edge> |
E(Object... edgesIds) |
Graph |
getGraph()
Get the {@link Graph) associated with this traversal source.
|
TraversalStrategies |
getStrategies()
Get the
TraversalStrategies associated with this traversal source. |
<S> GraphTraversal<S,S> |
inject(S... starts) |
static GraphTraversalSource.Builder |
standard()
Deprecated.
As of release 3.2.0. Please use
Graph.traversal(Class) . |
String |
toString() |
Transaction |
tx() |
GraphTraversal<Vertex,Vertex> |
V(Object... vertexIds) |
GraphTraversalSource |
withBulk(boolean useBulk) |
GraphTraversalSource |
withComputer()
Add the standard
GraphComputer of the graph that will be used to execute the traversal. |
GraphTraversalSource |
withComputer(Class<? extends GraphComputer> graphComputerClass)
Add a
GraphComputer class used to execute the traversal. |
GraphTraversalSource |
withComputer(Computer computer)
Add a
Function that will generate a GraphComputer from the Graph that will be used to execute the traversal. |
GraphTraversalSource |
withoutStrategies(Class<? extends TraversalStrategy>... traversalStrategyClasses)
Remove an arbitrary collection of
TraversalStrategy classes from the traversal source. |
GraphTraversalSource |
withPath() |
<A> GraphTraversalSource |
withSack(A initialValue)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(A initialValue,
BinaryOperator<A> mergeOperator)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(A initialValue,
UnaryOperator<A> splitOperator)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(A initialValue,
UnaryOperator<A> splitOperator,
BinaryOperator<A> mergeOperator)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(Supplier<A> initialValue)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(Supplier<A> initialValue,
BinaryOperator<A> mergeOperator)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(Supplier<A> initialValue,
UnaryOperator<A> splitOperator)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSack(Supplier<A> initialValue,
UnaryOperator<A> splitOperator,
BinaryOperator<A> mergeOperator)
Add a sack to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSideEffect(String key,
A initialValue)
Add a sideEffect to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSideEffect(String key,
A initialValue,
BinaryOperator<A> reducer)
Add a sideEffect to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSideEffect(String key,
Supplier<A> initialValue)
Add a sideEffect to be used throughout the life of a spawned
Traversal . |
<A> GraphTraversalSource |
withSideEffect(String key,
Supplier<A> initialValue,
BinaryOperator<A> reducer)
Add a sideEffect to be used throughout the life of a spawned
Traversal . |
GraphTraversalSource |
withStrategies(TraversalStrategy... traversalStrategies)
Add an arbitrary collection of
TraversalStrategy instances to the traversal source. |
public GraphTraversalSource(Graph graph, TraversalStrategies traversalStrategies)
public GraphTraversalSource(Graph graph)
public TraversalStrategies getStrategies()
TraversalSource
TraversalStrategies
associated with this traversal source.getStrategies
in interface TraversalSource
public Graph getGraph()
TraversalSource
getGraph
in interface TraversalSource
public GraphTraversalSource clone()
TraversalSource
TraversalStrategies
, mutate the cloned strategies accordingly,
and then return the cloned traversal source.clone
in interface TraversalSource
clone
in class Object
public GraphTraversalSource withComputer(Computer computer)
TraversalSource
Function
that will generate a GraphComputer
from the Graph
that will be used to execute the traversal.
This adds a VertexProgramStrategy
to the strategies.withComputer
in interface TraversalSource
computer
- a builder to generate a graph computer from the graphpublic GraphTraversalSource withComputer(Class<? extends GraphComputer> graphComputerClass)
TraversalSource
GraphComputer
class used to execute the traversal.
This adds a VertexProgramStrategy
to the strategies.withComputer
in interface TraversalSource
graphComputerClass
- the graph computer classpublic GraphTraversalSource withComputer()
TraversalSource
GraphComputer
of the graph that will be used to execute the traversal.
This adds a VertexProgramStrategy
to the strategies.withComputer
in interface TraversalSource
public GraphTraversalSource withStrategies(TraversalStrategy... traversalStrategies)
TraversalSource
TraversalStrategy
instances to the traversal source.withStrategies
in interface TraversalSource
traversalStrategies
- a colleciton of traversal strategies to addpublic GraphTraversalSource withoutStrategies(Class<? extends TraversalStrategy>... traversalStrategyClasses)
TraversalSource
TraversalStrategy
classes from the traversal source.withoutStrategies
in interface TraversalSource
traversalStrategyClasses
- a collection of traversal strategy classes to removepublic <A> GraphTraversalSource withSideEffect(String key, Supplier<A> initialValue, BinaryOperator<A> reducer)
TraversalSource
Traversal
.
This adds a SideEffectStrategy
to the strategies.withSideEffect
in interface TraversalSource
key
- the key of the sideEffectinitialValue
- a supplier that produces the initial value of the sideEffectreducer
- a reducer to merge sideEffect mutations into a single resultpublic <A> GraphTraversalSource withSideEffect(String key, A initialValue, BinaryOperator<A> reducer)
TraversalSource
Traversal
.
This adds a SideEffectStrategy
to the strategies.withSideEffect
in interface TraversalSource
key
- the key of the sideEffectinitialValue
- the initial value of the sideEffectreducer
- a reducer to merge sideEffect mutations into a single resultpublic <A> GraphTraversalSource withSideEffect(String key, A initialValue)
TraversalSource
Traversal
.
This adds a SideEffectStrategy
to the strategies.withSideEffect
in interface TraversalSource
key
- the key of the sideEffectinitialValue
- the initial value of the sideEffectpublic <A> GraphTraversalSource withSideEffect(String key, Supplier<A> initialValue)
TraversalSource
Traversal
.
This adds a SideEffectStrategy
to the strategies.withSideEffect
in interface TraversalSource
key
- the key of the sideEffectinitialValue
- a supplier that produces the initial value of the sideEffectpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue, UnaryOperator<A> splitOperator, BinaryOperator<A> mergeOperator)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- a supplier that produces the initial value of the sideEffectsplitOperator
- the sack split operatormergeOperator
- the sack merge operatorpublic <A> GraphTraversalSource withSack(A initialValue, UnaryOperator<A> splitOperator, BinaryOperator<A> mergeOperator)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- the initial value of the sideEffectsplitOperator
- the sack split operatormergeOperator
- the sack merge operatorpublic <A> GraphTraversalSource withSack(A initialValue)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- the initial value of the sideEffectpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- a supplier that produces the initial value of the sideEffectpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue, UnaryOperator<A> splitOperator)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- a supplier that produces the initial value of the sideEffectsplitOperator
- the sack split operatorpublic <A> GraphTraversalSource withSack(A initialValue, UnaryOperator<A> splitOperator)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- the initial value of the sideEffectsplitOperator
- the sack split operatorpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue, BinaryOperator<A> mergeOperator)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- a supplier that produces the initial value of the sideEffectmergeOperator
- the sack merge operatorpublic <A> GraphTraversalSource withSack(A initialValue, BinaryOperator<A> mergeOperator)
TraversalSource
Traversal
.
This adds a SackStrategy
to the strategies.withSack
in interface TraversalSource
initialValue
- the initial value of the sideEffectmergeOperator
- the sack merge operatorpublic GraphTraversalSource withBulk(boolean useBulk)
public GraphTraversalSource withPath()
@Deprecated public GraphTraversal<Vertex,Vertex> addV(Object... keyValues)
addV()
public GraphTraversal<Vertex,Vertex> addV(String label)
public GraphTraversal<Vertex,Vertex> addV()
public <S> GraphTraversal<S,S> inject(S... starts)
public GraphTraversal<Vertex,Vertex> V(Object... vertexIds)
public GraphTraversal<Edge,Edge> E(Object... edgesIds)
public Transaction tx()
@Deprecated public static GraphTraversalSource.Builder build()
Graph.traversal(Class)
.@Deprecated public static GraphTraversalSource.Builder standard()
Graph.traversal(Class)
.@Deprecated public static GraphTraversalSource.Builder computer()
Graph.traversal(Class)
.@Deprecated public static GraphTraversalSource.Builder computer(Class<? extends GraphComputer> graphComputerClass)
Graph.traversal(Class)
.Copyright © 2013–2016 Apache Software Foundation. All rights reserved.