TODO more docs
Just like Tinkerpop3 and most other Iterators, a Traversal can only be executed once.
Attributes
- Companion:
- object
- Graph
- Supertypes
- Known subtypes
- class InitialTraversal[A]class PathAwareTraversal[A]
Members list
Value members
Concrete methods
aggregate all objects at this point into the given collection (side effect)
aggregate all objects at this point into the given collection (side effect)
Attributes
- Example:
val xs = mutable.ArrayBuffer.empty[A] myTraversal.aggregate(xs).foo.bar // xs will be filled once `myTraversal` is executed
only preserves elements for which all of the given traversals have at least one result Works for arbitrary amount of 'AND' traversals.
only preserves elements for which all of the given traversals have at least one result Works for arbitrary amount of 'AND' traversals.
Attributes
- Example:
.and(_.label("someLabel"), _.has("someProperty"))
follow incoming and outgoing edges to adjacent nodes
follow incoming and outgoing edges to adjacent nodes
Attributes
follow incoming and outgoing edges of given labels to adjacent nodes
follow incoming and outgoing edges of given labels to adjacent nodes
Attributes
follow incoming and outgoing edges
follow incoming and outgoing edges
Attributes
follow incoming and outgoing edges of given label
follow incoming and outgoing edges of given label
Attributes
casts all elements to given type note: this can lead to casting errors
casts all elements to given type note: this can lead to casting errors
Attributes
- See also:
collectAll
Branch step: based on the current element, match on something given a traversal, and provide resulting traversals based on the matched element. Allows to implement conditional semantics: if, if/else, if/elseif, if/elseif/else, ...
Branch step: based on the current element, match on something given a traversal, and provide resulting traversals based on the matched element. Allows to implement conditional semantics: if, if/else, if/elseif, if/elseif/else, ...
Attributes
- BranchOn
required to be >: Null because the implementation is using
null
as the default value. I didn't find a better way to implement all semantics with the niceties of PartialFunction, and also yolo...- NewEnd
The element type of the resulting traversal
- on
Traversal to get to what you want to match on
- options
PartialFunction from the matched element to the resulting traversal
- See also:
LogicalStepsTests
- Example:
.choose(_.property(Name)) { case "L1" => _.out case "R1" => _.repeat(_.out)(_.maxDepth(3)) case _ => _.in }
Branch step: evaluates the provided traversals in order and returns the first traversal that emits at least one element.
Branch step: evaluates the provided traversals in order and returns the first traversal that emits at least one element.
Attributes
- See also:
LogicalStepsTests
- Example:
.coalesce( _.out("label1"), _.in("label2"), _.in("label3") )
collects and all elements of the given type
collects and all elements of the given type
Attributes
Deduplicate elements of this traversal - a.k.a. distinct, unique, ...
Deduplicate elements of this traversal - a.k.a. distinct, unique, ...
Attributes
deduplicate elements of this traversal by a given function
deduplicate elements of this traversal by a given function
Attributes
group elements and count how often they appear
group elements and count how often they appear
Attributes
group elements by a given transformation function and count how often the results appear
group elements by a given transformation function and count how often the results appear
Attributes
Filter elements by existence of property (irrespective of value)
Filter elements by existence of property (irrespective of value)
Attributes
Filter elements by existence of property (irrespective of value)
Filter elements by existence of property (irrespective of value)
Attributes
Filter elements by property value
Filter elements by property value
Attributes
Filter elements by property value
Filter elements by property value
Attributes
Filter elements by property with given predicate.
Filter elements by property with given predicate.
Attributes
- Example:
from GenericGraphTraversalTest
.has(Name.where(_.endsWith("1"))) .has(Name.where(_.matches("[LR]."))) .has(Name.where(P.eq("R1"))) .has(Name.where(P.neq("R1"))) .has(Name.where(P.within(Set("L1", "L2")))) .has(Name.where(P.within("L1", "L2", "L3"))) .has(Name.where(P.matches("[LR].")))
Filter elements by property value
Filter elements by property value
Attributes
alias for
alias for
id
Attributes
alias for
alias for
id
Attributes
alias for
alias for
label
Attributes
alias for
alias for
label
Attributes
Filter elements by (non-)existence of property (irrespective of value)
Filter elements by (non-)existence of property (irrespective of value)
Attributes
Filter elements by (non-)existence of property (irrespective of value)
Filter elements by (non-)existence of property (irrespective of value)
Attributes
Filter elements by property value
Filter elements by property value
Attributes
Filter elements by property value
Filter elements by property value
Attributes
Filter elements by property value
Filter elements by property value
Attributes
Filter elements by property with given predicate.
Filter elements by property with given predicate.
Attributes
- Example:
from GenericGraphTraversalTest
.hasNot(Name.where(_.endsWith("1"))) .hasNot(Name.where(_.matches("[LR]."))) .hasNot(Name.where(P.eq("R1"))) .hasNot(Name.where(P.neq("R1"))) .hasNot(Name.where(P.within(Set("L1", "L2")))) .hasNot(Name.where(P.within("L1", "L2", "L3"))) .hasNot(Name.where(P.matches("[LR].")))
Print help/documentation based on the current elementType A
.
Relies on all step extensions being annotated with @Traversal / @Doc
Note that this works independently of tab completion and implicit conversions in scope - it will simply list
all documented steps in the classpath
Print help/documentation based on the current elementType A
.
Relies on all step extensions being annotated with @Traversal / @Doc
Note that this works independently of tab completion and implicit conversions in scope - it will simply list
all documented steps in the classpath
Attributes
Filter by given id
Note: do not use as the first step in a traversal, e.g. traversalSource.all.id(value)
.
Use traversalSource.withId
instead, it is much faster
Filter by given id
Note: do not use as the first step in a traversal, e.g. traversalSource.all.id(value)
.
Use traversalSource.withId
instead, it is much faster
Attributes
Filter by given ids
Note: do not use as the first step in a traversal, e.g. traversalSource.all.id(value)
.
Use traversalSource.withId
instead, it is much faster
Filter by given ids
Note: do not use as the first step in a traversal, e.g. traversalSource.all.id(value)
.
Use traversalSource.withId
instead, it is much faster
Attributes
follow incoming edges to adjacent nodes
follow incoming edges to adjacent nodes
Attributes
follow incoming edges of given label to adjacent nodes
follow incoming edges of given label to adjacent nodes
Attributes
follow incoming edges
follow incoming edges
Attributes
follow incoming edges of given label
follow incoming edges of given label
Attributes
traverse to incoming node [A] ---edge--> B
traverse to incoming node [A] ---edge--> B
Attributes
filters out everything that is not the given value
filters out everything that is not the given value
Attributes
Attributes
- Definition Classes
- IterableOps
Execute the traversal without returning anything
Execute the traversal without returning anything
Attributes
Execute the traversal and convert the result to a list - shorthand for toList
Execute the traversal and convert the result to a list - shorthand for toList
Attributes
traverse to the element label
traverse to the element label
Attributes
filter by the element label
Note: do not use as the first step in a traversal, e.g. traversalSource.all.label(value)
.
Use traversalSource.label
instead, it is much faster
TODO: make the above an automatic optimisation
filter by the element label
Note: do not use as the first step in a traversal, e.g. traversalSource.all.label(value)
.
Use traversalSource.label
instead, it is much faster
TODO: make the above an automatic optimisation
Attributes
filter by the element labels
Note: do not use as the first step in a traversal, e.g. traversalSource.all.label(value)
.
Use traversalSource.label
instead, it is much faster
TODO: make the above an automatic optimisation
filter by the element labels
Note: do not use as the first step in a traversal, e.g. traversalSource.all.label(value)
.
Use traversalSource.label
instead, it is much faster
TODO: make the above an automatic optimisation
Attributes
filter by the element label (inverse)
filter by the element label (inverse)
Attributes
filter by the element labels (inverse)
filter by the element labels (inverse)
Attributes
only preserves elements if the provided traversal does not have any results - alias for whereNot
only preserves elements if the provided traversal does not have any results - alias for whereNot
Attributes
only preserves elements for which at least one of the given traversals has at least one result Works for arbitrary amount of 'OR' traversals.
only preserves elements for which at least one of the given traversals has at least one result Works for arbitrary amount of 'OR' traversals.
Attributes
- Example:
.or(_.label("someLabel"), _.has("someProperty"))
follow outgoing edges to adjacent nodes
follow outgoing edges to adjacent nodes
Attributes
follow outgoing edges of given labels to adjacent nodes
follow outgoing edges of given labels to adjacent nodes
Attributes
follow outgoing edges
follow outgoing edges
Attributes
follow outgoing edges of given label
follow outgoing edges of given label
Attributes
traverse to outgoing node A ---edge--> [B]
traverse to outgoing node A ---edge--> [B]
Attributes
retrieve entire path that has been traversed thus far prerequisite: enablePathTracking has been called previously
retrieve entire path that has been traversed thus far prerequisite: enablePathTracking has been called previously
Attributes
- Example:
myTraversal.enablePathTracking.out.out.path.toList
Repeat the given traversal
Repeat the given traversal
By default it will continue repeating until there's no more results, not emit anything along the way, and use depth first search.
The @param behaviourBuilder allows you to configure end conditions (until|whilst|maxDepth), whether it should emit elements it passes by, and which search algorithm to use (depth-first or breadth-first).
Search algorithm: Depth First Search (DFS) vs Breadth First Search (BFS): DFS means the repeat step will go deep before wide. BFS does the opposite: wide before deep. For example, given the graph
L3 <- L2 <- L1 <- Center -> R1 -> R2 -> R3 -> R4
DFS will iterate the nodes in the order:
Center, L1, L2, L3, R1, R2, R3, R4
BFS will iterate the nodes in the order:
Center, L1, R1, R1, R2, L3, R3, R4
Attributes
- See also:
RepeatTraversalTests for more detail and examples for all of the above.
- Note:
this works for domain-specific steps as well as generic graph steps - for details please take a look at the examples in RepeatTraversalTests: both '''.followedBy''' and '''.out''' work.
- Example:
.repeat(_.out) // repeat until there's no more elements, emit nothing, use DFS .repeat(_.out)(_.maxDepth(3)) // perform exactly three repeat iterations .repeat(_.out)(_.until(_.property(Name).endsWith("2"))) // repeat until the 'Name' property ends with '2' .repeat(_.out)(_.emit) // emit everything along the way .repeat(_.out)(_.emit.breadthFirstSearch) // emit everything, use BFS .repeat(_.out)(_.emit(_.property(Name).startsWith("L"))) // emit if the 'Name' property starts with 'L'
perform side effect without changing the contents of the traversal
perform side effect without changing the contents of the traversal
Attributes
perform side effect without changing the contents of the traversal
will only apply the partialFunction if it is defined for the given input - analogous to collect
perform side effect without changing the contents of the traversal
will only apply the partialFunction if it is defined for the given input - analogous to collect
Attributes
Removes all results whose traversal path has repeated objects. prerequisite:
Removes all results whose traversal path has repeated objects. prerequisite:
enablePathTracking
Attributes
sort elements by the value of the given transformation function
sort elements by the value of the given transformation function
Attributes
sort elements by their natural order
sort elements by their natural order
Attributes
Attributes
- Definition Classes
- IterableOps
Execute the traversal and convert the result to an immutable Set
Execute the traversal and convert the result to an immutable Set
Attributes
Execute the traversal and return a mutable.Set (better performance than immutableSet
)
Execute the traversal and return a mutable.Set (better performance than immutableSet
)
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns:
a string representation of the object.
- Definition Classes
- Any
union step from the current point
union step from the current point
Attributes
- traversals
to be executed from here, results are being aggregated/summed/unioned
- Example:
.union(_.out, _.in)
only preserves elements if the provided traversal has at least one result
only preserves elements if the provided traversal has at least one result
Attributes
only preserves elements if the provided traversal does not have any results
only preserves elements if the provided traversal does not have any results
Attributes
filters out all elements that are not in the provided set
filters out all elements that are not in the provided set
Attributes
Inherited methods
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- IterableFactoryDefaults -> IterableOps
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Definition Classes
- IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Deprecated and Inherited methods
Attributes
- Deprecated
[Since version 2.13.0]
Use ++ instead of ++: for collections of type Iterable- Inherited from:
- IterableOps
Attributes
- Deprecated
[Since version 2.13.0]
Use foldLeft instead of /:- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
Use foldRight instead of :\\- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
Use iterableFactory instead- Inherited from:
- IterableOps
Attributes
- Deprecated
[Since version 2.13.0]
Use `dest ++= coll` instead- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
Use coll instead of repr in a collection implementation, use the collection value itself from the outside- Inherited from:
- IterableOps
Attributes
- Deprecated
[Since version 2.13.0]
Use .iterator instead of .toIterator- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream- Inherited from:
- IterableOnceOps
Attributes
- Deprecated
[Since version 2.13.0]
toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections- Inherited from:
- IterableOps
Attributes
- Deprecated
[Since version 2.13.0]
Use .view.slice(from, until) instead of .view(from, until)- Inherited from:
- IterableOps