REST::Neo4p::Node - Neo4j node object
$n1 = $REST::Neo4p::Node->new( {name => 'Ferb'} ) $n2 = $REST::Neo4p::Node->new( {name => 'Phineas'} ); $n3 = $REST::Neo4p::Node->new( {name => 'Perry'} ); $n1->relate_to($n2, 'brother'); $n3->relate_to($n1, 'pet'); $n3->set_property({ species => 'Ornithorhynchus anatinus' });
REST::Neo4p::Node objects represent Neo4j nodes.
REST::Neo4p::Node
$node = REST::Neo4p::Node->new(); $node_with_properties = Rest::Neo4p::Node( \%props );
Instantiates a new Node object and creates corresponding node in the database.
$node->remove()
Removes a node from the database and destroys the object.
$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.
$relationship = $node1->relate_to($node2, 'manager');
Set a relationship between two nodes and returns the REST::Neo4p::Relationship thus created. Call on the "from" node, first argument is the "to" node, second argument is the relationship type.
@all_relationships = $node1->get_relationships()
Get all incoming and outgoing relationships of a node. Returns array of REST::Neo4p::Relationship objects;
@incoming_relationships = $node1->get_incoming_relationships();
@outgoing_relationships = $node1->get_outgoing_relationships();
See "Property Auto-accessors" in REST::Neo4p.
REST::Neo4p, REST::Neo4p::Relationship, REST::Neo4p::Index.
Mark A. Jensen CPAN ID: MAJENSEN TCGA DCC mark -dot- jensen -at- nih -dot- gov http://tcga-data.nci.nih.gov
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.