Mathematical background as explained in Marko Rodriguez's paper The Gremlin Graph Traversal Machine and Language
Generic API as explained in the Tinkerpop documentation
Specific API (Java) as explained in the Javadocs page
Specific "modern" Example mostly used for tests and explanations regarding Gremlin
Gremlin# QUERY6fa66ecef8b821c154ec1c6e6265c128
Gremlin# QUERY5995c73a3dbc90ffb8c435302aea22aa
determines whether there are available results
will return the next result.next(n) will return the next n results in a list
Gremlin# e8ddbafd7c0434fdcf76d731d3b853a0
will return an Optional and thus, is a composite of hasNext()/next()
Gremlin# 0c66c11ba58c9c44d56165effd882f3c
will return all results in a set and thus, duplicates removed
Gremlin# a0f48fc5f213aac4dafe4d6ab5502358
will return all results in a weighted set and thus, duplicates preserved via weighting
Gremlin# d327ebe35ecc41012f9efa0ed35ac585
fill(collection) will put all results in the provided collection and return the collection when complete.
Gremlin# c4b1b644ab40695ad453d4ddeb98f981
Iterates the traversal presumably for the generation of side-effects. See https://stackoverflow.com/questions/47403296/iterate-step-is-used-in-the-end-of-the-command-when-creating-nodes-and-edges-t
Gremlin# b3170f2b4a700a6b88ab4df38cae6816
can only be used with remote traversals to Gremlin Server or RGPs. It starts a promise to execute a function on the current Traversal that will be completed in the future.
will return a TraversalExplanation. A traversal explanation details how the traversal (prior to explain()) will be compiled given the registered traversal strategies. A TraversalExplanation has a toString() representation with 3-columns. The first column is the traversal strategy being applied. The second column is the traversal strategy category: [D]ecoration, [O]ptimization, [P]rovider optimization, [F]inalization, and [V]erification. Finally, the third column is the state of the traversal post strategy application. The final traversal is the resultant execution plan.
Gremlin# bcc02d9ae7acd2f88be0ac33dcf9d3cb
ensures that all provided traversals yield a result
randomly filters out traversers with the given probability
Gremlin# d3d2e6d4982d1c92af017ee3e96ab5ff
filters vertices, edges, and vertex properties based on their properties. This step has quite a few variations.
Gremlin# e954bf3557e230d1f2dc381dc1d9ae74
filters elements that fullfill the given predicate. Variant: Filters elements that are equal to the given Object.
ensures that at least one of the provided traversals yield a result.
Gremlin# e6ae50ea04c88f1268d307be15f9b08a
Gremlin# 2bf6da07ac8f36f78b795b65ec90101f
filters the current object based on either the object itself (Scope.local) or the path history of the object (Scope.global) (filter). This step is typically used in conjunction with either #match Step or select()-step, but can be used in isolation.
is not a real step, but a "step modulator" similar to by() and option(). With as(), it is possible to provide a label to the step that can later be accessed by steps and data structures that make use of such labels — e.g., select(), match(), and path
Gremlin# 6440d52363f23d2acfe39f0ee9c2cd1e
is not an actual step, but instead is a "step-modulator" similar to as() and option(). If a step is able to accept traversals, functions, comparators, etc. then by() is the means by which they are added. The general pattern is step().by()…by(). Some steps can only accept one by() while others can take an arbitrary amount.
Gremlin# 14aed317112a20fa9d4a5d06fe9e6a82
is not an actual step, but is instead a step modulator for repeat() (find more documentation on the emit() there).
An option to a branch() or choose()
maps the traversal to the ids of the current elements.
maps the traversal to the labels of the current elements.
see https://stackoverflow.com/questions/55609832/is-threre-a-document-about-how-gremlin-match-works
Gremlin# 41de702fb635f3115221fbcb3d3ba1a0
Iterates the traversal up to the itself and emits the side-effect referenced by the key. If multiple keys are supplied then the side-effects are emitted as a Map.
Gremlin# 9108ecd33ce535af37e7119ac05bde88
counts the total number of represented traversers in the streams (i.e. the bulk count).
Gremlin# 7af8ac99ecd1d211bbf04b4fdd828663
operates on a stream of comparable objects and determines which is the first object according to its natural order in the stream.
operates on a stream of comparable objects and determines which is the last object according to its natural order in the stream.
operates on a stream of numbers and determines the average of those numbers.
operates on a stream of numbers and sums the numbers together to yield a result
There are situations when the traversal stream needs a "barrier" to aggregate all the objects and emit a computation that is a function of the aggregate. The fold()-step (map) is one particular instance of this. Please see unfold()-step for the inverse functionality.
Gremlin# b8d7d40c2093fa0e757d98d69f7a9cf7
maps the current elements to the vertices at the end of the ingoing edges.
Gremlin# 1bd3956d0a3b56a809fffd65785ff0da
maps the current elements to the vertices at the end of the outgoing edges.
maps the current elements to the vertices at the boths ends of the edges.
Gremlin# 728ffea28cc2e7fcd1220db8314435dd
maps the current elements to the the ingoing edges.
maps the current elements to the the outgoing edges.
Gremlin# af6707697483f1dc1b05c52be7cef49b
maps the current elements to both the in and outgoing edges.
Gremlin# b12189f81a310ae44b275edf35ade9b0
maps the current edges to the the ingoing Vertices.
The outV step maps the current edges to the outgoing Vertices.
Gremlin# 12c6256246b9e81cf2dec28cc7f19bec
maps the current edges to both the ingoing and outgoing Vertices.
The coalesce()-step evaluates the provided traversals in order and returns the first traversal that emits at least one element.
Gremlin# a06312bfb2c81f87d3bb0c0a615ac1b4
is used to add properties to the elements of the graph
is used to aggregate all the objects at a particular point of traversal into a Collection
routes the current traverser to a particular traversal branch option. With choose(), it is possible to implement if/then/else-semantics as well as more complicated selections.
Gremlin# 096409e2f6de0fe25787fd5accee6895
is used for looping over a traversal given some break predicate
Gremlin# 078569db0bb208cbfe6a1a6be55240e7
Gremlin# 7c7e29968da31c86fecbe12dd95f0de1
Continues processing based on the given filter condition.
transforms the current step element to a new element (which may be empty). see also https://stackoverflow.com/questions/51015636/in-gremlin-how-does-map-really-work
transforms the current step in a one to many fashion.
performs some operation on the traverser and passes it to the next step.
Gremlin# cf3c5eeb1a261f5c2b8e9e99e8f775b5
Graph Approaches for Software Engineeering