{
"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/ <<EOF\n{ \n \"_key\" : \"graph\", \n \"vertices\" : \"vertices\", \n \"edges\" : \"edges\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1334191157\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_key\" : \"graph\", \n \"_rev\" : \"1334191157\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1335501877\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_key\" : \"graph\", \n \"_rev\" : \"1335501877\", \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 --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\" : \"1338188853\", \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\" : \"1337205813\", \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 --dump - http://localhost:8529/_api/graph/graph\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 POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex <<EOF\n{ \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1342448693\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1342448693\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n
shell> curl --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1344283701\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1344283701\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl -X DELETE --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 <<EOF\n{ \n \"optional1\" : \"val2\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1349067829\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1349067829\", \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 <<EOF\n{ \n \"optional1\" : \"vertexPatch\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1351427125\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1351427125\", \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 <<EOF\n{ \n \"optional1\" : null \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1351951413\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1351951413\", \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 <<EOF\n{ \n \"batchSize\" : 100 \n}\nEOF\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\" : \"1354572853\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_key\" : \"v2\", \n \"_rev\" : \"1354179637\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v5\", \n \"_key\" : \"v5\", \n \"_rev\" : \"1355359285\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_key\" : \"v4\", \n \"_rev\" : \"1354966069\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1353786421\", \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 <<EOF\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"any\", \"properties\":[] }}\nEOF\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\" : \"1357390901\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_key\" : \"v4\", \n \"_rev\" : \"1358570549\", \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 <<EOF\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"out\", \"properties\":[ { \"key\": \"optional1\", \"value\": \"val2\", \"compare\" : \"==\" }, ] }}\nEOF\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\" : \"1364468789\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_key\" : \"v1\", \n \"_rev\" : \"1363289141\", \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 <<EOF\n{ \n \"_key\" : \"edge1\", \n \"_from\" : \"vert2\", \n \"_to\" : \"vert1\", \n \"optional1\" : \"val1\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1370235957\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1370235957\", \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 --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 1373119541\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1373119541\", \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 --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 <<EOF\n{ \n \"optional1\" : \"val2\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1380131893\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1380131893\", \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 <<EOF\n{ \n \"optional3\" : \"val3\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 1383670837\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_key\" : \"edge1\", \n \"_rev\" : \"1383670837\", \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 <<EOF\n{ \n \"batchSize\" : 100 \n}\nEOF\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\" : \"1388323893\", \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\" : \"1388848181\", \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\" : \"1387799605\", \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\" : \"1389372469\", \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 <<EOF\n{\"batchSize\" : 100, \"filter\" : { \"direction\" : \"any\" }}\nEOF\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\" : \"1393697845\", \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\" : \"1394746421\", \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