EdgeTraversalBuilder

lightdb.traverse.EdgeTraversalBuilder
case class EdgeTraversalBuilder[E <: EdgeDocument[E, F, T], F <: Document[F], T <: Document[T]](fromIds: Stream[Id[F]], tx: PrefixScanningTransaction[E, _], maxDepth: Int, edgeFilter: E => Boolean, strategy: TraversalStrategy)

Builder for edge traversals

Value parameters

fromIds

The stream of document IDs to start the traversal from

maxDepth

The maximum traversal depth

tx

A transaction that supports prefix scanning for the edge type

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def documents(docTx: Transaction[T, _]): Stream[T]

Get the stream of target documents

Get the stream of target documents

Value parameters

docTx

A transaction for retrieving target documents

Attributes

Returns

A stream of target documents

def edges: Stream[E]

Get the stream of edge documents

Get the stream of edge documents

Attributes

Returns

A stream of edge documents

def filter(predicate: E => Boolean): EdgeTraversalBuilder[E, F, T]

Configure edge filtering

Configure edge filtering

Value parameters

predicate

A predicate function to filter edges

Attributes

def findPaths(target: Id[T]): Stream[TraversalPath[E, F, T]]

Find all paths to a target node

Find all paths to a target node

Value parameters

target

The ID of the target node

Attributes

Returns

A stream of paths to the target node

def findShortestPath(target: Id[T]): Stream[TraversalPath[E, F, T]]

Find the shortest path to a target node

Find the shortest path to a target node

Value parameters

target

The ID of the target node

Attributes

Returns

A stream containing the shortest path to the target node, if any

def follow[E2 <: EdgeDocument[LazyRef(...), T, T2], T2 <: Document[LazyRef(...)]](nextTx: PrefixScanningTransaction[E2, _]): EdgeTraversalBuilder[E2, T, T2]

Follow additional edges from the targets of the current traversal

Follow additional edges from the targets of the current traversal

Type parameters

E2

The next edge document type

T2

The next target document type

Value parameters

nextTx

A transaction that supports prefix scanning for the next edge type

Attributes

Returns

A builder for the next edge traversal

def targetIds(implicit ev: F =:= T): Stream[Id[T]]

Get the stream of target document IDs

Get the stream of target document IDs

Attributes

Returns

A stream of target document IDs

def using(traversalStrategy: TraversalStrategy): EdgeTraversalBuilder[E, F, T]

Configure traversal strategy

Configure traversal strategy

Value parameters

traversalStrategy

The traversal strategy to use

Attributes

def withMaxDepth(depth: Int): EdgeTraversalBuilder[E, F, T]

Configure the maximum traversal depth

Configure the maximum traversal depth

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product