HTTP interface for named graphs

The HTTP API for named graphs is called Gharial.

You can manage all types of ArangoDB’s named graphs with Gharial:

The examples use the following example graphs:

social graph:

Social Example Graph

knows graph:

Social Example Graph

Management

List all graphs

Lists all graphs known to the graph module.

GET /_api/gharial

Lists all graphs stored in this database.

Responses

HTTP 200: Is returned if the module is available and the graphs could be listed.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graphs (array): A list of all named graphs.

    • graph (object): The properties of the named graph.

      • name (string): The name of the graph.

      • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

        • collection (string): Name of the edge collection, where the edge are stored in.

        • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

        • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

      • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

      • numberOfShards (integer): Number of shards created for every new collection in the graph.

      • _id (string): The internal id value of this graph.

      • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

      • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

      • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

      • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

      • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

      • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

      • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

Examples

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial

HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 623
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Create a graph

Create a new graph in the graph module.

POST /_api/gharial

Query Parameters

  • waitForSync (boolean, optional): define if the request should wait until everything is synced to disc. Will change the success response code.

Request Body

  • name (string, required): Name of the graph.

  • edgeDefinitions (array, optional): An array of definitions for the relations of the graph. Each has the following type:

    • collection (string, required): Name of the edge collection, where the edge are stored in.

    • from (array of strings, required): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

    • to (array of strings, required): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

  • orphanCollections (array of strings, optional): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

  • isSmart (boolean, optional): Define if the created graph should be smart (Enterprise Edition only).

  • isDisjoint (boolean, optional): Whether to create a Disjoint SmartGraph instead of a regular SmartGraph (Enterprise Edition only).

  • options (object, optional): a JSON object to define options for creating collections within this graph. It can contain the following attributes:

    • smartGraphAttribute (string, optional): Only has effect in Enterprise Edition and it is required if isSmart is true. The attribute name that is used to smartly shard the vertices of a graph. Every vertex in this SmartGraph has to have this attribute. Cannot be modified later.

    • satellites (array of strings, optional): An array of collection names that is used to create SatelliteCollections for a (Disjoint) SmartGraph using SatelliteCollections (Enterprise Edition only). Each array element must be a string and a valid collection name. The collection type cannot be modified later.

    • numberOfShards (integer, required): The number of shards that is used for every collection within this graph. Cannot be modified later.

    • replicationFactor (integer, required): The replication factor used when initially creating collections for this graph. Can be set to "satellite" to create a SatelliteGraph, which then ignores numberOfShards, minReplicationFactor, and writeConcern (Enterprise Edition only).

    • writeConcern (integer, optional): Write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

The creation of a graph requires the name of the graph and a definition of its edges.

Responses

HTTP 201: Is returned if the graph could be created and waitForSync is enabled for the _graphs collection, or given in the request. The response body contains the graph configuration that has been stored.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the newly created graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 202: Is returned if the graph could be created and waitForSync is disabled for the _graphs collection and not given in the request. The response body contains the graph configuration that has been stored.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the newly created graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 400: Returned if the request is in a wrong format.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to create a graph you at least need to have the following privileges:

  1. Administrate access on the Database.
  2. Read Only access on every collection used within this graph.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 409: Returned if there is a conflict storing the graph. This can occur either if a graph with this name is already stored, or if there is one edge definition with a the same edge collection but a different signature used in any other graph.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

