18.8. Relationship properties

18.8.1. Update relationship properties
18.8.2. Remove properties from a relationship
18.8.3. Remove property from a relationship
18.8.4. Remove non-existent property from a relationship
18.8.5. Remove properties from a non-existing relationship
18.8.6. Remove property from a non-existing relationship

18.8.1. Update relationship properties

Figure 18.40. Final Graph


Example request

  • PUT http://localhost:7474/db/data/relationship/108/properties
  • Accept: application/json
  • Content-Type: application/json
{
  "jim" : "tobias"
}

Example response

  • 204: No Content

18.8.2. Remove properties from a relationship

Figure 18.41. Final Graph


Example request

  • DELETE http://localhost:7474/db/data/relationship/17
  • Accept: application/json

Example response

  • 204: No Content

18.8.3. Remove property from a relationship

See the example request below.

Figure 18.42. Starting Graph


Figure 18.43. Final Graph


Example request

  • DELETE http://localhost:7474/db/data/relationship/19/properties/cost
  • Accept: application/json

Example response

  • 204: No Content

18.8.4. Remove non-existent property from a relationship

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

Figure 18.44. Final Graph


Example request

  • DELETE http://localhost:7474/db/data/relationship/20/properties/non-existent
  • Accept: application/json

Example response

  • 404: Not Found
  • Content-Type: application/json
{
  "message" : "Relationship[20] does not have a property \"non-existent\"",
  "exception" : "NoSuchPropertyException",
  "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:729)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:595)", "java.lang.reflect.Method.invoke(Method.java:597)" ]
}

18.8.5. Remove properties from a non-existing relationship

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

Figure 18.45. Final Graph


Example request

  • DELETE http://localhost:7474/db/data/relationship/1234/properties
  • Accept: application/json

Example response

  • 404: Not Found
  • Content-Type: application/json
{
  "exception" : "RelationshipNotFoundException",
  "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:137)", "org.neo4j.server.rest.web.DatabaseActions.removeAllRelationshipProperties(DatabaseActions.java:707)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteAllRelationshipProperties(RestfulGraphDatabase.java:579)", "java.lang.reflect.Method.invoke(Method.java:597)" ]
}

18.8.6. Remove property from a non-existing relationship

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

Figure 18.46. Final Graph


Example request

  • DELETE http://localhost:7474/db/data/relationship/1234/properties/cost
  • Accept: application/json

Example response

  • 404: Not Found
  • Content-Type: application/json
{
  "exception" : "RelationshipNotFoundException",
  "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:137)", "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:723)", "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:595)", "java.lang.reflect.Method.invoke(Method.java:597)" ]
}