REST::Neo4p::Relationship - Neo4j relationship object
$n1 = REST::Neo4p::Node->new( {name => 'Harry'} ) $n2 = REST::Neo4p::Node->new( {name => 'Sally'} ); $r1 = $n1->relate_to($n2, 'met'); $r1->set_property({ when => 'July' });
REST::Neo4p::Relationship objects represent Neo4j relationships.
REST::Neo4p::Relationship
$r1 = REST::Neo4p::Relationship->new($node1, $node2, 'ingratiates');
Creates the relationship given by the scalar third argument between the first argument and second argument, both REST::Neo4p::Node objects.
REST::Neo4p::Node
$name = $node->get_property('name'); @vitals = $node->get_property( qw( height weight bp temp ) );
Get the values of properties on nodes and relationships.
$name = $node->set_property( {name => "Sun Tzu", occupation => "General"} ); $node1->relate_to($node2,"is_pal_of")->set_property( {duration => 'old pal'} );
Sets values of properties on nodes and relationships.
$props = $relationship->get_properties; print "'Sup, Al." if ($props->{name} eq 'Al');
Get all the properties of a node or relationship as a hashref.
$rel = $node->relate_to($node2, 'my_type'); print "This is my_type of relationship" if $rel->type eq 'my_type';
Gets a relationship's type.
See "Property Auto-accessors" in REST::Neo4p.
REST::Neo4p, REST::Neo4p::Node, REST::Neo4p::Index.
Mark A. Jensen CPAN ID: MAJENSEN majensen -at- cpan -dot- org
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.
To install REST::Neo4p, copy and paste the appropriate command in to your terminal.
cpanm
cpanm REST::Neo4p
CPAN shell
perl -MCPAN -e shell install REST::Neo4p
For more information on module installation, please visit the detailed CPAN module installation guide.