Like aggregate, but applies fun
to each element prior to adding it to the Buffer
Adds input into buffer greedily - it will exhaust all the items that come to it from previous steps before emitting the next element.
Adds input into buffer greedily - it will exhaust all the items that come to it from previous steps before emitting the next element.
Note that this is a side effect step: the input will just flow through to the next step, but you can use cap
to get the buffer into the pipeline.
example in SideEffectTest
Takes a collection of pipes and emits incoming objects that are true for all of the pipes.
emits the side-effect of the previous pipe (e.g.
emits the side-effect of the previous pipe (e.g. groupBy) - and not the values that flow through it. If you use it, this normally is the last step. @see examples in SideEffectTest
Copies incoming object to internal pipes.
only emits the object if the object generated by its function hasn't been seen before.
emits everything except what is in the results of a named step.
emits everything except what is in the results of a named step.
not currently supported because ExceptFilterPipe uses ElementHelper.areEqual to compare two elements, which compares if the classes are equal. I'll open a pull request to fix that in blueprints shortly...
emits everything except what is in the supplied collection.
Used in combination with a copySplit, merging the parallel traversals in a round-robin fashion.
All the objects previous to this step are aggregated in a greedy fashion and emitted as a List.
All the objects previous to this step are aggregated in a greedy fashion and emitted as a List. Normally they would be traversed over lazily. Gather/Scatter is good for breadth-first traversals where the gather closure filters out unwanted elements at the current radius.
https://github.com/tinkerpop/gremlin/wiki/Depth-First-vs.-Breadth-First
Note: Gremlin-Groovy comes with an overloaded gather pipe that takes a function to transform the last step. You can achieve the same by just appending a map step.
Groups input by given keyFunction greedily - it will exhaust all the items that come to it from previous steps before emitting the next element.
Groups input by given keyFunction greedily - it will exhaust all the items that come to it from previous steps before emitting the next element.
Note that this is a side effect step: the input will just flow through to the next step, but you can use cap
to get the buffer into the pipeline.
example in SideEffectTest
counts each traversed object and stores it in a map
Check if the element has a property with provided key/value that matches the given predicate
Check if the element has a property with provided key/value that matches the given comparison token
Check if the element has a property with provided key/value
Check if the element has a property with provided key
Check if the element does not have a property with provided key/value
Check if the element does not have a property with provided key.
checks if a given property is in an interval (startValue: inclusive, endValue: exclusive)
Completely drain the pipeline of its objects - useful when a sideEffect of the pipeline is desired
Completely drain the pipeline of its objects - useful when a sideEffect of the pipeline is desired
Emit the incoming vertex, but have other vertex provide an incoming and outgoing edge to incoming vertex.
Emit the incoming vertex, but have other vertex provide an incoming and outgoing edge to incoming vertex.
Emit the incoming vertex, but have other vertex provide an incoming and outgoing edge to incoming vertex.
Add a LoopPipe to the end of the Pipeline.
Add a LoopPipe to the end of the Pipeline. Looping is useful for repeating a section of a pipeline. The provided whileFunction determines when to drop out of the loop. The provided emitFunction can be used to emit objects that are still going through a loop. The whileFunction and emitFunctions are provided a LoopBundle object which contains the object in loop along with other useful metadata.
the number of steps to loop back to
whether or not to continue looping on the current object
whether or not to emit the current object (irrespective of looping)
Add a LoopPipe to the end of the Pipeline.
Add a LoopPipe to the end of the Pipeline. Looping is useful for repeating a section of a pipeline. The provided whileFunction determines when to drop out of the loop. The whileFunction is provided a LoopBundle object which contains the object in loop along with other useful metadata.
the name of the step to loop back to
whether or not to continue looping on the current object
map objects over a given function aliases: transform (standard gremlin) and ∘ (category theory)
Remembers a particular mapping from input to output.
Remembers a particular mapping from input to output. Long or expensive expressions with no side effects can use this step to remember a mapping, which helps reduce load when previously processed objects are passed into it. For situations where memoization may consume large amounts of RAM, consider using an embedded key-value store like JDBM or some other persistent Map implementation.
Behaves similar to back
except that it does not filter.
Behaves similar to back
except that it does not filter. It will go down a particular path and back up to where it left off.
As such, its useful for yielding a side-effect down a particular branch.
Gets the objects on each step on the path through the pipeline as lists.
Gets the objects on each step on the path through the pipeline as lists. Example: graph.v(1).out.path
only emit a given range of elements
retains everything that is in the results of a named step.
retains everything that is in the results of a named step.
not currently supported because RetainFilterPipe uses ElementHelper.areEqual to compare two elements, which compares if the classes are equal. I'll open a pull request to fix that in blueprints shortly...
retains everything that is in the supplied collection.
This will unroll any iterator/iterable/map that is provided to it.
This will unroll any iterator/iterable/map that is provided to it. Gather/Scatter is good for breadth-first traversals where the gather closure filters out unwanted elements at the current radius.
https://github.com/tinkerpop/gremlin/wiki/Depth-First-vs.-Breadth-First
Note: only for one level - it will not unroll an iterator within an iterator.
Gets the objects for given named steps on the path through the pipeline as rows.
Gets the objects on each named step on the path through the pipeline as rows.
Add a ShufflePipe to the end of the Pipeline.
Add a ShufflePipe to the end of the Pipeline. All the objects previous to this step are aggregated in a greedy fashion, their order randomized and emitted as a List.
Emits input, but calls a side effect closure on each input.
simplifies the path by removing cycles
Like store , but applies fun
to each element prior to adding it to the Buffer
Emits input, but adds input to collection.
Emits input, but adds input to collection. This is a lazy step, i.e. it adds it to the buffer as the elements are being traversed.
run through pipeline and get results as List
run through pipeline and get results as Set
run through pipeline and get results as Stream
Emit input, but stores the tree formed by the traversal as a map.