Path

Represents a sequence of alternating nodes and relationships corresponding to a walk in a labeled property graph.

A path of length L consists of L + 1 nodes indexed from 0 to L, and L unbound relationships, indexed from 0 to L - 1. Each relationship has a direction. A relationship is said to be reversed if it was traversed in the direction opposite of the direction of the underlying relationship in the data graph.

Constructors

this
this(Path other)

Create a shallow copy of other path.

this
this(Value value)

Create a path from a Value.

this
this(mg_path* ptr)

Create a Path using the given mg_path pointer.

Members

Functions

getNodeAt
auto getNodeAt(uint index)

Returns the vertex at the given index. index should be less than or equal to length of the path.

getRelationshipAt
auto getRelationshipAt(uint index)

Returns the edge at the given index. index should be less than length of the path.

isReversedRelationshipAt
auto isReversedRelationshipAt(uint index)

Returns the orientation of the edge at the given index. index should be less than length of the path. Return: True if the edge is reversed, false otherwise.

length
auto length()

Returns the path length. Length of the path is number of edges.

opEquals
auto opEquals(Path other)

Compares this path with other. Return: true if same, false otherwise.

ptr
auto ptr()

Return pointer to internal mg_path.

toHash
size_t toHash()

Return the hash code for this path.

toString
string toString()

Return a printable string representation of this path.

Meta