NAME
REST::Neo4p::Node - Neo4j node object
SYNOPSIS
$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' });
DESCRIPTION
REST::Neo4p::Node
objects represent Neo4j nodes.
METHODS
- new()
-
$node = REST::Neo4p::Node->new(); $node_with_properties = Rest::Neo4p::Node( \%props );
Instantiates a new Node object and creates corresponding node in the database.
- remove()
-
$node->remove()
Removes a node from the database and destroys the object.
- get_property()
-
$name = $node->get_property('name'); @vitals = $node->get_property( qw( height weight bp temp ) );
Get the values of properties on nodes and relationships.
- set_property()
-
$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.
- get_properties()
-
$props = $relationship->get_properties; print "'Sup, Al." if ($props->{name} eq 'Al');
Get all the properties of a node or relationship as a hashref.
- relate_to()
-
$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.
- get_relationships()
-
@all_relationships = $node1->get_relationships()
Get all incoming and outgoing relationships of a node. Returns array of REST::Neo4p::Relationship objects;
- get_incoming_relationships()
-
@incoming_relationships = $node1->get_incoming_relationships();
- get_outgoing_relationships()
-
@outgoing_relationships = $node1->get_outgoing_relationships();
- property auto-accessors
SEE ALSO
REST::Neo4p, REST::Neo4p::Relationship, REST::Neo4p::Index.
AUTHOR
Mark A. Jensen
CPAN ID: MAJENSEN
TCGA DCC
mark -dot- jensen -at- nih -dot- gov
http://tcga-data.nci.nih.gov
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.