1
1
The Java binding for the Neo4j Server REST API wraps the REST calls behind the well known
2
- [ GraphDatabaseService] ( http://api.neo4j.org/1.2/org/neo4j/graphdb/GraphDatabaseService.html ) API.
2
+ [ GraphDatabaseService] ( http://api.neo4j.org/1.8.M07/org/neo4j/graphdb/GraphDatabaseService.html ) API.
3
+
4
+ ** Please note** , that the performance semantics are not the same, as most of these operations will cause a network
5
+ request to the server. Make sure to minimize the fine grained operations and rely more on cypher and traversals to get
6
+ your data and on batching and cypher to update the graph.
7
+
8
+ You can also use the ` RestAPIFacade ` directly to interact with your Neo4j-Server, without the GraphDatabaseService Wrapper.
9
+
10
+ Note
11
+ ----
12
+ The behavior of "transactions" changed in 1.8, in 1.7 they were no-op, i.e. just ignored. So you could just leave them off to not confuse people.
13
+
14
+ In 1.8 it tries to collect all operations within a tx as a batch-operation which will then be executed on the server.
15
+
16
+ This has the implication that the results retrieved within that "tx" are not immediately available but only after you called tx.success and tx.finish
17
+
18
+
3
19
4
20
Currently supports:
5
21
___________________
6
22
* all the node and relationship operations
7
- * the new Index API
8
- * Basic Http Auth (Digest)
9
- * preliminary traversal support
10
- * cypher, gremlin support
11
- * support for batch API
23
+ * [ cypher operations] ( http://docs.neo4j.org/chunked/milestone/rest-api-cypher.html )
24
+ * [ REST-batch operations] ( http://docs.neo4j.org/chunked/milestone/rest-api-batch-ops.html )
25
+ * Basic Http Auth (Digest) (Important for using [ Neo4j on Heroku] ( https://devcenter.heroku.com/articles/neo4j )
26
+ * index creation and index operations (add, get, query, delete)
27
+ * (Auto Index configuration)[ http://docs.neo4j.org/chunked/milestone/rest-api-configurable-auto-indexes.html ]
28
+ * limited [ traversal API] ( http://docs.neo4j.org/chunked/milestone/rest-api-traverse.html ) but with dynamic language support
12
29
* preliminary support for arbitrary server plugins and extensions
30
+ * gremlin support
13
31
14
- Open issues:
15
- ____________
16
- * full traversal support
17
-
18
32
Usage:
19
33
------
20
34
@@ -23,24 +37,21 @@ Build it locally. Then use the maven / ivy dependency or copy the jar into your
23
37
<dependency>
24
38
<groupId>org.neo4j</groupId>
25
39
<artifactId>neo4j-rest-graphdb</artifactId>
26
- <version>1.6.M02 </version>
40
+ <version>1.8.M07 </version>
27
41
</dependency>
28
42
29
43
GraphDatabaseService gds = new RestGraphDatabase("http://localhost:7474/db/data");
30
44
GraphDatabaseService gds = new RestGraphDatabase("http://localhost:7474/db/data",username,password);
31
45
46
+ // or using the RestAPI directly
47
+ RestAPI restAPI = new RestAPIFacade("http://localhost:7474/db/data",username,password);
48
+
49
+ // as a Spring Bean, e.g. in [Spring Data Neo4j](http://www.springsource.org/spring-data/neo4j)
32
50
<bean id="graphDbService" class="org.neo4j.rest.graphdb.RestGraphDatabase" destroy-method="shutdown">
33
51
<constructor-arg index="0" value="http://localhost:7474/db/data" />
34
52
</bean>
35
53
</pre>
36
54
37
- ** Please note: Transactions are not supported over this API.**
38
-
39
- Unit Test:
40
- ----------
41
- to start tests you will need the https://github.com/jexp/neo4j-clean-remote-db-addon to cleanup the database while
42
-
43
-
44
55
References / Community:
45
56
-----------------------
46
57
0 commit comments