HTTP API

Relationships

Get All Relationships

Retrieve all the existing relationships as an array of maps, default skip of 0 and limit of 100

:GET /db/{graph}/relationships?limit=100&skip=0

Example Request:

:GET /db/rage/relationships?limit=100&skip=0

Example Response:

[ {"id": 1026, "type": "LOVES", "from": 1026, "to": 1027, "properties": {} }]

Get All Relationships of a Type

Retrieve all the existing relationships of a particular type as an array of maps, default skip of 0 and limit of 100

:GET /db/{graph}/relationships/{type}?limit=100&skip=0

Example Request:

:GET /db/rage/relationships/LOVES?limit=100&skip=0

Example Response:

[ {"id": 1026, "type": "LOVES", "from": 1026, "to": 1027, "properties": {} }]

Get A Relationship

Retrieve an existing relationships by their id

:GET /db/{graph}/relationship/{id}

Example Request:

:GET /db/rage/relationship/1026

Example Response:

[ {"id": 1026, "type": "LOVES", "from": 1026, "to": 1027, "properties": {} }]

Create A Relationship By Node Types and Keys

Create a new relationship of two nodes by their type and key

:POST /db/{graph}/node/{type_1}/{key_1}/relationship/{type_2}/{key_2}/{rel_type} {properties}

Example Request:

:POST /db/rage/node/User/Helene/relationship/User/Max/LOVES { "strength": 1.0 }

Example Response:

[ {"id": 1026, "type": "LOVES", "from": 1026, "to": 1027, "properties": { "strength": 1.0 } }]

Create A Relationship By Node Ids

Create a new relationship of two nodes by their type and key

:POST /db/{graph}/node/{id_1}/relationship/{id_2}/{rel_type}

Example Request:

:POST /db/rage/node/1026/relationship/1027/LOVES { "strength": 1.0 }

Example Response:

[ {"id": 1026, "type": "LOVES", "from": 1026, "to": 1027, "properties": { "strength": 1.0 } }]

Delete A Relationship

Delete an existing relationships by their id

:DELETE /db/{graph}/relationship/{id}

Example Request:

:DELETE /db/rage/relationships/1026

Get the Relationships of a Node By Node Type

Get the Relationships of a Node By Node Type and Key

:GET /db/{graph}/node/{type}/{key}/relationships
:GET /db/{graph}/node/{type}/{key}/relationships/{direction [all, in, out]}
:GET /db/{graph}/node/{type}/{key}/relationships/{direction [all, in, out]}/{type TYPE_ONE}
:GET /db/{graph}/node/{type}/{key}/relationships/{direction [all, in, out]}/{type(s) TYPE_ONE&TYPE_TWO}

Example Request:

:GET /db/rage/node/User/Helene/relationships/out/LOVE&HATE

Get the Relationships of a Node By Node Id

Get the Relationships of a Node By Node Type and Key

:GET /db/{graph}/node/{id}/relationships
:GET /db/{graph}/node/{id}/relationships/{direction [all, in, out]}
:GET /db/{graph}/node/{id}/relationships/{direction [all, in, out]}/{type TYPE_ONE}
:GET /db/{graph}/node/{id}/relationships/{direction [all, in, out]}/{type(s) TYPE_ONE&TYPE_TWO}

Example Request:

:GET /db/rage/node/1026/relationships/out/LOVE&HATE