-
Notifications
You must be signed in to change notification settings - Fork 0
Rexster Graph Server
Rexster exposes any Titan graph database via a JSON-based REST interface and a binary protocol called RexPro. Provided and custom algorithms (called Kibbles) can be stored on the server, triggered via HTTP, and their results returned via JSON. Finally, Rexster provides an administration and visualization interface that can be accessed from most major web browsers. Titan packages Rexster in Titan Server which makes setup and deployment easy. Note that Titan Server does not provide any GUI interfaces.
The following is a list of the benefits of using Rexster.
-
JSON-based REST interface ensures language agnostic connectivity to Titan.
- See Bulbs or thunderdome for a Python connector.
- HTML/JavaScript graphical user interface for graph administration and visualization.
- Extend with more RESTful endpoints by adding kibbles to Rexster.
- See Rexster-Kibbles provided by TinkerPop.
- Remote Gremlin traversals via the Gremlin extensions and the Rexster console.
- Security support via user authentification.
If not using Titan Server, Rexster must first be downloaded. Rexster can be downloaded at this location. Below is a snippet of shell commands that demonstrate the process for getting Rexster downloaded and started using a default configuration.
$ curl -O -L http://tinkerpop.com/downloads/rexster/rexster-server-x.y.z.zip > rexster-server-x.y.z.zip
% Total % Received % Xferd Average Speed Time Time Time Current ...
...
$ unzip rexster-server-x.y.z.zip
Archive: rexster-server-x.y.z.zip
creating: rexster-server-x.y.z/
...
$ cd rexster-server-x.y.z
$ ./rexster-server.sh --start
Validate that it is working by opening a browser and navigating to http://localhost:8182
which should present a Rexster landing page with links to the root of the REST API and to the Dog House.
Use CTRL-C
to kill the server. Now that Rexster is downloaded and verified to be working, it is necessary to configure Rexster to work with Titan.
This section explains how to configure Rexster to use a Titan graph database (see also Rexster’s Getting Started page).
PREREQUISITE: These instructions assume that a graph has been created in Titan as described in the “Loading Data Into Titan” section of the Getting Started page.
Edit the REXSTER_HOME/rexster.xml
and include the Titan configuration portion in the graphs
section (see Rexster Configuration).
<?xml version="1.0" encoding="UTF-8"?>
<rexster>
...
<graphs>
<graph>
<graph-name>titanexample</graph-name>
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location>/tmp/titan</graph-location>
<graph-read-only>false</graph-read-only>
<properties>
<storage.backend>local</storage.backend>
<storage.buffer-size>100</storage.buffer-size>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
</graphs>
</rexster>
Rexster’s graph-location option is equivalent to Titan’s storage.directory. In the event that Titan is being configured for “local” mode, please make sure that this value is an existing directory. All other Titan specific configurations are subsumed under properties. In the example above, the backend and the buffer size are configured. Any of the Titan configurations can be used here.
Rexster needs to have Titan and its related library dependencies made available to it. Rexster has an ext
directory where extensions and other related libraries can be put on Rexster’s path for deployment. All files in the root of that directory and sub-directories will be added to Rexster’s classpath.
To add Titan to Rexster, first make a directory as in:
mkdir REXSTER_HOME/ext/titan
Then, if building Titan from source:
cp TITAN_HOME/target/titan-x.y.z-standalone/lib/*.* REXSTER_HOME/ext/titan
or, if using the Titan zipped distribution download:
cp TITAN_HOME/lib/*.* REXSTER_HOME/ext/titan
NOTE: Future releases (beyond the 0.2) will have a much more efficient/easier packaging model.
Start Rexster with:
rexster$ bin/rexster.sh -s -c rexster.xml
Access the Titan graph at the following URI:
http://localhost:8182/graphs/titanexample
NOTE – For those using ElasticSearch, Rexster includes lucene-core-3.5.0.jar (a neo4j dependency). Assuming Neo4j is not being utilized in the Rexster instance, simply delete that file from the rexster lib
directory. Removing it will eliminate a conflict with Titan and allow ElasticSearch to start.
Rexster has a rich API for working with Blueprints Graph implementations, but there are some limitations to consider when using Rexster with Titan:
- Titan automatically assigns identifiers. Hence, the POST of an edge cannot be done with an identifier. In other words, POST to this:
http://localhost/graphs/titan/edges
and not to thishttp://localhost/graphs/titan/edges/1234
. - Titan uses key indices and does not support manual indices. Hence, all operations on the
indices
resource are not supported. Use key indexes instead.