19.11. Relationship properties

Update relationship properties

Figure 19.42. Final Graph

Example request

  • PUT http://localhost:7474/db/data/relationship/69/properties
  • Accept: application/json; charset=UTF-8
  • Content-Type: application/json
{
  "jim" : "tobias"
}

Example response

  • 204: No Content

Remove properties from a relationship

Figure 19.43. Final Graph

Example request

  • DELETE http://localhost:7474/db/data/relationship/105/properties
  • Accept: application/json; charset=UTF-8

Example response

  • 204: No Content

Remove property from a relationship

See the example request below.

Figure 19.44. Starting Graph

Figure 19.45. Final Graph

Example request

  • DELETE http://localhost:7474/db/data/relationship/108/properties/cost
  • Accept: application/json; charset=UTF-8

Example response

  • 204: No Content

Remove non-existent property from a relationship

Attempting to remove a property that doesn’t exist results in an error.

Figure 19.46. Final Graph

Example request

  • DELETE http://localhost:7474/db/data/relationship/106/properties/non-existent
  • Accept: application/json; charset=UTF-8

Example response

  • 404: Not Found
  • Content-Type: application/json; charset=UTF-8
{
  "message": "Relationship[106] does not have a property \"non-existent\"",
  "exception": "NoSuchPropertyException",
  "fullname": "org.neo4j.server.rest.web.NoSuchPropertyException",
  "stacktrace": [
    "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:679)",
    "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:833)",
    "java.lang.reflect.Method.invoke(Method.java:606)",
    "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)",
    "java.lang.Thread.run(Thread.java:744)"
  ]
}

Remove properties from a non-existing relationship

Attempting to remove all properties from a relationship which doesn’t exist results in an error.

Figure 19.47. Final Graph

Example request

  • DELETE http://localhost:7474/db/data/relationship/1234/properties
  • Accept: application/json; charset=UTF-8

Example response

  • 404: Not Found
  • Content-Type: application/json; charset=UTF-8
{
  "exception": "RelationshipNotFoundException",
  "fullname": "org.neo4j.server.rest.web.RelationshipNotFoundException",
  "stacktrace": [
    "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:197)",
    "org.neo4j.server.rest.web.DatabaseActions.removeAllRelationshipProperties(DatabaseActions.java:669)",
    "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteAllRelationshipProperties(RestfulGraphDatabase.java:812)",
    "java.lang.reflect.Method.invoke(Method.java:606)",
    "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)",
    "java.lang.Thread.run(Thread.java:744)"
  ]
}

Remove property from a non-existing relationship

Attempting to remove a property from a relationship which doesn’t exist results in an error.

Figure 19.48. Final Graph

Example request

  • DELETE http://localhost:7474/db/data/relationship/1234/properties/cost
  • Accept: application/json; charset=UTF-8

Example response

  • 404: Not Found
  • Content-Type: application/json; charset=UTF-8
{
  "exception": "RelationshipNotFoundException",
  "fullname": "org.neo4j.server.rest.web.RelationshipNotFoundException",
  "stacktrace": [
    "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:197)",
    "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:675)",
    "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:833)",
    "java.lang.reflect.Method.invoke(Method.java:606)",
    "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)",
    "java.lang.Thread.run(Thread.java:744)"
  ]
}