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.Symbols | 
| Modifier and Type | Field and Description | 
|---|---|
| protected Bytecode | bytecode | 
| protected RemoteConnection | connection | 
| protected Graph | graph | 
| protected TraversalStrategies | strategies | 
GREMLIN_REMOTE, GREMLIN_REMOTE_CONNECTION_CLASS| Constructor and Description | 
|---|
| GraphTraversalSource(Graph graph) | 
| GraphTraversalSource(Graph graph,
                    TraversalStrategies traversalStrategies) | 
| Modifier and Type | Method and Description | 
|---|---|
| GraphTraversal<Edge,Edge> | addE(String label)Spawns a  GraphTraversalby adding a edge with the specified label. | 
| GraphTraversal<Edge,Edge> | addE(Traversal<?,String> edgeLabelTraversal)Spawns a  GraphTraversalby adding a edge with a label as specified by the providedTraversal. | 
| GraphTraversal<Vertex,Vertex> | addV()Spawns a  GraphTraversalby adding a vertex with the default label. | 
| GraphTraversal<Vertex,Vertex> | addV(String label)Spawns a  GraphTraversalby adding a vertex with the specified label. | 
| GraphTraversal<Vertex,Vertex> | addV(Traversal<?,String> vertexLabelTraversal)Spawns a  GraphTraversalby adding a vertex with the label as determined by aTraversal. | 
| GraphTraversalSource | clone()The clone-method should be used to create immutable traversal sources with each call to a configuration "withXXX"-method. | 
| void | close()If there is an underlying  RemoteConnectionit will be closed by this method. | 
| GraphTraversal<Edge,Edge> | E(Object... edgesIds)Spawns a  GraphTraversalstarting with all edges or some subset of edges as specified by their unique
 identifier. | 
| Optional<Class> | getAnonymousTraversalClass() | 
| Bytecode | getBytecode()Get the  Bytecodeassociated with the current state of this traversal source. | 
| Graph | getGraph()Get the  Graphassociated with this traversal source. | 
| TraversalStrategies | getStrategies()Get the  TraversalStrategiesassociated with this traversal source. | 
| <S> GraphTraversal<S,S> | inject(S... starts)Spawns a  GraphTraversalstarting it with arbitrary values. | 
| String | toString() | 
| Transaction | tx()Proxies calls through to the underlying  Graph.tx(). | 
| GraphTraversal<Vertex,Vertex> | V(Object... vertexIds)Spawns a  GraphTraversalstarting with all vertices or some subset of vertices as specified by their
 unique identifier. | 
| GraphTraversalSource | withBulk(boolean useBulk) | 
| GraphTraversalSource | withComputer()Add the standard  GraphComputerof the graph that will be used to execute the traversal. | 
| GraphTraversalSource | withComputer(Class<? extends GraphComputer> graphComputerClass)Add a  GraphComputerclass used to execute the traversal. | 
| GraphTraversalSource | withComputer(Computer computer)Add a  Computerthat will generate aGraphComputerfrom theGraphthat will be used to execute the traversal. | 
| GraphTraversalSource | withoutStrategies(Class<? extends TraversalStrategy>... traversalStrategyClasses)Remove an arbitrary collection of  TraversalStrategyclasses from the traversal source. | 
| GraphTraversalSource | withPath() | 
| GraphTraversalSource | withRemote(Configuration conf)Configures the  TraversalSourceas a "remote" to issue theTraversalfor execution elsewhere. | 
| <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  TraversalStrategyinstances to the traversal source. | 
protected transient RemoteConnection connection
protected final Graph graph
protected TraversalStrategies strategies
protected Bytecode bytecode
public GraphTraversalSource(Graph graph, TraversalStrategies traversalStrategies)
public GraphTraversalSource(Graph graph)
public Optional<Class> getAnonymousTraversalClass()
getAnonymousTraversalClass in interface TraversalSourcepublic TraversalStrategies getStrategies()
TraversalSourceTraversalStrategies associated with this traversal source.getStrategies in interface TraversalSourcepublic Graph getGraph()
TraversalSourceGraph associated with this traversal source.getGraph in interface TraversalSourcepublic Bytecode getBytecode()
TraversalSourceBytecode associated with the current state of this traversal source.getBytecode in interface TraversalSourcepublic GraphTraversalSource clone()
TraversalSourceBytecode, TraversalStrategies, mutate the cloned strategies accordingly,
 and then return the cloned traversal source leaving the original unaltered.clone in interface TraversalSourceclone in class Objectpublic GraphTraversalSource withStrategies(TraversalStrategy... traversalStrategies)
