NAME
Net::Rexster::Client - Handle Rexster REST request and response
VERSION
This document describes Net::Rexster version 0.0.5
SYNOPSIS
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);
DESCRIPTION
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.
INTERFACE
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_graphs()
get all the graphs
get_graph($graph_name)
get the graph named
get_all_vertices()
get all vertices
lookup_vertex($key, $value)
get all vertices for a key index given the specified
get_vertex($id)
get vertex with id
outV($id)
get the adjacent out vertices of vertex
inV($id)
get the adjacent in vertices of vertex
bothV()
get the both adjacent in and out vertices of vertex
outVcount($id)
get the number of out vertices of vertex
inVcount($id)
get the number of in vertices of vertex
bothVcount($id)
get the number of adjacent in and out vertices of vertex
outIds($id)
get the identifiers of out vertices of vertex
inIds($id)
get the identifiers of in vertices of vertex
bothIds($id)
get the identifiers of adjacent in and out vertices of vertex
get_all_edges()
get all edges
lookup_edges($key, $value)
get all edges for a key index given the specified
get_edge($id)
get edge with id
outE($id)
get the out edges of vertex
inE($id)
get the in edges of vertex
bothE($id)
get the both in and out edges of vertex
get_indices()
get all the indices associated with the graph
lookup_index($index, $key, $value)
get all elements with $key property equal to $value in $index
index_count($key, $value)
get a count of all elements with $key property equal to $value in index
create_vertex($id)
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_vertex_property($id, { $key1 => $value1,,, })
create a vertex with $id and the provided properties (or update vertex properties if vertex already exists).
create_edge($id1, $label, $id2)
create an out edge with no specified identifier from vertex <id> to vertex 2 labeled “friend” with provided properties.
create_edge_property($id, {$key1 => $value1,,,})
create the properties of the edge with id
create_index($index)
create a new manual index named $index
replace_vertex_property($id, {$key1 => $value1,,,})
replaces the all existing properties of the vertex $id with those specified
replace_edge_property($id, {$key1 => $value1,,,})
replaces the all existing properties of the edge $id with those specified
put_vertex_to_index($vertex_id, $index, $key, $value)
put vertex with $id into index at $key/$value
delete_vertex($id)
remove vertex $id
delete_vertex_property($id, [$key1,$key2,,,])
remove properties keys from vertex $id
delete_edge($id)
remove the edge with $id
delete_edge_property($id, [$key1,$key2,,,])
remove properties keys from edge
delete_index($index)
drop the index named $index
delete_vertex_from_index($id, $index, $key, $value)
remove the vertex $id from $index at $key/$value
CONFIGURATION AND ENVIRONMENT
Net::Rexster requires no configuration files or environment variables.
BUGS AND LIMITATIONS
No bugs have been reported.
AUTHOR
Shohei Kameda <shoheik@cpan.org>
LICENCE AND COPYRIGHT
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.
DISCLAIMER OF WARRANTY
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:
- Around line 545:
Non-ASCII character seen before =encoding in '“friend”'. Assuming UTF-8