REST::Neo4p::Schema - Label-based indexes and constraints
REST::Neo4p->connect($server); $schema = REST::Neo4p::Schema->new; $schema->create_index('Person','name');
http://neo4j.org|Neo4j v2.0 provides a way to schematize the graph on the basis of node labels, associated indexes, and property uniqueness constraints. REST::Neo4p::Schema allows access to this system via the Neo4j REST API. Use a Schema object to create, list, and drop indexes and constraints.
REST::Neo4p::Schema
Schema
Note that as of v2.0.0, the Neo4j server can only create indexes on single properties within a label, and only uniqueness constraints on single properties. v2.0.1 is required for this module, which is dependent on a bug fix in that release.
$schema->create_index('Label', 'property'); $schema->create_index('Label', @properties);
The second example is convenience for creating multiple single indexes on each of a list of properties. It does not create a compound index on the set of properties. Returns TRUE.
@properties = $schema->get_indexes('Label');
Get a list properties on which an index exists for a given label.
$schema->drop_index('Label','property'); $schema->drop_index('Label', @properties);
Remove indexes on given property or properties for a given label.
$schema->create_unique_constraint('Label', 'property'); $schema->create_unique_constraint('Label', @properties);
Create uniqueness constraints on a given property or properties for a given label.
@properties = $schema->get_constraints('Label');
Get a list of properties for which (uniqueness) constraints exist for a given label.
$schema->drop_unique_constraint('Label', 'property'); $schema->drop_unique_constraint('Label', @properties);
Remove uniqueness constraints on given property or properties for a given label.
REST::Neo4p, REST::Neo4p::Index, REST::Neo4p::Query
Mark A. Jensen CPAN ID: MAJENSEN majensen -at- cpan -dot- org
Copyright (c) 2012-2014 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.