18 Jan 2021 20:04:35 UTC
- Distribution: Neo4j-Types
- Module version: 1.00
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (2352 / 0 / 0)
- KwaliteeBus factor: 2
- 100.00% Coverage
- License: artistic_2
- Perl: v5.6.0
- Activity24 month
- Download (15.04KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- SEE ALSO
- COPYRIGHT AND LICENSE
Neo4j::Types::Path - Represents a directed sequence of relationships between two nodes
($node1, $rel, $node2) = $path->elements; ($node1, $node2) = $path->nodes; ($rel) = $path->relationships;
A Neo4j path is a directed sequence of relationships between two nodes. Its direction may be separate from that of the relationships traversed.
It is allowed to have zero length, meaning there are no relationships in it. In this case, it contains only a single node which is both the start and the end of the path.
Neo4j::Types::Path objects may be created by executing a Cypher statement against a Neo4j database server.
This module makes no assumptions about its internal data structure. While default implementations for all methods are provided, inheritors are free to override these according to their needs. The default implementations assume the data is stored in the format defined for Neo4j::Bolt::Path.
Neo4j::Types::Path implements the following methods.
@all = $path->elements;
Return the path as a list alternating between nodes and relationships in path sequence order.
@nodes = $path->nodes;
Return all nodes of this path.
The start node of this path is the first node in the list this method returns, the end node is the last one.
@nodes = $path->nodes; $start_node = $nodes; $end_node = $nodes[@nodes - 1];
@rels = $path->relationships;
Return all relationships of this path.
The length of a path is defined as the number of relationships.
@rels = $path->relationships; $length = scalar @rels;
The behaviour of the
relationships()methods when called in scalar context has not yet been defined.
Arne Johannessen <email@example.com>
This software is Copyright (c) 2021 by Arne Johannessen.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)