13 Jun 2022 21:56:15 UTC
- Distribution: Neo4j-Driver
- Module version: 0.31
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (370 / 1 / 1)
- KwaliteeBus factor: 2
- 90.38% Coverage
- License: artistic_2
- Perl: v5.10.0
- Activity24 month
- Download (104.5KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- EXPERIMENTAL FEATURES
- SEE ALSO
- COPYRIGHT AND LICENSE
Neo4j::Driver::Type::Path - Directed sequence of relationships between two nodes
$q = "MATCH p=(a:Person)-[k:KNOWS]->(b:Person) RETURN p"; $path = $driver->session->run($q)->list->->get('p'); ($node_a, $node_b) = $path->nodes; ($relationship_k) = $path->relationships; ($a, $k, $b) = $path->elements;
A 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 be of length 0, 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.
@all = $path->elements;
@nodes = $path->nodes;
@rels = $path->relationships;
Neo4j::Driver::Type::Path implements the following experimental features. These are subject to unannounced modification or removal in future versions. Expect your code to break if you depend upon these features.
$count = $path->elements; $count = $path->nodes; $count = $path->relationships;
relationships()methods return the number of items if called in scalar context.
Until version 0.25, they
When paths are returned via HTTP JSON, the objects accessible via
relationships()lack meta data for their labels and types. This is due to an issue in the Neo4j server.
Equivalent documentation for the official Neo4j drivers: Path (Java)
Arne Johannessen <email@example.com>
This software is Copyright (c) 2016-2022 by Arne Johannessen.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Module Install Instructions
To install Neo4j::Driver, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Neo4j::Driver
For more information on module installation, please visit the detailed CPAN module installation guide.