Database Reference
In-Depth Information
ing care of some of the more mundane low-level REST mappings. Using one of the appro-
priate remote API libraries (listed in section 10.3.4 ) could help immensely in this regard.
Curl and Java Client Examples
This chapter provides examples using two different clients:
• The curl command available in most Unix distributions. This client will demon-
strate how to make calls directly to the low-level REST API.
• A Java client using the official Neo4j Java REST binding ( neo4j-rest-
graphdb ) for the server REST API. This option shows how a remote client lib-
rary can be used to simplify coding against the Neo4j REST API.
Again, if you're using Maven, the following snippet can be added to your pom.xml file to
pull the appropriate libraries in:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-rest-graphdb</artifactId>
<version>2.0.1</version>
</dependency>
10.3.2. Using the fine-grained Neo4j server REST API
The original fine-grained Neo4j REST API was designed from the ground up to be hy-
permedia driven and to be able to be “discovered” as you make use of its various aspects.
Each request results in only the minimal amount of information being returned, with em-
bedded links providing the mechanism for obtaining more information. The starting URL
from which all parts of the REST API can be explored or derived is http://<domain-
name>:<port>/db/data. This is sometimes referred to as the service root . Thus a Neo4j
server running on the local host, on the default port 7474, would have a service root entry
point of http://localhost:7474/db/data.
The following listing shows an example of the data used in a request and the associated
response for the service root, highlighting some aspects to give you a feel for the discover-
able nature of the API.
 
Search WWH ::




Custom Search