Net::Rexster::Client - Handle Rexster REST request and response
This document describes Net::Rexster version 0.0.2
use Net::Rexster::Client; use Data::Dumper; my $c = new Net::Rexster::Client(graph => "testdb", server => 'http://localhost:8182'); # Create vertices and get the id $id1 = $c->create_vertex->{_id}; $id2 = $c->create_vertex->{_id}; # Add property. $c->create_vertex_property($id1, { 'dateOfBirth' => 'Dec 26' }); # Create edge with label, friend $c->create_edge($id1, "friend", $id2); # See edge and vertices print Dumper $c->get_all_edges; print Dumper $c->get_all_vertices; # Delete the vertices $c->delete_vertex($id1); $c->delete_vertex($id2);
Rexster(https://github.com/tinkerpop/rexster/wiki) provides REST API for Blueprint graph(e.g. Neo4j, OrientDB..) This module covers the most of REST in hhttps://github.com/tinkerpop/rexster/wiki/Basic-REST-API so that REST can be called from Perl. GraphDB server as well as Rexter server need to be up to use this API.
All of the methods defined here return hash reference which converted form JSON response. As Net::Rexster::Client provides low level interface, please use Data::Dumper to check the contect of data.
get all the graphs
get the graph named
get all vertices
get all vertices for a key index given the specified
get vertex with id
get the adjacent out vertices of vertex
get the adjacent in vertices of vertex
get the both adjacent in and out vertices of vertex
get the number of out vertices of vertex
get the number of in vertices of vertex
get the number of adjacent in and out vertices of vertex
get the identifiers of out vertices of vertex
get the identifiers of in vertices of vertex
get the identifiers of adjacent in and out vertices of vertex
get all edges
get all edges for a key index given the specified
get edge with id
get the out edges of vertex
get the in edges of vertex
get the both in and out edges of vertex
get all the indices associated with the graph
get all elements with $key property equal to $value in $index
get a count of all elements with $key property equal to $value in index
create a vertex with no specified identifier. Note some graphDB doesn't support the arrument $id. If it's not supported, the new $id is created automatically by DB server.
create a vertex with $id and the provided properties (or update vertex properties if vertex already exists).
create an out edge with no specified identifier from vertex <id> to vertex 2 labeled “friend” with provided properties.
create the properties of the edge with id
create a new manual index named $index
replaces the all existing properties of the vertex $id with those specified
replaces the all existing properties of the edge $id with those specified
put vertex with $id into index at $key/$value
remove vertex $id
remove properties keys from vertex $id
remove the edge with $id
remove properties keys from edge
drop the index named $index
remove the vertex $id from $index at $key/$value
Net::Rexster requires no configuration files or environment variables.
No bugs have been reported.
Shohei Kameda <shoheik@cpan.org>
<shoheik@cpan.org>
Copyright (c) 2012, Shohei Kameda <shoheik@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '“friend”'. Assuming UTF-8
To install Net::Rexster::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Rexster::Client
CPAN shell
perl -MCPAN -e shell install Net::Rexster::Client
For more information on module installation, please visit the detailed CPAN module installation guide.