REST::Neo4p::Constraint::Relationship - Neo4j Relationship Constraints
# use REST::Neo4p::Constrain, it's nicer $rc = REST::Neo4p::Constraint::Relationship->new( 'allowed_contains_relns' => { _condition => 'only', _relationship_type => 'contains', _priority => 0, _descriptors => [ {'module' => 'method'}, {'module' => 'variable'}, {'method' => 'variable'} ] } );
REST::Neo4p::Constraint::Relationship is a class that represents constraints on the type and direction of relationships between nodes that satisfy given sets of property constraints.
REST::Neo4p::Constraint::Relationship
Constraint hash specification:
{ _condition => <'only'|'none'>, _relationship_type => <relationship_typename>, _priority => <integer priority>, _descriptors => [{ property_constraint_tag => property_constraint_tag },...] } }
$rc = $REST::Neo4p::Constraint::Relationship->new( $tag => $constraint_hash );
$rc->add_constraint( { 'star' => 'planet' });
$rc->remove_constraint( { 'developer' => 'parole_officer' } );
Returns the constraint tag.
Returns the constraint type ('relationship').
The relationship type to which this constraint applies.
Returns the internal constraint spec hashref.
Constraints with higher priority will be checked before constraints with lower priority by validate_relationship().
validate_relationship()
$r->set_condition('only');
Get/set 'only' or 'none' for a given relationship constraint. See REST::Neo4p::Constrain.
$c->validate( $relationship_object ); $c->validate( $node_object1 => $node_object2, $reln_type ); $c->validate( { name => 'Steve', instrument => 'banjo' } => { name => 'Marcia', instrument => 'blunt' }, 'avoids' );
Returns true if the item meets the constraint, false if not.
REST::Neo4p, REST::Neo4p::Node, REST::Neo4p::Relationship, REST::Neo4p::Constraint, REST::Neo4p::Constraint::Relationship, REST::Neo4p::Constraint::RelationshipType.
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.