TraversalStrategy instances to the traversal source.withStrategies in interface TraversalSourcetraversalStrategies - a collection of traversal strategies to addpublic GraphTraversalSource withoutStrategies(Class<? extends TraversalStrategy>... traversalStrategyClasses)
TraversalStrategy classes from the traversal source.withoutStrategies in interface TraversalSourcetraversalStrategyClasses - a collection of traversal strategy classes to removepublic GraphTraversalSource withComputer(Computer computer)
Computer 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 TraversalSourcecomputer - a builder to generate a graph computer from the graphpublic GraphTraversalSource withComputer(Class<? extends GraphComputer> graphComputerClass)
GraphComputer class used to execute the traversal.
 This adds a VertexProgramStrategy to the strategies.withComputer in interface TraversalSourcegraphComputerClass - the graph computer classpublic GraphTraversalSource withComputer()
GraphComputer of the graph that will be used to execute the traversal.
 This adds a VertexProgramStrategy to the strategies.withComputer in interface TraversalSourcepublic <A> GraphTraversalSource withSideEffect(String key, Supplier<A> initialValue, BinaryOperator<A> reducer)
Traversal.
 This adds a SideEffectStrategy to the strategies.withSideEffect in interface TraversalSourcekey - 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)
Traversal.
 This adds a SideEffectStrategy to the strategies.withSideEffect in interface TraversalSourcekey - 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)
Traversal.
 This adds a SideEffectStrategy to the strategies.withSideEffect in interface TraversalSourcekey - the key of the sideEffectinitialValue - the initial value of the sideEffectpublic <A> GraphTraversalSource withSideEffect(String key, Supplier<A> initialValue)
Traversal.
 This adds a SideEffectStrategy to the strategies.withSideEffect in interface TraversalSourcekey - 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)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - 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)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - the initial value of the sideEffectsplitOperator - the sack split operatormergeOperator - the sack merge operatorpublic <A> GraphTraversalSource withSack(A initialValue)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - the initial value of the sideEffectpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - a supplier that produces the initial value of the sideEffectpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue, UnaryOperator<A> splitOperator)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - a supplier that produces the initial value of the sideEffectsplitOperator - the sack split operatorpublic <A> GraphTraversalSource withSack(A initialValue, UnaryOperator<A> splitOperator)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - the initial value of the sideEffectsplitOperator - the sack split operatorpublic <A> GraphTraversalSource withSack(Supplier<A> initialValue, BinaryOperator<A> mergeOperator)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - a supplier that produces the initial value of the sideEffectmergeOperator - the sack merge operatorpublic <A> GraphTraversalSource withSack(A initialValue, BinaryOperator<A> mergeOperator)
Traversal.
 This adds a SackStrategy to the strategies.withSack in interface TraversalSourceinitialValue - the initial value of the sideEffectmergeOperator - the sack merge operatorpublic GraphTraversalSource withBulk(boolean useBulk)
public GraphTraversalSource withPath()
public GraphTraversalSource withRemote(Configuration conf)
TraversalSource as a "remote" to issue the Traversal for execution elsewhere.
 Expects key for TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS as well as any configuration required by
 the underlying RemoteConnection which will be instantiated. Note that the Configuration object
 is passed down without change to the creation of the RemoteConnection instance.withRemote in interface TraversalSourcepublic GraphTraversal<Vertex,Vertex> addV(String label)
GraphTraversal by adding a vertex with the specified label.public GraphTraversal<Vertex,Vertex> addV(Traversal<?,String> vertexLabelTraversal)
GraphTraversal by adding a vertex with the label as determined by a Traversal.public GraphTraversal<Vertex,Vertex> addV()
GraphTraversal by adding a vertex with the default label.public GraphTraversal<Edge,Edge> addE(String label)
GraphTraversal by adding a edge with the specified label.public GraphTraversal<Edge,Edge> addE(Traversal<?,String> edgeLabelTraversal)
GraphTraversal by adding a edge with a label as specified by the provided Traversal.public <S> GraphTraversal<S,S> inject(S... starts)
GraphTraversal starting it with arbitrary values.public GraphTraversal<Vertex,Vertex> V(Object... vertexIds)
GraphTraversal starting with all vertices or some subset of vertices as specified by their
 unique identifier.public GraphTraversal<Edge,Edge> E(Object... edgesIds)
GraphTraversal starting with all edges or some subset of edges as specified by their unique
 identifier.public Transaction tx()
Graph.tx().public void close()
           throws Exception
RemoteConnection it will be closed by this method.close in interface AutoCloseableclose in interface TraversalSourceExceptionCopyright © 2013–2018 Apache Software Foundation. All rights reserved.