Create a General Graph. This graph type does not make use of any sharding strategy and is useful on the single server.

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{ 
  "name" : "myGraph", 
  "edgeDefinitions" : [ 
    { 
      "collection" : "edges", 
      "from" : [ 
        "startVertices" 
      ], 
      "to" : [ 
        "endVertices" 
      ] 
    } 
  ] 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 227
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTA6--_
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Create a SmartGraph. This graph uses 9 shards and is sharded by the “region” attribute. Available in the Enterprise Edition only.

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{ 
  "name" : "smartGraph", 
  "edgeDefinitions" : [ 
    { 
      "collection" : "edges", 
      "from" : [ 
        "startVertices" 
      ], 
      "to" : [ 
        "endVertices" 
      ] 
    } 
  ], 
  "orphanCollections" : [ 
    "orphanVertices" 
  ], 
  "isSmart" : true, 
  "options" : { 
    "replicationFactor" : 2, 
    "numberOfShards" : 9, 
    "smartGraphAttribute" : "region" 
  } 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 465
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTDi--A
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Create a disjoint SmartGraph. This graph uses 9 shards and is sharded by the “region” attribute. Available in the Enterprise Edition only. Note here: as we are using a disjoint version, we can only create edges between vertices sharing the same region.

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{ 
  "name" : "disjointSmartGraph", 
  "edgeDefinitions" : [ 
    { 
      "collection" : "edges", 
      "from" : [ 
        "startVertices" 
      ], 
      "to" : [ 
        "endVertices" 
      ] 
    } 
  ], 
  "orphanCollections" : [ 
    "orphanVertices" 
  ], 
  "isSmart" : true, 
  "options" : { 
    "isDisjoint" : true, 
    "replicationFactor" : 2, 
    "numberOfShards" : 9, 
    "smartGraphAttribute" : "region" 
  } 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 488
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTBi--_
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Create a SmartGraph with a satellite vertex collection. It uses the collection “endVertices” as a satellite collection. So this collection is cloned to all servers, all other vertex collections are split into 9 shards and are sharded by the “region” attribute. Available in the Enterprise Edition only.

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{ 
  "name" : "smartGraph", 
  "edgeDefinitions" : [ 
    { 
      "collection" : "edges", 
      "from" : [ 
        "startVertices" 
      ], 
      "to" : [ 
        "endVertices" 
      ] 
    } 
  ], 
  "orphanCollections" : [ 
    "orphanVertices" 
  ], 
  "isSmart" : true, 
  "options" : { 
    "replicationFactor" : 2, 
    "numberOfShards" : 9, 
    "smartGraphAttribute" : "region", 
    "satellites" : [ 
      "endVertices" 
    ] 
  } 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 465
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTEO--A
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Create an EnterpriseGraph. This graph uses 9 shards, it does not make use of specific sharding attributes. Available in the Enterprise Edition only.

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{ 
  "name" : "enterpriseGraph", 
  "edgeDefinitions" : [ 
    { 
      "collection" : "edges", 
      "from" : [ 
        "startVertices" 
      ], 
      "to" : [ 
        "endVertices" 
      ] 
    } 
  ], 
  "orphanCollections" : [ ], 
  "isSmart" : true, 
  "options" : { 
    "replicationFactor" : 2, 
    "numberOfShards" : 9 
  } 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 433
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTCS--_
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Create a SatelliteGraph. A SatelliteGraph does not use shards, but uses “satellite” as replicationFactor. Make sure to keep this graph small as it is cloned to every server. Available in the Enterprise Edition only.

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{ 
  "name" : "satelliteGraph", 
  "edgeDefinitions" : [ 
    { 
      "collection" : "edges", 
      "from" : [ 
        "startVertices" 
      ], 
      "to" : [ 
        "endVertices" 
      ] 
    } 
  ], 
  "orphanCollections" : [ ], 
  "options" : { 
    "replicationFactor" : "satellite" 
  } 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 379
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTC6--A
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Get a graph

Get a graph from the graph module.

GET /_api/gharial/{graph}

Path Parameters

  • graph (string, required): The name of the graph.

Selects information for a given graph. Will return the edge definitions as well as the orphan collections. Or returns a 404 if the graph does not exist.

Responses

HTTP 200: Returns the graph if it could be found. The result will have the following format:

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the newly created graph

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/myGraph

HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 227
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Drop a graph

delete an existing graph

DELETE /_api/gharial/{graph}

Path Parameters

  • graph (string, required): The name of the graph.

Query Parameters

  • dropCollections (boolean, optional): Drop collections of this graph as well. Collections will only be dropped if they are not used in other graphs.

Drops an existing graph object by name. Optionally all collections not used by other graphs can be dropped as well.

Responses

HTTP 201: Is returned if the graph could be dropped and waitForSync is enabled for the _graphs collection, or given in the request.

HTTP 202: Is returned if the graph could be dropped and waitForSync is disabled for the _graphs collection and not given in the request.

HTTP 403: Returned if your user has insufficient rights. In order to drop a graph you at least need to have the following privileges:

  1. Administrate access on the Database.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social?dropCollections=true

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 41
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

List vertex collections

Lists all vertex collections used in this graph.

GET /_api/gharial/{graph}/vertex

Path Parameters

  • graph (string, required): The name of the graph.

Lists all vertex collections within this graph.

Responses

HTTP 200: Is returned if the collections could be listed.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • collections (array of strings): The list of all vertex collections within this graph. Includes collections in edgeDefinitions as well as orphans.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/vertex

HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 58
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Add vertex collection

Add an additional vertex collection to the graph.

POST /_api/gharial/{graph}/vertex

Path Parameters

  • graph (string, required): The name of the graph.

Request Body

  • options (object, optional): A JSON object to set options for creating vertex collections.

    • satellites (array of strings, optional): An array of collection names that is used to create SatelliteCollections for a (Disjoint) SmartGraph using SatelliteCollections (Enterprise Edition only). Each array element must be a string and a valid collection name. The collection type cannot be modified later.

Adds a vertex collection to the set of orphan collections of the graph. If the collection does not exist, it will be created.

Responses

HTTP 201: Is returned if the collection could be created and waitForSync is enabled for the _graphs collection, or given in the request. The response body contains the graph configuration that has been stored.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 202: Is returned if the collection could be created and waitForSync is disabled for the _graphs collection, or given in the request. The response body contains the graph configuration that has been stored.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the newly created graph

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 400: Returned if the request is in an invalid format.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to modify a graph you at least need to have the following privileges:

  1. Administrate access on the Database.
  2. Read Only access on every collection used within this graph.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex <<EOF
{ 
  "collection" : "otherVertices" 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 244
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTAW--_
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Remove vertex collection

Remove a vertex collection form the graph.

DELETE /_api/gharial/{graph}/vertex/{collection}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the vertex collection.

Query Parameters

  • dropCollection (boolean, optional): Drop the collection as well. Collection will only be dropped if it is not used in other graphs.

Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph. It can only remove vertex collections that are no longer part of edge definitions, if they are used in edge definitions you are required to modify those first.

Responses

HTTP 200: Returned if the vertex collection was removed from the graph successfully and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the newly created graph

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the newly created graph

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 400: Returned if the vertex collection is still used in an edge definition. In this case it cannot be removed from the graph yet, it has to be removed from the edge definition first.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to drop a vertex you at least need to have the following privileges:

  1. Administrate access on the Database.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

You can remove vertex collections that are not used in any edge collection:

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/vertex/otherVertices

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 229
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTQu---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

You cannot remove vertex collections that are used in edge collections:

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/vertex/male

HTTP/1.1 400 Bad Request
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 106
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

List edge definitions

Lists all edge definitions

GET /_api/gharial/{graph}/edge

Path Parameters

  • graph (string, required): The name of the graph.

Lists all edge collections within this graph.

Responses

HTTP 200: Is returned if the edge definitions could be listed.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • collections (array of strings): The list of all vertex collections within this graph. Includes collections in edgeDefinitions as well as orphans.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/edge

HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 53
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Add edge definition

Add a new edge definition to the graph

POST /_api/gharial/{graph}/edge

Path Parameters

  • graph (string, required): The name of the graph.

Request Body

  • collection (string, required): The name of the edge collection to be used.

  • from (array of strings, required): One or many vertex collections that can contain source vertices.

  • to (array of strings, required): One or many vertex collections that can contain target vertices.

  • options (object, optional): A JSON object to set options for creating collections within this edge definition.

    • satellites (array of strings, optional): An array of collection names that is used to create SatelliteCollections for a (Disjoint) SmartGraph using SatelliteCollections (Enterprise Edition only). Each array element must be a string and a valid collection name. The collection type cannot be modified later.

Adds an additional edge definition to the graph.

This edge definition has to contain a collection and an array of each from and to vertex collections. An edge definition can only be added if this definition is either not used in any other graph, or it is used with exactly the same definition. It is not possible to store a definition “e” from “v1” to “v2” in the one graph, and “e” from “v2” to “v1” in the other graph.

Additionally, collection creation options can be set.

Responses

HTTP 201: Returned if the definition could be added successfully and waitForSync is enabled for the _graphs collection. The response body contains the graph configuration that has been stored.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 202: Returned if the definition could be added successfully and waitForSync is disabled for the _graphs collection. The response body contains the graph configuration that has been stored.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 400: Returned if the definition could not be added. This could be because it is ill-formed, or if the definition is used in another graph with a different signature.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to modify a graph you at least need to have the following privileges:

  1. Administrate access on the Database.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge <<EOF
{ 
  "collection" : "works_in", 
  "from" : [ 
    "female", 
    "male" 
  ], 
  "to" : [ 
    "city" 
  ] 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 294
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMS9y---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Replace an edge definition

Replace an existing edge definition

PUT /_api/gharial/{graph}/edge/{collection}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection used in the edge definition.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • dropCollections (boolean, optional): Drop the collection as well. Collection will only be dropped if it is not used in other graphs.

Request Body

  • collection (string, required): The name of the edge collection to be used.

  • from (array of strings, required): One or many vertex collections that can contain source vertices.

  • to (array of strings, required): One or many vertex collections that can contain target vertices.

  • options (object, optional): A JSON object to set options for modifying collections within this edge definition.

    • satellites (array of strings, optional): An array of collection names that is used to create SatelliteCollections for a (Disjoint) SmartGraph using SatelliteCollections (Enterprise Edition only). Each array element must be a string and a valid collection name. The collection type cannot be modified later.

Change one specific edge definition. This will modify all occurrences of this definition in all graphs known to your database.

Responses

HTTP 201: Returned if the request was successful and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 400: Returned if the new edge definition is ill-formed and cannot be used.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to drop a vertex you at least need to have the following privileges:

  1. Administrate access on the Database.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found, or if no edge definition with this name is found in the graph.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation <<EOF
{ 
  "collection" : "relation", 
  "from" : [ 
    "female", 
    "male", 
    "animal" 
  ], 
  "to" : [ 
    "female", 
    "male", 
    "animal" 
  ] 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 247
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTSa---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Remove an edge definition from the graph

Remove an edge definition form the graph

DELETE /_api/gharial/{graph}/edge/{collection}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection used in the edge definition.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • dropCollections (boolean, optional): Drop the collection as well. Collection will only be dropped if it is not used in other graphs.

Remove one edge definition from the graph. This will only remove the edge collection, the vertex collections remain untouched and can still be used in your queries.

Responses

HTTP 201: Returned if the edge definition could be removed from the graph and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 202: Returned if the edge definition could be removed from the graph and waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • graph (object): The information about the modified graph.

    • name (string): The name of the graph.

    • edgeDefinitions (array): An array of definitions for the relations of the graph. Each has the following type:

      • collection (string): Name of the edge collection, where the edge are stored in.

      • from (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _from is in any of the collections here.

      • to (array of strings): List of vertex collection names. Edges in collection can only be inserted if their _to is in any of the collections here.

    • orphanCollections (array of strings): An array of additional vertex collections. Documents within these collections do not have edges within this graph.

    • numberOfShards (integer): Number of shards created for every new collection in the graph.

    • _id (string): The internal id value of this graph.

    • _rev (string): The revision of this graph. Can be used to make sure to not override concurrent modifications to this graph.

    • replicationFactor (integer): The replication factor used for every new collection in the graph. For SatelliteGraphs, it is the string "satellite" (Enterprise Edition only).

    • writeConcern (integer): The default write concern for new collections in the graph. It determines how many copies of each shard are required to be in sync on the different DB-Servers. If there are less than these many copies in the cluster, a shard refuses to write. Writes to shards with enough up-to-date copies succeed at the same time, however. The value of writeConcern cannot be larger than replicationFactor. For SatelliteGraphs, the writeConcern is automatically controlled to equal the number of DB-Servers and the attribute is not available. (cluster only)

    • isSmart (boolean): Whether the graph is a SmartGraph (Enterprise Edition only).

    • isDisjoint (boolean): Whether the graph is a Disjoint SmartGraph (Enterprise Edition only).

    • smartGraphAttribute (string): Name of the sharding attribute in the SmartGraph case (Enterprise Edition only).

    • isSatellite (boolean): Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not.

HTTP 403: Returned if your user has insufficient rights. In order to drop a vertex you at least need to have the following privileges:

  1. Administrate access on the Database.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found, or if no edge definition with this name is found in the graph.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/edge/relation

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 171
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTIC--B
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Vertices

Create a vertex

create a new vertex

POST /_api/gharial/{graph}/vertex/{collection}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the vertex collection the vertex should be inserted into.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • returnNew (boolean, optional): Define if the response should contain the complete new version of the document.

Request Body

(object, required)

The body has to be the JSON object to be stored.

Adds a vertex to the given collection.

Responses

HTTP 201: Returned if the vertex could be added and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The internal attributes for the vertex.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • new (object): The complete newly written vertex document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The internal attributes generated while storing the vertex. Does not include any attribute given in request body.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • new (object): The complete newly written vertex document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to insert vertices into the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned if no graph with this name could be found. Or if a graph is found but this collection is not part of the graph.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/male <<EOF
{ 
  "name" : "Francis" 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 92
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMT_e--A
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Get a vertex

fetches an existing vertex

GET /_api/gharial/{graph}/vertex/{collection}/{vertex}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the vertex collection the vertex belongs to.

  • vertex (string, required): The _key attribute of the vertex.

Query Parameters

  • rev (string, optional): Must contain a revision. If this is set a document is only returned if it has exactly this revision. Also see if-match header as an alternative to this.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is returned, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an query parameter rev.

  • if-none-match (string, optional): If the “If-None-Match” header is given, then it must contain exactly one Etag. The document is returned, only if it has a different revision as the given Etag. Otherwise a HTTP 304 is returned.

Gets a vertex from the given collection.

Responses

HTTP 200: Returned if the vertex could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The complete vertex.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 304: Returned if the if-none-match header is given and the currently stored vertex still has this revision value. So there was no update between the last time the vertex was fetched by the caller.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to update vertices in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Read Only access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The vertex does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice

HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 109
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTKG---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Update a vertex

update an existing vertex

PATCH /_api/gharial/{graph}/vertex/{collection}/{vertex}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the vertex collection the vertex belongs to.

  • vertex (string, required): The _key attribute of the vertex.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • keepNull (boolean, optional): Define if values set to null should be stored. By default (true) the given documents attribute(s) will be set to null. If this parameter is false the attribute(s) will instead be delete from the document.

  • returnOld (boolean, optional): Define if a presentation of the deleted document should be returned within the response object.

  • returnNew (boolean, optional): Define if a presentation of the new document should be returned within the response object.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is updated, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

Request Body

(object, required)

The body has to contain a JSON object containing exactly the attributes that should be overwritten, all other attributes remain unchanged.

Updates the data of the specific vertex in the collection.

Responses

HTTP 200: Returned if the vertex could be updated, and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The internal attributes for the vertex.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • new (object): The complete newly written vertex document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • old (object): The complete overwritten vertex document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 202: Returned if the request was successful, and waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The internal attributes for the vertex.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • new (object): The complete newly written vertex document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • old (object): The complete overwritten vertex document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to update vertices in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The vertex to update does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice <<EOF
{ 
  "age" : 26 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 118
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTOK---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Replace a vertex

replaces an existing vertex

PUT /_api/gharial/{graph}/vertex/{collection}/{vertex}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the vertex collection the vertex belongs to.

  • vertex (string, required): The _key attribute of the vertex.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • keepNull (boolean, optional): Define if values set to null should be stored. By default the key is not removed from the document.

  • returnOld (boolean, optional): Define if a presentation of the deleted document should be returned within the response object.

  • returnNew (boolean, optional): Define if a presentation of the new document should be returned within the response object.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is updated, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

Request Body

(object, required)

The body has to be the JSON object to be stored.

Replaces the data of a vertex in the collection.

Responses

HTTP 200: Returned if the vertex could be replaced, and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The internal attributes for the vertex.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • new (object): The complete newly written vertex document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • old (object): The complete overwritten vertex document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 202: Returned if the vertex could be replaced, and waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • vertex (object): The internal attributes for the vertex.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • new (object): The complete newly written vertex document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

  • old (object): The complete overwritten vertex document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to replace vertices in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The vertex to replace does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice <<EOF
{ 
  "name" : "Alice Cooper", 
  "age" : 26 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 118
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTTS---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Remove a vertex

removes a vertex from a graph

DELETE /_api/gharial/{graph}/vertex/{collection}/{vertex}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the vertex collection the vertex belongs to.

  • vertex (string, required): The _key attribute of the vertex.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • returnOld (boolean, optional): Define if a presentation of the deleted document should be returned within the response object.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is updated, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

Removes a vertex from the collection.

Responses

HTTP 200: Returned if the vertex could be removed.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • removed (boolean): Is set to true if the remove was successful.

  • old (object): The complete deleted vertex document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • removed (boolean): Is set to true if the remove was successful.

  • old (object): The complete deleted vertex document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to delete vertices in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The vertex to remove does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 41
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Edges

Create an edge

Creates an edge in an existing graph

POST /_api/gharial/{graph}/edge/{collection}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection the edge belongs to.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • returnNew (boolean, optional): Define if the response should contain the complete new version of the document.

Request Body

  • _from (string, required): The source vertex of this edge. Has to be valid within the used edge definition.

  • _to (string, required): The target vertex of this edge. Has to be valid within the used edge definition.

Creates a new edge in the collection. Within the body the edge has to contain a _from and _to value referencing to valid vertices in the graph. Furthermore the edge has to be valid in the definition of the used edge collection.

Responses

HTTP 201: Returned if the edge could be created and waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The internal attributes for the edge.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • new (object): The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The internal attributes for the edge.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • new (object): The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 400: Returned if the input document is invalid. This can for instance be the case if the _from or _to attribute is missing or malformed.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to insert edges into the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in any of the following cases:

  • no graph with this name could be found.
  • the edge collection is not part of the graph.
  • the vertex collection referenced in the _from or _to attribute is not part of the graph.
  • the vertex collection is part of the graph, but does not exist.
  • _from or _to vertex does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

Examples

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation <<EOF
{ 
  "type" : "friend", 
  "_from" : "female/alice", 
  "_to" : "female/diana" 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 94
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMS8i---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Get an edge

fetch an edge

GET /_api/gharial/{graph}/edge/{collection}/{edge}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection the edge belongs to.

  • edge (string, required): The _key attribute of the edge.

Query Parameters

  • rev (string, optional): Must contain a revision. If this is set a document is only returned if it has exactly this revision. Also see if-match header as an alternative to this.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is returned, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

  • if-none-match (string, optional): If the “If-None-Match” header is given, then it must contain exactly one Etag. The document is returned, only if it has a different revision as the given Etag. Otherwise a HTTP 304 is returned.

Gets an edge from the given collection.

Responses

HTTP 200: Returned if the edge could be found.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The complete edge.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 304: Returned if the if-none-match header is given and the currently stored edge still has this revision value. So there was no update between the last time the edge was fetched by the caller.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 403: Returned if your user has insufficient rights. In order to update vertices in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Read Only access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The edge does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/edge/relation/67660

HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 170
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTIy--_
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Modify an edge

modify an existing edge

PATCH /_api/gharial/{graph}/edge/{collection}/{edge}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection the edge belongs to.

  • edge (string, required): The _key attribute of the vertex.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • keepNull (boolean, optional): Define if values set to null should be stored. By default (true) the given documents attribute(s) will be set to null. If this parameter is false the attribute(s) will instead be deleted from the document.

  • returnOld (boolean, optional): Define if a presentation of the deleted document should be returned within the response object.

  • returnNew (boolean, optional): Define if a presentation of the new document should be returned within the response object.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is updated, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

Request Body

(object, required)

The body has to contain a JSON object containing exactly the attributes that should be overwritten, all other attributes remain unchanged.

Updates the data of the specific edge in the collection.

Responses

HTTP 200: Returned if the edge could be updated, and waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The internal attributes for the edge.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • new (object): The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • old (object): The complete overwritten edge document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The internal attributes for the edge.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • new (object): The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • old (object): The complete overwritten edge document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to update edges in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The edge to update does not exist.
  • either _from or _to vertex does not exist (if updated).

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation/68175 <<EOF
{ 
  "since" : "01.01.2001" 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 118
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTO6---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Replace an edge

replace the content of an existing edge

PUT /_api/gharial/{graph}/edge/{collection}/{edge}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection the edge belongs to.

  • edge (string, required): The _key attribute of the vertex.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • keepNull (boolean, optional): Define if values set to null should be stored. By default the key is not removed from the document.

  • returnOld (boolean, optional): Define if a presentation of the deleted document should be returned within the response object.

  • returnNew (boolean, optional): Define if a presentation of the new document should be returned within the response object.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is updated, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

Request Body

  • _from (string, required): The source vertex of this edge. Has to be valid within the used edge definition.

  • _to (string, required): The target vertex of this edge. Has to be valid within the used edge definition.

Replaces the data of an edge in the collection.

Responses

HTTP 201: Returned if the request was successful but waitForSync is true.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The internal attributes for the edge

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • new (object): The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • old (object): The complete overwritten edge document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • edge (object): The internal attributes for the edge

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • new (object): The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

  • old (object): The complete overwritten edge document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to replace edges in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The edge to replace does not exist.
  • either _from or _to vertex does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation/68236 <<EOF
{ 
  "type" : "divorced", 
  "_from" : "female/alice", 
  "_to" : "male/bob" 
}
EOF

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 118
content-security-policy: frame-ancestors 'self'; form-action 'self';
etag: _fyvMTP2---
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body

Remove an edge

removes an edge from graph

DELETE /_api/gharial/{graph}/edge/{collection}/{edge}

Path Parameters

  • graph (string, required): The name of the graph.

  • collection (string, required): The name of the edge collection the edge belongs to.

  • edge (string, required): The _key attribute of the edge.

Query Parameters

  • waitForSync (boolean, optional): Define if the request should wait until synced to disk.

  • returnOld (boolean, optional): Define if a presentation of the deleted document should be returned within the response object.

Header Parameters

  • if-match (string, optional): If the “If-Match” header is given, then it must contain exactly one Etag. The document is updated, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the Etag in an attribute rev in the URL.

Removes an edge from the collection.

Responses

HTTP 200: Returned if the edge could be removed.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • removed (boolean): Is set to true if the remove was successful.

  • old (object): The complete deleted edge document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 202: Returned if the request was successful but waitForSync is false.

  • error (boolean): Flag if there was an error (true) or not (false). It is false in this response.

  • code (integer): The response code.

  • removed (boolean): Is set to true if the remove was successful.

  • old (object): The complete deleted edge document. Includes all attributes stored before this operation. Will only be present if returnOld is true.

    • _id (string): The _id value of the stored data.

    • _key (string): The _key value of the stored data.

    • _rev (string): The _rev value of the stored data.

    • _from (string): The _from value of the stored data.

    • _to (string): The _to value of the stored data.

HTTP 403: Returned if your user has insufficient rights. In order to delete vertices in the graph you at least need to have the following privileges:

  1. Read Only access on the Database.
  2. Write access on the given collection.
  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

HTTP 404: Returned in the following cases:

  • No graph with this name could be found.
  • This collection is not part of the graph.
  • The edge to remove does not exist.

    • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

    • code (integer): The response code.

    • errorNum (integer): ArangoDB error number for the error that occurred.

    • errorMessage (string): A message created for this error.

HTTP 412: Returned if if-match header is given, but the stored documents revision is different.

  • error (boolean): Flag if there was an error (true) or not (false). It is true in this response.

  • code (integer): The response code.

  • errorNum (integer): ArangoDB error number for the error that occurred.

  • errorMessage (string): A message created for this error.

Examples

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/gharial/social/edge/relation/67402

HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 41
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
Show response body