Mark Allen Jensen > REST-Neo4p-0.2012 > REST::Neo4p::Path

Download:
REST-Neo4p-0.2012.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  4
Stalled  1
View/Report Bugs
Module Version: 0.2001   Source   Latest Release: REST-Neo4p-0.3004

NAME ^

REST::Neo4p::Path - Container for Neo4j path elements

SYNOPSIS ^

  use REST::Neo4p::Query;
  $query = REST::Neo4p::Query->new(
    'START n=node(0), m=node(1) MATCH p=(n)-[*..3]->(m) RETURN p'
  );
  $query->execute;
  $path = $query->fetch->[0];
  @nodes = $path->nodes;
  @relns = $path->relationships;
  while ($n = shift @nodes) {
    my $r = shift @relns;
    print $r ? $n->id."-".$r->id."->" : $n->id."\n";
  }

DESCRIPTION ^

REST::Neo4p::Path provides a simple container for Neo4j paths as returned by Cypher queries. Nodes and relationships are stored in path order.

Currently, creating de novo instances of this class is really the job of REST::Neo4p::Query.

METHODS ^

nodes()
 @nodes = $path->nodes;

Get the nodes in path order.

relationships()
 @relationships = $path->relationships;

Get the relationships in path order.

SEE ALSO ^

REST::Neo4p, REST::Neo4p::Node, REST::Neo4p::Relationship, REST::Neo4p::Query.

AUTHOR ^

   Mark A. Jensen
   CPAN ID: MAJENSEN
   majensen -at- cpan -dot- org

LICENSE ^

Copyright (c) 2012 Mark A. Jensen. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: