Cayley
Search…
HTTP Methods
This file covers deprecated v1 HTTP API. All the methods of v2 HTTP API is described in OpenAPI/Swagger spec and can be viewed by importing https://raw.githubusercontent.com/cayleygraph/cayley/master/docs/api/swagger.yml URL into Swagger Editor or Swagger UI demo.

Gephi

Cayley supports streaming to Gephi via GraphStream.

API v1

Unless otherwise noted, all URIs take a POST command.

Queries and Results

/api/v1/query/gizmo

POST Body: Javascript source code of the query
Response: JSON results, depending on the query.

/api/v1/query/graphql

POST Body: GraphQL query
Response: JSON results, depending on the query.

/api/v1/query/mql

POST Body: JSON MQL query
Response: JSON results, with a query wrapper:
1
{
2
"result": <JSON Result set>
3
}
Copied!
If the JSON is invalid or an error occurs:
1
{
2
"error": "Error message"
3
}
Copied!

Query Shapes

Result form:
1
{
2
"nodes": [{
3
"id" : integer,
4
"tags": ["list of tags from the query"],
5
"values": ["known values from the query"],
6
"is_link_node": bool, // Does the node represent the link or the node (the oval shapes)
7
"is_fixed": bool // Is the node a fixed starting point of the query
8
}],
9
10
"links": [{
11
"source": integer, // Node ID
12
"target": integer, // Node ID
13
"link_node": integer // Node ID
14
}]
15
}
Copied!

/api/v1/shape/gizmo

POST Body: Javascript source code of the query
Response: JSON description of the last query executed.

/api/v1/shape/mql

POST Body: JSON MQL query
Response: JSON description of the query.

Write commands

Responses come in the form
200 Success:
1
{
2
"result": "Success message."
3
}
Copied!
400 / 500 Error:
1
{
2
"error": "Error message."
3
}
Copied!

/api/v1/write

POST Body: JSON quads
1
[{
2
"subject": "Subject Node",
3
"predicate": "Predicate Node",
4
"object": "Object node",
5
"label": "Label node" // Optional
6
}] // More than one quad allowed.
Copied!
Response: JSON response message

/api/v1/write/file/nquad

POST Body: Form-encoded body:
  • Key: NQuadFile, Value: N-Quad file to write.
Response: JSON response message
Example:
1
curl http://localhost:64210/api/v1/write/file/nquad -F [email protected]
Copied!

/api/v1/delete

POST Body: JSON quads
1
[{
2
"subject": "Subject Node",
3
"predicate": "Predicate Node",
4
"object": "Object node",
5
"label": "Label node" // Optional
6
}] // More than one quad allowed.
Copied!
Response: JSON response message.
Last modified 2yr ago