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/166
{ "outgoing_relationships" : "http://localhost:7474/db/data/node/166/relationships/out", "data" : { }, "traverse" : "http://localhost:7474/db/data/node/166/traverse/{returnType}", "all_typed_relationships" : "http://localhost:7474/db/data/node/166/relationships/all/{-list|&|types}", "property" : "http://localhost:7474/db/data/node/166/properties/{key}", "self" : "http://localhost:7474/db/data/node/166", "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/166/relationships/out/{-list|&|types}", "properties" : "http://localhost:7474/db/data/node/166/properties", "incoming_relationships" : "http://localhost:7474/db/data/node/166/relationships/in", "extensions" : { }, "create_relationship" : "http://localhost:7474/db/data/node/166/relationships", "paged_traverse" : "http://localhost:7474/db/data/node/166/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships" : "http://localhost:7474/db/data/node/166/relationships/all", "incoming_typed_relationships" : "http://localhost:7474/db/data/node/166/relationships/in/{-list|&|types}" }
Example request
POST
http://localhost:7474/db/data/node
Accept:
application/json
Content-Type:
application/json
{"foo" : "bar"}
Example response
201:
Created
Content-Length:
1120
Content-Type:
application/json
Location:
http://localhost:7474/db/data/node/167
{ "outgoing_relationships" : "http://localhost:7474/db/data/node/167/relationships/out", "data" : { "foo" : "bar" }, "traverse" : "http://localhost:7474/db/data/node/167/traverse/{returnType}", "all_typed_relationships" : "http://localhost:7474/db/data/node/167/relationships/all/{-list|&|types}", "property" : "http://localhost:7474/db/data/node/167/properties/{key}", "self" : "http://localhost:7474/db/data/node/167", "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/167/relationships/out/{-list|&|types}", "properties" : "http://localhost:7474/db/data/node/167/properties", "incoming_relationships" : "http://localhost:7474/db/data/node/167/relationships/in", "extensions" : { }, "create_relationship" : "http://localhost:7474/db/data/node/167/relationships", "paged_traverse" : "http://localhost:7474/db/data/node/167/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships" : "http://localhost:7474/db/data/node/167/relationships/all", "incoming_typed_relationships" : "http://localhost:7474/db/data/node/167/relationships/in/{-list|&|types}" }
<p/> 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
{ "outgoing_relationships" : "http://localhost:7474/db/data/node/3/relationships/out", "data" : { }, "traverse" : "http://localhost:7474/db/data/node/3/traverse/{returnType}", "all_typed_relationships" : "http://localhost:7474/db/data/node/3/relationships/all/{-list|&|types}", "property" : "http://localhost:7474/db/data/node/3/properties/{key}", "self" : "http://localhost:7474/db/data/node/3", "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", "extensions" : { }, "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}" }
Example request
GET
http://localhost:7474/db/data/node/800000
Accept:
application/json
Example response
404:
Not Found
Content-Type:
application/json
{ "message" : "Cannot find node with id [800000] in database.", "exception" : "org.neo4j.server.rest.web.NodeNotFoundException: Cannot find node with id [800000] in database.", "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.node(DatabaseActions.java:124)", "org.neo4j.server.rest.web.DatabaseActions.getNode(DatabaseActions.java:235)", "org.neo4j.server.rest.web.RestfulGraphDatabase.getNode(RestfulGraphDatabase.java:225)", "java.lang.reflect.Method.invoke(Method.java:597)" ] }
Example request
DELETE
http://localhost:7474/db/data/node/175
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/176
Accept:
application/json
Example response
409:
Conflict
Content-Type:
application/json
{ "message" : "The node with id 176 cannot be deleted. Check that the node is orphaned before deletion.", "exception" : "org.neo4j.server.rest.web.OperationFailureException: The node with id 176 cannot be deleted. Check that the node is orphaned before deletion.", "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.deleteNode(DatabaseActions.java:256)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteNode(RestfulGraphDatabase.java:239)", "java.lang.reflect.Method.invoke(Method.java:597)" ] }
Copyright © 2012 Neo Technology