Example request
POST
http://localhost:7474/db/data/node
Accept:
application/json
Example response
201:
Created
Content-Type:
application/json
Location:
http://localhost:7474/db/data/node/9
{ "extensions" : { }, "outgoing_relationships" : "http://localhost:7474/db/data/node/9/relationships/out", "labels" : "http://localhost:7474/db/data/node/9/labels", "all_typed_relationships" : "http://localhost:7474/db/data/node/9/relationships/all/{-list|&|types}", "traverse" : "http://localhost:7474/db/data/node/9/traverse/{returnType}", "self" : "http://localhost:7474/db/data/node/9", "property" : "http://localhost:7474/db/data/node/9/properties/{key}", "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/9/relationships/out/{-list|&|types}", "properties" : "http://localhost:7474/db/data/node/9/properties", "incoming_relationships" : "http://localhost:7474/db/data/node/9/relationships/in", "create_relationship" : "http://localhost:7474/db/data/node/9/relationships", "paged_traverse" : "http://localhost:7474/db/data/node/9/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships" : "http://localhost:7474/db/data/node/9/relationships/all", "incoming_typed_relationships" : "http://localhost:7474/db/data/node/9/relationships/in/{-list|&|types}", "data" : { } }
Example request
POST
http://localhost:7474/db/data/node
Accept:
application/json
Content-Type:
application/json
{ "foo" : "bar" }
Example response
201:
Created
Content-Length:
1156
Content-Type:
application/json
Location:
http://localhost:7474/db/data/node/5
{ "extensions" : { }, "outgoing_relationships" : "http://localhost:7474/db/data/node/5/relationships/out", "labels" : "http://localhost:7474/db/data/node/5/labels", "all_typed_relationships" : "http://localhost:7474/db/data/node/5/relationships/all/{-list|&|types}", "traverse" : "http://localhost:7474/db/data/node/5/traverse/{returnType}", "self" : "http://localhost:7474/db/data/node/5", "property" : "http://localhost:7474/db/data/node/5/properties/{key}", "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/5/relationships/out/{-list|&|types}", "properties" : "http://localhost:7474/db/data/node/5/properties", "incoming_relationships" : "http://localhost:7474/db/data/node/5/relationships/in", "create_relationship" : "http://localhost:7474/db/data/node/5/relationships", "paged_traverse" : "http://localhost:7474/db/data/node/5/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships" : "http://localhost:7474/db/data/node/5/relationships/all", "incoming_typed_relationships" : "http://localhost:7474/db/data/node/5/relationships/in/{-list|&|types}", "data" : { "foo" : "bar" } }
Note that the response contains URI/templates for the available operations for getting properties and relationships.
Example request
GET
http://localhost:7474/db/data/node/3
Accept:
application/json
Example response
200:
OK
Content-Type:
application/json
{ "extensions" : { }, "outgoing_relationships" : "http://localhost:7474/db/data/node/3/relationships/out", "labels" : "http://localhost:7474/db/data/node/3/labels", "all_typed_relationships" : "http://localhost:7474/db/data/node/3/relationships/all/{-list|&|types}", "traverse" : "http://localhost:7474/db/data/node/3/traverse/{returnType}", "self" : "http://localhost:7474/db/data/node/3", "property" : "http://localhost:7474/db/data/node/3/properties/{key}", "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/3/relationships/out/{-list|&|types}", "properties" : "http://localhost:7474/db/data/node/3/properties", "incoming_relationships" : "http://localhost:7474/db/data/node/3/relationships/in", "create_relationship" : "http://localhost:7474/db/data/node/3/relationships", "paged_traverse" : "http://localhost:7474/db/data/node/3/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships" : "http://localhost:7474/db/data/node/3/relationships/all", "incoming_typed_relationships" : "http://localhost:7474/db/data/node/3/relationships/in/{-list|&|types}", "data" : { } }
Example request
GET
http://localhost:7474/db/data/node/700000
Accept:
application/json
Example response
404:
Not Found
Content-Type:
application/json
{ "message": "Cannot find node with id [700000] in database.", "exception": "NodeNotFoundException", "fullname": "org.neo4j.server.rest.web.NodeNotFoundException", "stacktrace": [ "org.neo4j.server.rest.web.DatabaseActions.node(DatabaseActions.java:167)", "org.neo4j.server.rest.web.DatabaseActions.getNode(DatabaseActions.java:228)", "org.neo4j.server.rest.web.RestfulGraphDatabase.getNode(RestfulGraphDatabase.java:255)", "java.lang.reflect.Method.invoke(Method.java:597)" ] }
Example request
DELETE
http://localhost:7474/db/data/node/6
Accept:
application/json
Example response
204:
No Content
The relationships on a node has to be deleted before the node can be deleted.
Example request
DELETE
http://localhost:7474/db/data/node/13
Accept:
application/json
Example response
409:
Conflict
Content-Type:
application/json
{ "message": "The node with id 13 cannot be deleted. Check that the node is orphaned before deletion.", "exception": "OperationFailureException", "fullname": "org.neo4j.server.rest.web.OperationFailureException", "stacktrace": [ "org.neo4j.server.rest.web.DatabaseActions.deleteNode(DatabaseActions.java:249)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteNode(RestfulGraphDatabase.java:269)", "java.lang.reflect.Method.invoke(Method.java:597)" ] }
Copyright © 2013 Neo Technology