{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the graph was created successfully and waitForSync was true.
",
"code": "201"
},
{
"reason": "is returned if the graph was created successfully and waitForSync was false.
",
"code": "202"
},
{
"reason": "is returned if it failed. The response body contains an error document in this case.
Examples
",
"code": "400"
}
],
"parameters": [
{
"dataType": "Boolean",
"paramType": "query",
"required": false,
"name": "waitForSync",
"description": "Wait until document has been synced to disk.
"
},
{
"dataType": "Json",
"paramType": "body",
"required": true,
"name": "graph",
"description": "The call expects a JSON object as body with the following attributes: _key: The name of the new graph. vertices: The name of the vertices collection. edges: The name of the egde collection.
"
}
],
"notes": "Creates a new graph.
Returns an object with an attribute graph containing a list of all graph properties.
",
"summary": "create graph",
"httpMethod": "POST",
"examples": "
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/\n{ \n \"_key\" : \"graph\", \n \"vertices\" : \"vertices\", \n \"edges\" : \"edges\" \n}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 1177757859\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_key\" : \"graph\", \n \"_rev\" : \"1177757859\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1179068579\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_key\" : \"graph\", \n \"_rev\" : \"1179068579\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"graphs\" : [ \n { \n \"_id\" : \"_graphs/graph2\", \n \"_key\" : \"graph2\", \n \"_rev\" : \"1181821091\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges2\", \n \"from\" : [ \n \"vertices2\" \n ], \n \"to\" : [ \n \"vertices2\" \n ] \n } \n ] \n }, \n { \n \"_id\" : \"_graphs/graph1\", \n \"_key\" : \"graph1\", \n \"_rev\" : \"1180772515\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges1\", \n \"from\" : [ \n \"vertices1\" \n ], \n \"to\" : [ \n \"vertices1\" \n ] \n } \n ] \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex\n{ \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1186212003\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1186212003\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1188047011\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1188047011\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{ \n \"optional1\" : \"val2\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1192831139\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1192831139\", \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{ \n \"optional1\" : \"vertexPatch\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1195190435\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1195190435\", \n \"optional1\" : \"vertexPatch\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\nshell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{ \n \"optional1\" : null \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1195714723\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1195714723\", \n \"optional1\" : null \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices\n{ \n \"batchSize\" : 100 \n}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v3\", \n \"_key\" : \"v3\", \n \"_rev\" : \"1198336163\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_key\" : \"v2\", \n \"_rev\" : \"1197942947\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v5\", \n \"_key\" : \"v5\", \n \"_rev\" : \"1199122595\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_key\" : \"v4\", \n \"_rev\" : \"1198729379\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1197549731\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 5, \n \"scannedIndex\" : 0, \n \"filtered\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"any\", \"properties\":[] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1201154211\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_key\" : \"v4\", \n \"_rev\" : \"1202333859\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 0, \n \"scannedIndex\" : 0, \n \"filtered\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"out\", \"properties\":[ { \"key\": \"optional1\", \"value\": \"val2\", \"compare\" : \"==\" }, ] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v4\", \n \"_key\" : \"v4\", \n \"_rev\" : \"1208232099\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1207052451\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 0, \n \"scannedIndex\" : 0, \n \"filtered\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge\n{ \n \"_key\" : \"edge1\", \n \"_from\" : \"vert2\", \n \"_to\" : \"vert1\", \n \"optional1\" : \"val1\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1213999267\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1213999267\", \n \"_from\" : \"vertices/vert2\", \n \"_to\" : \"vertices/vert1\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1216882851\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1216882851\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{ \n \"optional1\" : \"val2\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1223960739\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1223960739\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{ \n \"optional3\" : \"val3\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1227499683\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1227499683\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\", \n \"optional3\" : \"val3\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edges\n{ \n \"batchSize\" : 100 \n}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge2\", \n \"_key\" : \"edge2\", \n \"_rev\" : \"1232152739\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v3\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_key\" : \"edge3\", \n \"_rev\" : \"1232677027\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1231628451\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge4\", \n \"_key\" : \"edge4\", \n \"_rev\" : \"1233201315\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v5\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 4, \n \"scannedIndex\" : 0, \n \"filtered\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edges/v2\n{\"batchSize\" : 100, \"filter\" : { \"direction\" : \"any\" }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1237526691\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_key\" : \"edge3\", \n \"_rev\" : \"1238575267\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 0, \n \"scannedIndex\" : 0, \n \"filtered\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n