public interface GraphTraversal<S,E> extends Traversal<S,E>
Modifier and Type | Interface and Description |
---|---|
static interface |
GraphTraversal.Admin<S,E> |
static class |
GraphTraversal.Symbols |
Traversal.Exceptions
Modifier and Type | Method and Description |
---|---|
default GraphTraversal<S,Edge> |
addE(String edgeLabel)
Adds an
Edge with the specified edge label. |
default GraphTraversal<S,Edge> |
addE(Traversal<?,String> edgeLabelTraversal)
|
default GraphTraversal<S,Vertex> |
addV()
Adds a
Vertex with a default vertex label. |
default GraphTraversal<S,Vertex> |
addV(String vertexLabel)
Adds a
Vertex . |
default GraphTraversal<S,Vertex> |
addV(Traversal<?,String> vertexLabelTraversal)
|
default GraphTraversal<S,E> |
aggregate(Scope scope,
String sideEffectKey)
Collects objects in a list using the
Scope argument to determine whether it should be lazy
Scope.local or eager (Scope.global while gathering those objects. |
default GraphTraversal<S,E> |
aggregate(String sideEffectKey)
Eagerly collects objects up to this step into a side-effect.
|
default GraphTraversal<S,E> |
and(Traversal<?,?>... andTraversals)
Ensures that all of the provided traversals yield a result.
|
default GraphTraversal<S,E> |
as(String stepLabel,
String... stepLabels)
A step modulator that provides a label to the step that can be accessed later in the traversal by other steps.
|
default GraphTraversal.Admin<S,E> |
asAdmin()
Get access to administrative methods of the traversal via its accompanying
Traversal.Admin . |
default GraphTraversal<S,E> |
barrier()
Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to
the size of the barrier.
|
default GraphTraversal<S,E> |
barrier(Consumer<TraverserSet<Object>> barrierConsumer)
Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to
the size of the barrier.
|
default GraphTraversal<S,E> |
barrier(int maxBarrierSize)
Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to
the size of the barrier.
|
default GraphTraversal<S,Vertex> |
both(String... edgeLabels)
Map the
Vertex to its adjacent vertices given the edge labels. |
default GraphTraversal<S,Edge> |
bothE(String... edgeLabels)
Map the
Vertex to its incident edges given the edge labels. |
default GraphTraversal<S,Vertex> |
bothV()
Map the
Edge to its incident vertices. |
default <M,E2> GraphTraversal<S,E2> |
branch(Function<Traverser<E>,M> function)
Split the
Traverser to all the specified functions. |
default <M,E2> GraphTraversal<S,E2> |
branch(Traversal<?,M> branchTraversal)
Split the
Traverser to all the specified traversals. |
default GraphTraversal<S,E> |
by()
The
by() can be applied to a number of different step to alter their behaviors. |
default GraphTraversal<S,E> |
by(Comparator<E> comparator)
The
by() can be applied to a number of different step to alter their behaviors. |
default <U> GraphTraversal<S,E> |
by(Function<U,Object> function,
Comparator comparator)
The
by() can be applied to a number of different step to alter their behaviors. |
default <V> GraphTraversal<S,E> |
by(Function<V,Object> function)
The
by() can be applied to a number of different step to alter their behaviors. |
default GraphTraversal<S,E> |
by(Order order)
The
by() can be applied to a number of different step to alter their behaviors. |
default GraphTraversal<S,E> |
by(String key)
The
by() can be applied to a number of different step to alter their behaviors. |
default <V> GraphTraversal<S,E> |
by(String key,
Comparator<V> comparator)
The
by() can be applied to a number of different step to alter their behaviors. |
default GraphTraversal<S,E> |
by(T token)
The
by() can be applied to a number of different step to alter their behaviors. |
default GraphTraversal<S,E> |
by(Traversal<?,?> traversal)
The
by() can be applied to a number of different step to alter their behaviors. |
default <V> GraphTraversal<S,E> |
by(Traversal<?,?> traversal,
Comparator<V> comparator)
The
by() can be applied to a number of different step to alter their behaviors. |
default <E2> GraphTraversal<S,E2> |
cap(String sideEffectKey,
String... sideEffectKeys)
Iterates the traversal up to the itself and emits the side-effect referenced by the key.
|
default <M,E2> GraphTraversal<S,E2> |
choose(Function<E,M> choiceFunction)
Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else
like semantics within a traversal.
|
default <E2> GraphTraversal<S,E2> |
choose(Predicate<E> choosePredicate,
Traversal<?,E2> trueChoice)
Routes the current traverser to a particular traversal branch option which allows the creation of if-then
like semantics within a traversal.
|
default <E2> GraphTraversal<S,E2> |
choose(Predicate<E> choosePredicate,
Traversal<?,E2> trueChoice,
Traversal<?,E2> falseChoice)
Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else
like semantics within a traversal.
|
default <E2> GraphTraversal<S,E2> |
choose(Traversal<?,?> traversalPredicate,
Traversal<?,E2> trueChoice)
Routes the current traverser to a particular traversal branch option which allows the creation of if-then
like semantics within a traversal.
|
default <E2> GraphTraversal<S,E2> |
choose(Traversal<?,?> traversalPredicate,
Traversal<?,E2> trueChoice,
Traversal<?,E2> falseChoice)
Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else
like semantics within a traversal.
|
default <M,E2> GraphTraversal<S,E2> |
choose(Traversal<?,M> choiceTraversal)
Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else
like semantics within a traversal.
|
default <E2> GraphTraversal<S,E2> |
coalesce(Traversal<?,E2>... coalesceTraversals)
Evaluates the provided traversals and returns the result of the first traversal to emit at least one object.
|
default GraphTraversal<S,E> |
coin(double probability)
Filter the
E object given a biased coin toss. |
default GraphTraversal<S,E> |
connectedComponent()
Executes a Connected Component algorithm over the graph.
|
default <E2> GraphTraversal<S,E2> |
constant(E2 e)
Map any object to a fixed
E value. |
default GraphTraversal<S,Long> |
count()
Map the traversal stream to its reduction as a sum of the
Traverser.bulk() values (i.e. |
default GraphTraversal<S,Long> |
count(Scope scope)
Map the traversal stream to its reduction as a sum of the
Traverser.bulk() values given the specified
Scope (i.e. |
default GraphTraversal<S,E> |
cyclicPath()
|
default GraphTraversal<S,E> |
dedup(Scope scope,
String... dedupLabels)
Remove all duplicates in the traversal stream up to this point.
|
default GraphTraversal<S,E> |
dedup(String... dedupLabels)
Remove all duplicates in the traversal stream up to this point.
|
default GraphTraversal<S,E> |
drop()
Removes elements and properties from the graph.
|
default <E2> GraphTraversal<S,Map<Object,E2>> |
elementMap(String... propertyKeys)
|
default GraphTraversal<S,E> |
emit()
Emit is used in conjunction with
repeat(Traversal) to emit all objects from the loop. |
default GraphTraversal<S,E> |
emit(Predicate<Traverser<E>> emitPredicate)
Emit is used in conjunction with
repeat(Traversal) to determine what objects get emit from the loop. |
default GraphTraversal<S,E> |
emit(Traversal<?,?> emitTraversal)
Emit is used in conjunction with
repeat(Traversal) to determine what objects get emit from the loop. |
default GraphTraversal<S,E> |
filter(Predicate<Traverser<E>> predicate)
Map the
Traverser to either true or false , where false will not pass the
traverser to the next step. |
default GraphTraversal<S,E> |
filter(Traversal<?,?> filterTraversal)
Map the
Traverser to either true or false , where false will not pass the
traverser to the next step. |
default <E2> GraphTraversal<S,E2> |
flatMap(Function<Traverser<E>,Iterator<E2>> function)
|
default <E2> GraphTraversal<S,E2> |
flatMap(Traversal<?,E2> flatMapTraversal)
|
default GraphTraversal<S,List<E>> |
fold()
Rolls up objects in the stream into an aggregate list.
|
default <E2> GraphTraversal<S,E2> |
fold(E2 seed,
BiFunction<E2,E,E2> foldFunction)
Rolls up objects in the stream into an aggregate value as defined by a
seed and BiFunction . |
default GraphTraversal<S,E> |
from(String fromStepLabel)
Provide
from() -modulation to respective steps. |
default GraphTraversal<S,E> |
from(Traversal<?,Vertex> fromVertex)
When used as a modifier to
addE(String) this method specifies the traversal to use for selecting the
outgoing vertex of the newly added Edge . |
default GraphTraversal<S,E> |
from(Vertex fromVertex)
When used as a modifier to
addE(String) this method specifies the traversal to use for selecting the
outgoing vertex of the newly added Edge . |
default <K,V> GraphTraversal<S,Map<K,V>> |
group()
Organize objects in the stream into a
Map . |
default GraphTraversal<S,E> |
group(String sideEffectKey)
Organize objects in the stream into a
Map . |
default <K> GraphTraversal<S,Map<K,Long>> |
groupCount()
Counts the number of times a particular objects has been part of a traversal, returning a
Map where the
object is the key and the value is the count. |
default GraphTraversal<S,E> |
groupCount(String sideEffectKey)
Counts the number of times a particular objects has been part of a traversal, returning a
Map where the
object is the key and the value is the count. |
default GraphTraversal<S,E> |
has(String propertyKey)
Filters vertices, edges and vertex properties based on the existence of properties.
|
default GraphTraversal<S,E> |
has(String propertyKey,
Object value)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(String propertyKey,
P<?> predicate)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(String label,
String propertyKey,
Object value)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(String label,
String propertyKey,
P<?> predicate)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(String propertyKey,
Traversal<?,?> propertyTraversal)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(T accessor,
Object value)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(T accessor,
P<?> predicate)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
has(T accessor,
Traversal<?,?> propertyTraversal)
Filters vertices, edges and vertex properties based on their properties.
|
default GraphTraversal<S,E> |
hasId(Object id,
Object... otherIds)
Filters vertices, edges and vertex properties based on their identifier.
|
default GraphTraversal<S,E> |
hasId(P<Object> predicate)
Filters vertices, edges and vertex properties based on their identifier.
|
default GraphTraversal<S,E> |
hasKey(P<String> predicate)
Filters vertices, edges and vertex properties based on their key.
|
default GraphTraversal<S,E> |
hasKey(String label,
String... otherLabels)
Filters vertices, edges and vertex properties based on their key.
|
default GraphTraversal<S,E> |
hasLabel(P<String> predicate)
Filters vertices, edges and vertex properties based on their label.
|
default GraphTraversal<S,E> |
hasLabel(String label,
String... otherLabels)
Filters vertices, edges and vertex properties based on their label.
|
default GraphTraversal<S,E> |
hasNot(String propertyKey)
Filters vertices, edges and vertex properties based on the non-existence of properties.
|
default GraphTraversal<S,E> |
hasValue(Object value,
Object... otherValues)
Filters vertices, edges and vertex properties based on their value.
|
default GraphTraversal<S,E> |
hasValue(P<Object> predicate)
Filters vertices, edges and vertex properties based on their value.
|
default GraphTraversal<S,Object> |
id()
Map the
Element to its Element.id() . |
default GraphTraversal<S,E> |
identity()
Map the
E object to itself. |
default GraphTraversal<S,Vertex> |
in(String... edgeLabels)
Map the
Vertex to its incoming adjacent vertices given the edge labels. |
default <E2> GraphTraversal<S,E2> |
index()
Indexes all items of the current collection.
|
default GraphTraversal<S,Edge> |
inE(String... edgeLabels)
Map the
Vertex to its incoming incident edges given the edge labels. |
default GraphTraversal<S,E> |
inject(E... injections)
Provides a way to add arbitrary objects to a traversal stream.
|
default GraphTraversal<S,Vertex> |
inV()
|
default GraphTraversal<S,E> |
is(Object value)
Filter the
E object if it is not P.eq(V) to the provided value. |
default GraphTraversal<S,E> |
is(P<E> predicate)
Filters
E object values given the provided predicate . |
default GraphTraversal<S,E> |
iterate()
Iterates the traversal presumably for the generation of side-effects.
|
default GraphTraversal<S,String> |
key()
Map the
Property to its Property.key() . |
default GraphTraversal<S,String> |
label()
Map the
Element to its Element.label() . |
default GraphTraversal<S,E> |
limit(long limit)
Filter the objects in the traversal by the number of them to pass through the stream, where only the first
n objects are allowed as defined by the limit argument. |
default <E2> GraphTraversal<S,E2> |
limit(Scope scope,
long limit)
Filter the objects in the traversal by the number of them to pass through the stream given the
Scope ,
where only the first n objects are allowed as defined by the limit argument. |
default <E2> GraphTraversal<S,E2> |
local(Traversal<?,E2> localTraversal)
Provides a execute a specified traversal on a single element within a stream.
|
default GraphTraversal<S,Integer> |
loops()
If the
Traverser supports looping then calling this method will extract the number of loops for that
traverser. |
default GraphTraversal<S,Integer> |
loops(String loopName)
If the
Traverser supports looping then calling this method will extract the number of loops for that
traverser for the named loop. |
default <E2> GraphTraversal<S,E2> |
map(Function<Traverser<E>,E2> function)
|
default <E2> GraphTraversal<S,E2> |
map(Traversal<?,E2> mapTraversal)
|
default <E2> GraphTraversal<S,Map<String,E2>> |
match(Traversal<?,?>... matchTraversals)
|
default GraphTraversal<S,Double> |
math(String expression)
|
default <E2 extends Comparable> |
max()
Determines the largest value in the stream.
|
default <E2 extends Comparable> |
max(Scope scope)
Determines the largest value in the stream given the
Scope . |
default <E2 extends Number> |
mean()
Determines the mean value in the stream.
|
default <E2 extends Number> |
mean(Scope scope)
Determines the mean value in the stream given the
Scope . |
default <E2 extends Comparable> |
min()
Determines the smallest value in the stream.
|
default <E2 extends Comparable> |
min(Scope scope)
Determines the smallest value in the stream given the
Scope . |
default GraphTraversal<S,E> |
not(Traversal<?,?> notTraversal)
Removes objects from the traversal stream when the traversal provided as an argument does not return any objects.
|
default <M,E2> GraphTraversal<S,E> |
option(M pickToken,
Traversal<?,E2> traversalOption)
This step modifies
choose(Function) to specifies the available choices that might be executed. |
default <E2> GraphTraversal<S,E> |
option(Traversal<?,E2> traversalOption)
This step modifies
choose(Function) to specifies the available choices that might be executed. |
default <E2> GraphTraversal<S,E2> |
optional(Traversal<?,E2> optionalTraversal)
Returns the result of the specified traversal if it yields a result, otherwise it returns the calling element.
|
default GraphTraversal<S,E> |
or(Traversal<?,?>... orTraversals)
Ensures that at least one of the provided traversals yield a result.
|
default GraphTraversal<S,E> |
order()
Order all the objects in the traversal up to this point and then emit them one-by-one in their ordered sequence.
|
default GraphTraversal<S,E> |
order(Scope scope)
Order either the
Scope.local object (e.g. |
default GraphTraversal<S,Vertex> |
otherV()
Map the
Edge to the incident vertex that was not just traversed from in the path history. |
default GraphTraversal<S,Vertex> |
out(String... edgeLabels)
Map the
Vertex to its outgoing adjacent vertices given the edge labels. |
default GraphTraversal<S,Edge> |
outE(String... edgeLabels)
Map the
Vertex to its outgoing incident edges given the edge labels. |
default GraphTraversal<S,Vertex> |
outV()
|
default GraphTraversal<S,E> |
pageRank()
Calculates a PageRank over the graph using a 0.85 for the
alpha value. |
default GraphTraversal<S,E> |
pageRank(double alpha)
Calculates a PageRank over the graph.
|
default GraphTraversal<S,Path> |
path()
|
default GraphTraversal<S,E> |
peerPressure()
Executes a Peer Pressure community detection algorithm over the graph.
|
default GraphTraversal<S,TraversalMetrics> |
profile()
Allows developers to examine statistical information about a traversal providing data like execution times,
counts, etc.
|
default GraphTraversal<S,E> |
profile(String sideEffectKey)
Allows developers to examine statistical information about a traversal providing data like execution times,
counts, etc.
|
default GraphTraversal<S,E> |
program(VertexProgram<?> vertexProgram)
Executes an arbitrary
VertexProgram over the graph. |
default <E2> GraphTraversal<S,Map<String,E2>> |
project(String projectKey,
String... otherProjectKeys)
Projects the current object in the stream into a
Map that is keyed by the provided labels. |
default <E2> GraphTraversal<S,? extends Property<E2>> |
properties(String... propertyKeys)
Map the
Element to its associated properties given the provide property keys. |
default GraphTraversal<S,E> |
property(Object key,
Object value,
Object... keyValues)
Sets the key and value of a
Property . |
default GraphTraversal<S,E> |
property(VertexProperty.Cardinality cardinality,
Object key,
Object value,
Object... keyValues)
Sets a
Property value and related meta properties if supplied, if supported by the Graph
and if the Element is a VertexProperty . |
default <E2> GraphTraversal<S,Map<String,E2>> |
propertyMap(String... propertyKeys)
|
default GraphTraversal<S,E> |
range(long low,
long high)
Filter the objects in the traversal by the number of them to pass through the stream.
|
default <E2> GraphTraversal<S,E2> |
range(Scope scope,
long low,
long high)
Filter the objects in the traversal by the number of them to pass through the stream as constrained by the
Scope . |
default GraphTraversal<S,E> |
read()
This step is technically a step modulator for the the
GraphTraversalSource.io(String) step which
instructs the step to perform a read with its given configuration. |
default GraphTraversal<S,E> |
repeat(String loopName,
Traversal<?,E> repeatTraversal)
This step is used for looping over a traversal given some break predicate and with a specified loop name.
|
default GraphTraversal<S,E> |
repeat(Traversal<?,E> repeatTraversal)
This step is used for looping over a traversal given some break predicate.
|
default <E2> GraphTraversal<S,E2> |
sack()
Map the
Traverser to its Traverser.sack() value. |
default <V,U> GraphTraversal<S,E> |
sack(BiFunction<V,U,V> sackOperator)
Map the
Traverser to its Traverser.sack() value. |
default GraphTraversal<S,E> |
sample(int amountToSample)
Allow some specified number of objects to pass through the stream.
|
default GraphTraversal<S,E> |
sample(Scope scope,
int amountToSample)
Allow some specified number of objects to pass through the stream.
|
default <E2> GraphTraversal<S,Collection<E2>> |
select(Column column)
A version of
select that allows for the extraction of a Column from objects in the traversal. |
default <E2> GraphTraversal<S,E2> |
select(Pop pop,
String selectKey)
|
default <E2> GraphTraversal<S,Map<String,E2>> |
select(Pop pop,
String selectKey1,
String selectKey2,
String... otherSelectKeys)
|
default <E2> GraphTraversal<S,E2> |
select(Pop pop,
Traversal<S,E2> keyTraversal)
|
default <E2> GraphTraversal<S,E2> |
select(String selectKey)
Map the
Traverser to the object specified by the selectKey . |
default <E2> GraphTraversal<S,Map<String,E2>> |
select(String selectKey1,
String selectKey2,
String... otherSelectKeys)
|
default <E2> GraphTraversal<S,E2> |
select(Traversal<S,E2> keyTraversal)
Map the
Traverser to the object specified by the key returned by the keyTraversal . |
default GraphTraversal<S,Path> |
shortestPath()
Executes a Shortest Path algorithm over the graph.
|
default GraphTraversal<S,E> |
sideEffect(Consumer<Traverser<E>> consumer)
Perform some operation on the
Traverser and pass it to the next step unmodified. |
default GraphTraversal<S,E> |
sideEffect(Traversal<?,?> sideEffectTraversal)
Perform some operation on the
Traverser and pass it to the next step unmodified. |
default GraphTraversal<S,E> |
simplePath()
|
default GraphTraversal<S,E> |
skip(long skip)
Filters out the first
n objects in the traversal. |
default <E2> GraphTraversal<S,E2> |
skip(Scope scope,
long skip)
Filters out the first
n objects in the traversal. |
default GraphTraversal<S,E> |
store(String sideEffectKey)
Deprecated.
As of release 3.4.3, replaced by
aggregate(Scope, String) using Scope.local . |
default GraphTraversal<S,Edge> |
subgraph(String sideEffectKey)
Extracts a portion of the graph being traversed into a
Graph object held in the specified side-effect
key. |
default <E2 extends Number> |
sum()
Map the traversal stream to its reduction as a sum of the
Traverser.get() values multiplied by their
Traverser.bulk() (i.e. |
default <E2 extends Number> |
sum(Scope scope)
Map the traversal stream to its reduction as a sum of the
Traverser.get() values multiplied by their
Traverser.bulk() given the specified Scope (i.e. |
default GraphTraversal<S,E> |
tail()
Filters the objects in the traversal emitted as being last objects in the stream.
|
default GraphTraversal<S,E> |
tail(long limit)
Filters the objects in the traversal emitted as being last objects in the stream.
|
default <E2> GraphTraversal<S,E2> |
tail(Scope scope)
Filters the objects in the traversal emitted as being last objects in the stream given the
Scope . |
default <E2> GraphTraversal<S,E2> |
tail(Scope scope,
long limit)
Filters the objects in the traversal emitted as being last objects in the stream given the
Scope . |
default GraphTraversal<S,E> |
timeLimit(long timeLimit)
Once the first
Traverser hits this step, a count down is started. |
default GraphTraversal<S,E> |
times(int maxLoops)
Modifies a
repeat(Traversal) to specify how many loops should occur before exiting. |
default GraphTraversal<S,Vertex> |
to(Direction direction,
String... edgeLabels)
Map the
Vertex to its adjacent vertices given a direction and edge labels. |
default GraphTraversal<S,E> |
to(String toStepLabel)
Provide
to() -modulation to respective steps. |
default GraphTraversal<S,E> |
to(Traversal<?,Vertex> toVertex)
When used as a modifier to
addE(String) this method specifies the traversal to use for selecting the
incoming vertex of the newly added Edge . |
default GraphTraversal<S,E> |
to(Vertex toVertex)
When used as a modifier to
addE(String) this method specifies the traversal to use for selecting the
incoming vertex of the newly added Edge . |
default GraphTraversal<S,Edge> |
toE(Direction direction,
String... edgeLabels)
Map the
Vertex to its incident edges given the direction and edge labels. |
default GraphTraversal<S,Vertex> |
toV(Direction direction)
Map the
Edge to its incident vertices given the direction. |
default GraphTraversal<S,Tree> |
tree()
Aggregates the emanating paths into a
Tree data structure. |
default GraphTraversal<S,E> |
tree(String sideEffectKey)
Aggregates the emanating paths into a
Tree data structure. |
default <E2> GraphTraversal<S,E2> |
unfold()
Unrolls a
Iterator , Iterable or Map into a linear form or simply emits the object if it
is not one of those types. |
default <E2> GraphTraversal<S,E2> |
union(Traversal<?,E2>... unionTraversals)
Merges the results of an arbitrary number of traversals.
|
default GraphTraversal<S,E> |
until(Predicate<Traverser<E>> untilPredicate)
Modifies a
repeat(Traversal) to determine when the loop should exit. |
default GraphTraversal<S,E> |
until(Traversal<?,?> untilTraversal)
Modifies a
repeat(Traversal) to determine when the loop should exit. |
default GraphTraversal<S,Vertex> |
V(Object... vertexIdsOrElements)
A
V step is usually used to start a traversal but it may also be used mid-traversal. |
default <E2> GraphTraversal<S,E2> |
value()
Map the
Property to its Property.value() . |
default <E2> GraphTraversal<S,Map<Object,E2>> |
valueMap(boolean includeTokens,
String... propertyKeys)
Deprecated.
As of release 3.4.0, deprecated in favor of
valueMap(String...) in conjunction with
with(String, Object) or simple prefer elementMap(String...) . |
default <E2> GraphTraversal<S,Map<Object,E2>> |
valueMap(String... propertyKeys)
|
default <E2> GraphTraversal<S,E2> |
values(String... propertyKeys)
Map the
Element to the values of the associated properties given the provide property keys. |
default GraphTraversal<S,E> |
where(P<String> predicate)
Filters the current object based on the object itself or the path history.
|
default GraphTraversal<S,E> |
where(String startKey,
P<String> predicate)
Filters the current object based on the object itself or the path history.
|
default GraphTraversal<S,E> |
where(Traversal<?,?> whereTraversal)
Filters the current object based on the object itself or the path history.
|
default GraphTraversal<S,E> |
with(String key)
Provides a configuration to a step in the form of a key which is the same as
with(key, true) . |
default GraphTraversal<S,E> |
with(String key,
Object value)
Provides a configuration to a step in the form of a key and value pair.
|
default GraphTraversal<S,E> |
write()
This step is technically a step modulator for the the
GraphTraversalSource.io(String) step which
instructs the step to perform a write with its given configuration. |
default GraphTraversal.Admin<S,E> asAdmin()
Traversal
Traversal.Admin
.default <E2> GraphTraversal<S,E2> map(Function<Traverser<E>,E2> function)
function
- the lambda expression that does the functional mappingLambdaMapStep
.default <E2> GraphTraversal<S,E2> map(Traversal<?,E2> mapTraversal)
mapTraversal
- the traversal expression that does the functional mappingLambdaMapStep
.default <E2> GraphTraversal<S,E2> flatMap(Function<Traverser<E>,Iterator<E2>> function)
Traverser
referencing an object of type E
to an iterator of objects of type E2
.
The resultant iterator is drained one-by-one before a new E
object is pulled in for processing.E2
- the type of the returned iterator objectsfunction
- the lambda expression that does the functional mappingLambdaFlatMapStep
.default <E2> GraphTraversal<S,E2> flatMap(Traversal<?,E2> flatMapTraversal)
Traverser
referencing an object of type E
to an iterator of objects of type E2
.
The internal traversal is drained one-by-one before a new E
object is pulled in for processing.E2
- the end type of the internal traversalflatMapTraversal
- the traversal generating objects of type E2
TraversalFlatMapStep
.default GraphTraversal<S,Object> id()
Element
to its Element.id()
.IdStep
.default GraphTraversal<S,String> label()
Element
to its Element.label()
.LabelStep
.default GraphTraversal<S,E> identity()
E
object to itself. In other words, a "no op."IdentityStep
.default <E2> GraphTraversal<S,E2> constant(E2 e)
E
value.ConstantStep
.default GraphTraversal<S,Vertex> V(Object... vertexIdsOrElements)
V
step is usually used to start a traversal but it may also be used mid-traversal.vertexIdsOrElements
- vertices to inject into the traversalGraphStep
default GraphTraversal<S,Vertex> to(Direction direction, String... edgeLabels)
Vertex
to its adjacent vertices given a direction and edge labels.direction
- the direction to traverse from the current vertexedgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Vertex> out(String... edgeLabels)
Vertex
to its outgoing adjacent vertices given the edge labels.edgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Vertex> in(String... edgeLabels)
Vertex
to its incoming adjacent vertices given the edge labels.edgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Vertex> both(String... edgeLabels)
Vertex
to its adjacent vertices given the edge labels.edgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Edge> toE(Direction direction, String... edgeLabels)
Vertex
to its incident edges given the direction and edge labels.direction
- the direction to traverse from the current vertexedgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Edge> outE(String... edgeLabels)
Vertex
to its outgoing incident edges given the edge labels.edgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Edge> inE(String... edgeLabels)
Vertex
to its incoming incident edges given the edge labels.edgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Edge> bothE(String... edgeLabels)
Vertex
to its incident edges given the edge labels.edgeLabels
- the edge labels to traverseVertexStep
.default GraphTraversal<S,Vertex> toV(Direction direction)
Edge
to its incident vertices given the direction.direction
- the direction to traverser from the current edgeEdgeVertexStep
.default GraphTraversal<S,Vertex> inV()
EdgeVertexStep
.default GraphTraversal<S,Vertex> outV()
EdgeVertexStep
.default GraphTraversal<S,Vertex> bothV()
Edge
to its incident vertices.EdgeVertexStep
.default GraphTraversal<S,Vertex> otherV()
Edge
to the incident vertex that was not just traversed from in the path history.EdgeOtherVertexStep
.default GraphTraversal<S,E> order()
OrderGlobalStep
.default GraphTraversal<S,E> order(Scope scope)
Scope.local
object (e.g. a list, map, etc.) or the entire Scope.global
traversal stream.scope
- whether the ordering is the current local object or the entire global stream.OrderGlobalStep
or OrderLocalStep
depending on the scope
.default <E2> GraphTraversal<S,? extends Property<E2>> properties(String... propertyKeys)
Element
to its associated properties given the provide property keys.
If no property keys are provided, then all properties are emitted.E2
- the value type of the returned propertiespropertyKeys
- the properties to retrievePropertiesStep
.default <E2> GraphTraversal<S,E2> values(String... propertyKeys)
Element
to the values of the associated properties given the provide property keys.
If no property keys are provided, then all property values are emitted.E2
- the value type of the propertiespropertyKeys
- the properties to retrieve their value fromPropertiesStep
.default <E2> GraphTraversal<S,Map<String,E2>> propertyMap(String... propertyKeys)
Element
to a Map
of the properties key'd according to their Property.key()
.
If no property keys are provided, then all properties are retrieved.E2
- the value type of the returned propertiespropertyKeys
- the properties to retrievePropertyMapStep
.default <E2> GraphTraversal<S,Map<Object,E2>> elementMap(String... propertyKeys)
Element
to a Map
of the property values key'd according to their Property.key()
.
If no property keys are provided, then all property values are retrieved. For vertices, the Map
will
be returned with the assumption of single property values along with T.id
and T.label
. Prefer
valueMap(String...)
if multi-property processing is required. For edges, keys will include additional
related edge structure of Direction.IN
and Direction.OUT
which themselves are Map
instances of the particular Vertex
represented by T.id
and T.label
.E2
- the value type of the returned propertiespropertyKeys
- the properties to retrieveElementMapStep
.default <E2> GraphTraversal<S,Map<Object,E2>> valueMap(String... propertyKeys)
Element
to a Map
of the property values key'd according to their Property.key()
.
If no property keys are provided, then all property values are retrieved.E2
- the value type of the returned propertiespropertyKeys
- the properties to retrievePropertyMapStep
.@Deprecated default <E2> GraphTraversal<S,Map<Object,E2>> valueMap(boolean includeTokens, String... propertyKeys)
valueMap(String...)
in conjunction with
with(String, Object)
or simple prefer elementMap(String...)
.Element
to a Map
of the property values key'd according to their Property.key()
.
If no property keys are provided, then all property values are retrieved.E2
- the value type of the returned propertiesincludeTokens
- whether to include T
tokens in the emitted map.propertyKeys
- the properties to retrievePropertyMapStep
.default GraphTraversal<S,String> key()
Property
to its Property.key()
.PropertyKeyStep
.default <E2> GraphTraversal<S,E2> value()
Property
to its Property.value()
.PropertyValueStep
.default GraphTraversal<S,Path> path()
PathStep
.default <E2> GraphTraversal<S,Map<String,E2>> match(Traversal<?,?>... matchTraversals)
E2
- the type of the obejcts bound in the variablesmatchTraversals
- the traversal that maintain variables which must hold for the life of the traverserMatchStep
.default <E2> GraphTraversal<S,E2> sack()
Traverser
to its Traverser.sack()
value.E2
- the sack value typeSackStep
.default GraphTraversal<S,Integer> loops()
Traverser
supports looping then calling this method will extract the number of loops for that
traverser.LoopsStep
default GraphTraversal<S,Integer> loops(String loopName)
Traverser
supports looping then calling this method will extract the number of loops for that
traverser for the named loop.LoopsStep
default <E2> GraphTraversal<S,Map<String,E2>> project(String projectKey, String... otherProjectKeys)
Map
that is keyed by the provided labels.ProjectStep
default <E2> GraphTraversal<S,Map<String,E2>> select(Pop pop, String selectKey1, String selectKey2, String... otherSelectKeys)
E2
- the type of the objects projectedpop
- if there are multiple objects referenced in the path, the Pop
to use.selectKey1
- the first key to projectselectKey2
- the second key to projectotherSelectKeys
- the third+ keys to projectSelectStep
.default <E2> GraphTraversal<S,Map<String,E2>> select(String selectKey1, String selectKey2, String... otherSelectKeys)
E2
- the type of the objects projectedselectKey1
- the first key to projectselectKey2
- the second key to projectotherSelectKeys
- the third+ keys to projectSelectStep
.default <E2> GraphTraversal<S,E2> select(Pop pop, String selectKey)
selectKey
- the key to projectSelectStep
.default <E2> GraphTraversal<S,E2> select(String selectKey)
Traverser
to the object specified by the selectKey
. Note that unlike other uses of
select
where there are multiple keys, this use of select
with a single key does not produce a
Map
.selectKey
- the key to projectSelectStep
.default <E2> GraphTraversal<S,E2> select(Pop pop, Traversal<S,E2> keyTraversal)
Traverser
to the object specified by the key returned by the keyTraversal
and apply the Pop
operation
to it.keyTraversal
- the traversal expression that selects the key to projectSelectStep
.default <E2> GraphTraversal<S,E2> select(Traversal<S,E2> keyTraversal)
Traverser
to the object specified by the key returned by the keyTraversal
. Note that unlike other uses of
select
where there are multiple keys, this use of select
with a traversal does not produce a
Map
.keyTraversal
- the traversal expression that selects the key to projectTraversalSelectStep
.default <E2> GraphTraversal<S,Collection<E2>> select(Column column)
select
that allows for the extraction of a Column
from objects in the traversal.column
- the column to extractTraversalMapStep
default <E2> GraphTraversal<S,E2> unfold()
Iterator
, Iterable
or Map
into a linear form or simply emits the object if it
is not one of those types.UnfoldStep
default GraphTraversal<S,List<E>> fold()
FoldStep
default <E2> GraphTraversal<S,E2> fold(E2 seed, BiFunction<E2,E,E2> foldFunction)
seed
and BiFunction
.seed
- the value to provide as the first argument to the foldFunction
foldFunction
- the function to fold by where the first argument is the seed
or the value returned from subsequent calss and
the second argument is the value from the streamFoldStep
default GraphTraversal<S,Long> count()
Traverser.bulk()
values (i.e. count the number
of traversers up to this point).CountGlobalStep
.default GraphTraversal<S,Long> count(Scope scope)
Traverser.bulk()
values given the specified
Scope
(i.e. count the number of traversers up to this point).CountGlobalStep
or CountLocalStep
depending on the Scope
default <E2 extends Number> GraphTraversal<S,E2> sum()
Traverser.get()
values multiplied by their
Traverser.bulk()
(i.e. sum the traverser values up to this point).SumGlobalStep
.default <E2 extends Number> GraphTraversal<S,E2> sum(Scope scope)
Traverser.get()
values multiplied by their
Traverser.bulk()
given the specified Scope
(i.e. sum the traverser values up to this point).SumGlobalStep
or SumLocalStep
depending on the Scope
.default <E2 extends Comparable> GraphTraversal<S,E2> max()
MaxGlobalStep
.default <E2 extends Comparable> GraphTraversal<S,E2> max(Scope scope)
Scope
.MaxGlobalStep
or MaxLocalStep
depending on the Scope
default <E2 extends Comparable> GraphTraversal<S,E2> min()
MinGlobalStep
.default <E2 extends Comparable> GraphTraversal<S,E2> min(Scope scope)
Scope
.MinGlobalStep
or MinLocalStep
depending on the Scope
default <E2 extends Number> GraphTraversal<S,E2> mean()
MeanGlobalStep
.default <E2 extends Number> GraphTraversal<S,E2> mean(Scope scope)
Scope
.MeanGlobalStep
or MeanLocalStep
depending on the Scope
default <K,V> GraphTraversal<S,Map<K,V>> group()
Map
. Calls to group()
are typically accompanied with
by()
modulators which help specify how the grouping should occur.GroupStep
.default <K> GraphTraversal<S,Map<K,Long>> groupCount()
Map
where the
object is the key and the value is the count.GroupCountStep
.default GraphTraversal<S,Tree> tree()
Tree
data structure.TreeStep
default GraphTraversal<S,Vertex> addV(String vertexLabel)
Vertex
.vertexLabel
- the label of the Vertex
to addAddVertexStep
addeddefault GraphTraversal<S,Vertex> addV(Traversal<?,String> vertexLabelTraversal)
AddVertexStep
addeddefault GraphTraversal<S,Vertex> addV()
Vertex
with a default vertex label.AddVertexStep
addeddefault GraphTraversal<S,Edge> addE(String edgeLabel)
Edge
with the specified edge label.edgeLabel
- the label of the newly added edgeAddEdgeStep
addeddefault GraphTraversal<S,Edge> addE(Traversal<?,String> edgeLabelTraversal)
AddEdgeStep
addeddefault GraphTraversal<S,E> to(String toStepLabel)
to()
-modulation to respective steps.toStepLabel
- the step label to modulate to.FromToModulating
step.default GraphTraversal<S,E> from(String fromStepLabel)
from()
-modulation to respective steps.fromStepLabel
- the step label to modulate to.FromToModulating
step.default GraphTraversal<S,E> to(Traversal<?,Vertex> toVertex)
addE(String)
this method specifies the traversal to use for selecting the
incoming vertex of the newly added Edge
.toVertex
- the traversal for selecting the incoming vertexAddEdgeStep
default GraphTraversal<S,E> from(Traversal<?,Vertex> fromVertex)
addE(String)
this method specifies the traversal to use for selecting the
outgoing vertex of the newly added Edge
.fromVertex
- the traversal for selecting the outgoing vertexAddEdgeStep
default GraphTraversal<S,E> to(Vertex toVertex)
addE(String)
this method specifies the traversal to use for selecting the
incoming vertex of the newly added Edge
.toVertex
- the vertex for selecting the incoming vertexAddEdgeStep
default GraphTraversal<S,E> from(Vertex fromVertex)
addE(String)
this method specifies the traversal to use for selecting the
outgoing vertex of the newly added Edge
.fromVertex
- the vertex for selecting the outgoing vertexAddEdgeStep
default GraphTraversal<S,Double> math(String expression)
expression
- the mathematical expression with variables refering to scope variables.MathStep
added.default GraphTraversal<S,E> filter(Predicate<Traverser<E>> predicate)
Traverser
to either true
or false
, where false
will not pass the
traverser to the next step.predicate
- the filter function to applyLambdaFilterStep
addeddefault GraphTraversal<S,E> filter(Traversal<?,?> filterTraversal)
Traverser
to either true
or false
, where false
will not pass the
traverser to the next step.filterTraversal
- the filter traversal to applyTraversalFilterStep
addeddefault GraphTraversal<S,E> or(Traversal<?,?>... orTraversals)
orTraversals
- filter traversals where at least one must be satisfiedOrStep
default GraphTraversal<S,E> and(Traversal<?,?>... andTraversals)
andTraversals
- filter traversals that must be satisfiedAndStep
default GraphTraversal<S,E> inject(E... injections)
injections
- the objects to add to the streamInjectStep
default GraphTraversal<S,E> dedup(Scope scope, String... dedupLabels)
scope
- whether the deduplication is on the stream (global) or the current object (local).dedupLabels
- if labels are provided, then the scope labels determine de-duplication. No labels implies current object.DedupGlobalStep
.default GraphTraversal<S,E> dedup(String... dedupLabels)
dedupLabels
- if labels are provided, then the scoped object's labels determine de-duplication. No labels implies current object.DedupGlobalStep
.default GraphTraversal<S,E> where(String startKey, P<String> predicate)
startKey
- the key containing the object to filterpredicate
- the filter to applyWherePredicateStep
default GraphTraversal<S,E> where(P<String> predicate)
predicate
- the filter to applyWherePredicateStep
default GraphTraversal<S,E> where(Traversal<?,?> whereTraversal)
whereTraversal
- the filter to applyWherePredicateStep
default GraphTraversal<S,E> has(String propertyKey, P<?> predicate)
propertyKey
- the key of the property to filter onpredicate
- the filter to apply to the key's valueHasStep
default GraphTraversal<S,E> has(T accessor, P<?> predicate)
accessor
- the T
accessor of the property to filter onpredicate
- the filter to apply to the key's valueHasStep
default GraphTraversal<S,E> has(String propertyKey, Object value)
propertyKey
- the key of the property to filter onvalue
- the value to compare the property value to for equalityHasStep
default GraphTraversal<S,E> has(T accessor, Object value)
accessor
- the T
accessor of the property to filter onvalue
- the value to compare the accessor value to for equalityHasStep
default GraphTraversal<S,E> has(String label, String propertyKey, P<?> predicate)
label
- the label of the Element
propertyKey
- the key of the property to filter onpredicate
- the filter to apply to the key's valueHasStep
default GraphTraversal<S,E> has(String label, String propertyKey, Object value)
label
- the label of the Element
propertyKey
- the key of the property to filter onvalue
- the value to compare the accessor value to for equalityHasStep
default GraphTraversal<S,E> has(T accessor, Traversal<?,?> propertyTraversal)
accessor
- the T
accessor of the property to filter onpropertyTraversal
- the traversal to filter the accessor value byHasStep
default GraphTraversal<S,E> has(String propertyKey, Traversal<?,?> propertyTraversal)
propertyKey
- the key of the property to filter onpropertyTraversal
- the traversal to filter the property value byHasStep
default GraphTraversal<S,E> has(String propertyKey)
propertyKey
- the key of the property to filter on for existenceHasStep
default GraphTraversal<S,E> hasNot(String propertyKey)
propertyKey
- the key of the property to filter on for existenceHasStep
default GraphTraversal<S,E> hasLabel(String label, String... otherLabels)
label
- the label of the Element
otherLabels
- additional labels of the Element
HasStep
default GraphTraversal<S,E> hasLabel(P<String> predicate)
predicate
- the filter to apply to the label of the Element
HasStep
default GraphTraversal<S,E> hasId(Object id, Object... otherIds)
id
- the identifier of the Element
otherIds
- additional identifiers of the Element
HasStep
default GraphTraversal<S,E> hasId(P<Object> predicate)
predicate
- the filter to apply to the identifier of the Element
HasStep
default GraphTraversal<S,E> hasKey(String label, String... otherLabels)
label
- the key of the Element
otherLabels
- additional key of the Element
HasStep
default GraphTraversal<S,E> hasKey(P<String> predicate)
predicate
- the filter to apply to the key of the Element
HasStep
default GraphTraversal<S,E> hasValue(Object value, Object... otherValues)
value
- the value of the Element
otherValues
- additional values of the Element
HasStep
default GraphTraversal<S,E> hasValue(P<Object> predicate)
predicate
- the filter to apply to the value of the Element
HasStep
default GraphTraversal<S,E> is(P<E> predicate)
E
object values given the provided predicate
.predicate
- the filter to applyIsStep
default GraphTraversal<S,E> is(Object value)
E
object if it is not P.eq(V)
to the provided value.value
- the value that the object must equal.IsStep
.default GraphTraversal<S,E> not(Traversal<?,?> notTraversal)
notTraversal
- the traversal to filter by.NotStep
.default GraphTraversal<S,E> coin(double probability)
E
object given a biased coin toss.probability
- the probability that the object will pass throughCoinStep
.default GraphTraversal<S,E> range(long low, long high)
low
do not pass through and those that exceed the value of high
will end the iteration.low
- the number at which to start allowing objects through the streamhigh
- the number at which to end the stream - use -1
to emit all remaining objectsRangeGlobalStep
default <E2> GraphTraversal<S,E2> range(Scope scope, long low, long high)
Scope
. Those before the value of low
do not pass through and those that exceed the value of
high
will end the iteration.scope
- the scope of how to apply the range
low
- the number at which to start allowing objects through the streamhigh
- the number at which to end the stream - use -1
to emit all remaining objectsRangeGlobalStep
or RangeLocalStep
depending on scope
default GraphTraversal<S,E> limit(long limit)
n
objects are allowed as defined by the limit
argument.limit
- the number at which to end the streamRangeGlobalStep
default <E2> GraphTraversal<S,E2> limit(Scope scope, long limit)
Scope
,
where only the first n
objects are allowed as defined by the limit
argument.scope
- the scope of how to apply the limit
limit
- the number at which to end the streamRangeGlobalStep
or RangeLocalStep
depending on scope
default GraphTraversal<S,E> tail()
TailGlobalStep
default GraphTraversal<S,E> tail(long limit)
n
objects will be returned as defined by the limit
.limit
- the number at which to end the streamTailGlobalStep
default <E2> GraphTraversal<S,E2> tail(Scope scope)
Scope
. In
this case, only the last object in the stream will be returned.scope
- the scope of how to apply the tail
TailGlobalStep
or TailLocalStep
depending on scope
default <E2> GraphTraversal<S,E2> tail(Scope scope, long limit)
Scope
. In
this case, only the last n
objects will be returned as defined by the limit
.scope
- the scope of how to apply the tail
limit
- the number at which to end the streamTailGlobalStep
or TailLocalStep
depending on scope
default GraphTraversal<S,E> skip(long skip)
n
objects in the traversal.skip
- the number of objects to skipRangeGlobalStep
default <E2> GraphTraversal<S,E2> skip(Scope scope, long skip)
n
objects in the traversal.scope
- the scope of how to apply the tail
skip
- the number of objects to skipRangeGlobalStep
or RangeLocalStep
depending on scope
default GraphTraversal<S,E> timeLimit(long timeLimit)
Traverser
hits this step, a count down is started. Once the time limit is up, all remaining traversers are filtered out.timeLimit
- the count down timeTimeLimitStep
default GraphTraversal<S,E> simplePath()
PathFilterStep
.default GraphTraversal<S,E> cyclicPath()
PathFilterStep
.default GraphTraversal<S,E> sample(int amountToSample)
amountToSample
- the number of objects to allowSampleGlobalStep
default GraphTraversal<S,E> sample(Scope scope, int amountToSample)
scope
- the scope of how to apply the sample
amountToSample
- the number of objects to allowSampleGlobalStep
or SampleLocalStep
depending on the scope
default GraphTraversal<S,E> drop()
g.V().drop().iterate()
.DropStep
addeddefault GraphTraversal<S,E> sideEffect(Consumer<Traverser<E>> consumer)
Traverser
and pass it to the next step unmodified.consumer
- the operation to perform at this step in relation to the Traverser
LambdaSideEffectStep
default GraphTraversal<S,E> sideEffect(Traversal<?,?> sideEffectTraversal)
Traverser
and pass it to the next step unmodified.sideEffectTraversal
- the operation to perform at this step in relation to the Traverser
TraversalSideEffectStep
default <E2> GraphTraversal<S,E2> cap(String sideEffectKey, String... sideEffectKeys)
Map
.sideEffectKey
- the side-effect to emitsideEffectKeys
- other side-effects to emitSideEffectCapStep
default GraphTraversal<S,Edge> subgraph(String sideEffectKey)
Graph
object held in the specified side-effect
key.sideEffectKey
- the name of the side-effect key that will hold the subgraphSubgraphStep
default GraphTraversal<S,E> aggregate(String sideEffectKey)
aggregate(Scope, String)
with a Scope.local
.sideEffectKey
- the name of the side-effect key that will hold the aggregated objectsAggregateStep
default GraphTraversal<S,E> aggregate(Scope scope, String sideEffectKey)
Scope
argument to determine whether it should be lazy
Scope.local
or eager (Scope.global
while gathering those objects.sideEffectKey
- the name of the side-effect key that will hold the aggregated objectsAggregateStep
default GraphTraversal<S,E> group(String sideEffectKey)
Map
. Calls to group()
are typically accompanied with
by()
modulators which help specify how the grouping should occur.sideEffectKey
- the name of the side-effect key that will hold the aggregated groupingGroupStep
.default GraphTraversal<S,E> groupCount(String sideEffectKey)
Map
where the
object is the key and the value is the count.sideEffectKey
- the name of the side-effect key that will hold the aggregated groupingGroupCountStep
.default GraphTraversal<S,E> tree(String sideEffectKey)
Tree
data structure.sideEffectKey
- the name of the side-effect key that will hold the treeTreeStep
default <V,U> GraphTraversal<S,E> sack(BiFunction<V,U,V> sackOperator)
Traverser
to its Traverser.sack()
value.sackOperator
- the operator to apply to the sack valueSackStep
.default GraphTraversal<S,E> store(String sideEffectKey)
aggregate(Scope, String)
using Scope.local
.sideEffectKey
- the name of the side-effect key that will hold the aggregateStoreStep
default GraphTraversal<S,E> profile(String sideEffectKey)
sideEffectKey
- the name of the side-effect key within which to hold the profile objectProfileSideEffectStep
default GraphTraversal<S,TraversalMetrics> profile()
profile
in interface Traversal<S,E>
ProfileSideEffectStep
default GraphTraversal<S,E> property(VertexProperty.Cardinality cardinality, Object key, Object value, Object... keyValues)
Property
value and related meta properties if supplied, if supported by the Graph
and if the Element
is a VertexProperty
. This method is the long-hand version of
property(Object, Object, Object...)
with the difference that the VertexProperty.Cardinality
can be supplied.
Generally speaking, this method will append an AddPropertyStep
to the Traversal
but when
possible, this method will attempt to fold key/value pairs into an AddVertexStep
, AddEdgeStep
or
AddVertexStartStep
. This potential optimization can only happen if cardinality is not supplied
and when meta-properties are not included.cardinality
- the specified cardinality of the property where null
will allow the Graph
to use its default settingskey
- the key for the propertyvalue
- the value for the propertykeyValues
- any meta properties to be assigned to this propertydefault GraphTraversal<S,E> property(Object key, Object value, Object... keyValues)
Property
. If the Element
is a VertexProperty
and the
Graph
supports it, meta properties can be set. Use of this method assumes that the
VertexProperty.Cardinality
is defaulted to null
which means that the default cardinality for
the Graph
will be used.
This method is effectively calls
property(org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality, Object, Object, Object...)
as property(null, key, value, keyValues
.key
- the key for the propertyvalue
- the value for the propertykeyValues
- any meta properties to be assigned to this propertydefault <M,E2> GraphTraversal<S,E2> branch(Traversal<?,M> branchTraversal)
Traverser
to all the specified traversals.branchTraversal
- the traversal to branch the Traverser
toTraversal
with the BranchStep
addeddefault <M,E2> GraphTraversal<S,E2> branch(Function<Traverser<E>,M> function)
Traverser
to all the specified functions.function
- the traversal to branch the Traverser
toTraversal
with the BranchStep
addeddefault <M,E2> GraphTraversal<S,E2> choose(Traversal<?,M> choiceTraversal)
choose
is modified by option(M, org.apache.tinkerpop.gremlin.process.traversal.Traversal<?, E2>)
which provides the various
branch choices.choiceTraversal
- the traversal used to determine the value for the branchChooseStep
default <E2> GraphTraversal<S,E2> choose(Traversal<?,?> traversalPredicate, Traversal<?,E2> trueChoice, Traversal<?,E2> falseChoice)
traversalPredicate
- the traversal used to determine the "if" portion of the if-then-elsetrueChoice
- the traversal to execute in the event the traversalPredicate
returns truefalseChoice
- the traversal to execute in the event the traversalPredicate
returns falseChooseStep
default <E2> GraphTraversal<S,E2> choose(Traversal<?,?> traversalPredicate, Traversal<?,E2> trueChoice)
traversalPredicate
- the traversal used to determine the "if" portion of the if-then-elsetrueChoice
- the traversal to execute in the event the traversalPredicate
returns trueChooseStep
default <M,E2> GraphTraversal<S,E2> choose(Function<E,M> choiceFunction)
choose
is modified by option(M, org.apache.tinkerpop.gremlin.process.traversal.Traversal<?, E2>)
which provides the various
branch choices.choiceFunction
- the function used to determine the value for the branchChooseStep
default <E2> GraphTraversal<S,E2> choose(Predicate<E> choosePredicate, Traversal<?,E2> trueChoice, Traversal<?,E2> falseChoice)
choosePredicate
- the function used to determine the "if" portion of the if-then-elsetrueChoice
- the traversal to execute in the event the traversalPredicate
returns truefalseChoice
- the traversal to execute in the event the traversalPredicate
returns falseChooseStep
default <E2> GraphTraversal<S,E2> choose(Predicate<E> choosePredicate, Traversal<?,E2> trueChoice)
choosePredicate
- the function used to determine the "if" portion of the if-then-elsetrueChoice
- the traversal to execute in the event the traversalPredicate
returns trueChooseStep
default <E2> GraphTraversal<S,E2> optional(Traversal<?,E2> optionalTraversal)
optionalTraversal
- the traversal to execute for a potential resultChooseStep
default <E2> GraphTraversal<S,E2> union(Traversal<?,E2>... unionTraversals)
unionTraversals
- the traversals to mergeUnionStep
default <E2> GraphTraversal<S,E2> coalesce(Traversal<?,E2>... coalesceTraversals)
coalesceTraversals
- the traversals to coalesceCoalesceStep
default GraphTraversal<S,E> repeat(Traversal<?,E> repeatTraversal)
repeatTraversal
- the traversal to repeat overRepeatStep
default GraphTraversal<S,E> repeat(String loopName, Traversal<?,E> repeatTraversal)
repeatTraversal
- the traversal to repeat overloopName
- The name given to the loopRepeatStep
default GraphTraversal<S,E> emit(Traversal<?,?> emitTraversal)
repeat(Traversal)
to determine what objects get emit from the loop.emitTraversal
- the emit predicate defined as a traversalRepeatStep
default GraphTraversal<S,E> emit(Predicate<Traverser<E>> emitPredicate)
repeat(Traversal)
to determine what objects get emit from the loop.emitPredicate
- the emit predicateRepeatStep
default GraphTraversal<S,E> emit()
repeat(Traversal)
to emit all objects from the loop.RepeatStep
default GraphTraversal<S,E> until(Traversal<?,?> untilTraversal)
repeat(Traversal)
to determine when the loop should exit.untilTraversal
- the traversal that determines when the loop exitsRepeatStep
default GraphTraversal<S,E> until(Predicate<Traverser<E>> untilPredicate)
repeat(Traversal)
to determine when the loop should exit.untilPredicate
- the predicate that determines when the loop exitsRepeatStep
default GraphTraversal<S,E> times(int maxLoops)
repeat(Traversal)
to specify how many loops should occur before exiting.maxLoops
- the number of loops to execute prior to exitingRepeatStep
default <E2> GraphTraversal<S,E2> local(Traversal<?,E2> localTraversal)
localTraversal
- the traversal to execute locallyLocalStep
default GraphTraversal<S,E> pageRank()
alpha
value.PageRankVertexProgramStep
default GraphTraversal<S,E> pageRank(double alpha)
PageRankVertexProgramStep
default GraphTraversal<S,E> peerPressure()
PeerPressureVertexProgramStep
default GraphTraversal<S,E> connectedComponent()
ConnectedComponentVertexProgram
default GraphTraversal<S,Path> shortestPath()
ShortestPathVertexProgramStep
default GraphTraversal<S,E> program(VertexProgram<?> vertexProgram)
VertexProgram
over the graph.ProgramVertexProgramStep
default GraphTraversal<S,E> as(String stepLabel, String... stepLabels)
stepLabel
- the name of the stepstepLabels
- additional names for the labeldefault GraphTraversal<S,E> barrier()
Integer.MAX_VALUE
.NoOpBarrierStep
default GraphTraversal<S,E> barrier(int maxBarrierSize)
maxBarrierSize
- the size of the barrierNoOpBarrierStep
default <E2> GraphTraversal<S,E2> index()
with(String, Object)
and WithOptions.indexer
.
Indexed as list: ["a","b","c"] => [["a",0],["b",1],["c",2]]
Indexed as map: ["a","b","c"] => {0:"a",1:"b",2:"c"}
If the current object is not a collection, this step will map the object to a single item collection/map:
Indexed as list: "a" => ["a",0]
Indexed as map: "a" => {0:"a"}IndexStep
default GraphTraversal<S,E> barrier(Consumer<TraverserSet<Object>> barrierConsumer)
Integer.MAX_VALUE
.barrierConsumer
- a consumer function that is applied to the objects aggregated to the barrierNoOpBarrierStep
default GraphTraversal<S,E> with(String key)
with(key, true)
. The key
of the configuration must be step specific and therefore a configuration could be supplied that is not known to
be valid until execution.key
- the key of the configuration to apply to a stepdefault GraphTraversal<S,E> with(String key, Object value)
key
- the key of the configuration to apply to a stepvalue
- the value of the configuration to apply to a stepdefault GraphTraversal<S,E> by()
by()
can be applied to a number of different step to alter their behaviors. This form is essentially
an identity()
modulation.default GraphTraversal<S,E> by(Traversal<?,?> traversal)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified traversal.traversal
- the traversal to applydefault GraphTraversal<S,E> by(T token)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified token of T
.token
- the token to applydefault GraphTraversal<S,E> by(String key)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified key.key
- the key to applydefault <V> GraphTraversal<S,E> by(Function<V,Object> function)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified function.function
- the function to applydefault <V> GraphTraversal<S,E> by(Traversal<?,?> traversal, Comparator<V> comparator)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified function.traversal
- the traversal to applycomparator
- the comparator to apply typically for some order()
default GraphTraversal<S,E> by(Comparator<E> comparator)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified function.comparator
- the comparator to apply typically for some order()
default GraphTraversal<S,E> by(Order order)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified function.order
- the comparator to apply typically for some order()
default <V> GraphTraversal<S,E> by(String key, Comparator<V> comparator)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified function.key
- the key to apply traversalcomparator
- the comparator to apply typically for some order()
default <U> GraphTraversal<S,E> by(Function<U,Object> function, Comparator comparator)
by()
can be applied to a number of different step to alter their behaviors. Modifies the previous
step with the specified function.function
- the function to applycomparator
- the comparator to apply typically for some order()
default <M,E2> GraphTraversal<S,E> option(M pickToken, Traversal<?,E2> traversalOption)
choose(Function)
to specifies the available choices that might be executed.pickToken
- the token that would trigger this optiontraversalOption
- the option as a traversaldefault <E2> GraphTraversal<S,E> option(Traversal<?,E2> traversalOption)
choose(Function)
to specifies the available choices that might be executed.traversalOption
- the option as a traversaldefault GraphTraversal<S,E> read()
GraphTraversalSource.io(String)
step which
instructs the step to perform a read with its given configuration.IoStep
modulated to readdefault GraphTraversal<S,E> write()
GraphTraversalSource.io(String)
step which
instructs the step to perform a write with its given configuration.IoStep
modulated to writeCopyright © 2013–2020 Apache Software Foundation. All rights reserved.