17.9. Relationship properties

17.9.1. Update relationship properties
17.9.2. Remove properties from a relationship
17.9.3. Remove property from a relationship
17.9.4. Remove non-existent property from a relationship
17.9.5. Remove properties from a non-existing relationship
17.9.6. Remove property from a non-existing relationship

17.9.1. Update relationship properties

Figure 17.40. Final Graph


Example request

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

Example response

  • 204: No Content

17.9.2. Remove properties from a relationship

Figure 17.41. Final Graph


Example request

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

Example response

  • 204: No Content

17.9.3. Remove property from a relationship

See the example request below.

Figure 17.42. Starting Graph


Figure 17.43. Final Graph


Example request

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

Example response

  • 204: No Content

17.9.4. Remove non-existent property from a relationship

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

Figure 17.44. Final Graph


Example request

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

Example response

  • 404: Not Found
  • Content-Type: application/json
{
  "message": "Relationship[174] 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:745)",
    "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:757)",
    "java.lang.reflect.Method.invoke(Method.java:597)"
  ]
}

17.9.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 17.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",
  "fullname": "org.neo4j.server.rest.web.RelationshipNotFoundException",
  "stacktrace": [
    "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:181)",
    "org.neo4j.server.rest.web.DatabaseActions.removeAllRelationshipProperties(DatabaseActions.java:733)",
    "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteAllRelationshipProperties(RestfulGraphDatabase.java:737)",
    "java.lang.reflect.Method.invoke(Method.java:597)"
  ]
}

17.9.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 17.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",
  "fullname": "org.neo4j.server.rest.web.RelationshipNotFoundException",
  "stacktrace": [
    "org.neo4j.server.rest.web.DatabaseActions.relationship(DatabaseActions.java:181)",
    "org.neo4j.server.rest.web.DatabaseActions.removeRelationshipProperty(DatabaseActions.java:739)",
    "org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationshipProperty(RestfulGraphDatabase.java:757)",
    "java.lang.reflect.Method.invoke(Method.java:597)"
  ]
}