Neo4j::Bolt::Path - Representation of a Neo4j Path
$q = 'MATCH p=(n1)-[r]->(n2) RETURN p'; $path = ( $cxn->run_query($q)->fetch_next )[0]; ($n1, $r, $n2) = @$path; @nodes = grep { ref eq 'Neo4j::Bolt::Node' } @$path; @relationships = grep { ref eq 'Neo4j::Bolt::Relationship' } @$path; $start_node = $path->[0]; $end_node = $path->[@$path - 1]; $length = @$path >> 1; # number of relationships $arrayref = $path->as_simple;
Neo4j::Bolt::Path instances are created by executing a Cypher query that returns paths from a Neo4j database. Their nodes, relationships and metadata can be accessed as shown in the synopsis above.
If a query returns the same path twice, two separate Neo4j::Bolt::Path instances will be created.
$simple = $path->as_simple;
Get path as a simple arrayref in the style of REST::Neo4p.
The simple arrayref is unblessed, but is otherwise an exact duplicate of the Neo4j::Bolt::Path instance.
Neo4j::Bolt
Mark A. Jensen CPAN: MAJENSEN majensen -at- cpan -dot- org
This software is Copyright (c) 2019-2020 by Mark A. Jensen.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install Neo4j::Bolt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Neo4j::Bolt
CPAN shell
perl -MCPAN -e shell install Neo4j::Bolt
For more information on module installation, please visit the detailed CPAN module installation guide.