clarango.graph

create

(create graph-name edge-definition-vector & args)
Creates a new graph.
Takes a graph-name and a map or vector of maps containing the edge definitions.
Each edge definition map should take the following values:
{
  :edge-collection - A string or keyword providing the name for the graph being created
  :from - A vector of strings or keywords representing existing collection names
  :to - A vector of strings or keywords representing existing collection names (if not provided, the 'from' calloection will be used)
}

create-edge

(create-edge edge vertex-from vertex-to edge-collection & args)
Creates a new edge.

First argument: A map that represents the edge.
If you want to specify a key by yourself, add it as the :_key parameter to the edge map or use method create-edge-with-key.
If you would like the key to be created automatically, just leave this parameter out.
If you optionally want to specify a label for the edge, you can add it as the :$label parameter to the edge map.

Second argument: The name (_id value) of the from vertex (or just the vertex itself as a map).
Third argument: The name (_id value) of the to vertex (or just the vertex itself as a map).
Fourth argument:  The edge collection where the edge is to reside.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'waitForSync' true/false} (replace the single quotes with double quotes)
- waitForSync meaning if the server response should wait until the edge is saved to disk;
The option map might be passed in an arbitrary position after the first four arguments.

create-edge-with-key

(create-edge-with-key edge edge-key vertex-from vertex-to edge-collection & args)
Creates a new edge with the provided key.

First argument: A map that represents the edge.
Second argument: The key (string or clojure keyword) to be used for the new edge record. If nil then
  a new key will be generated.

Third argument: The name (_id value) of the from vertex (or just the vertex itself as a map).
Fourth argument: The name (_id value) of the to vertex (or just the vertex itself as a map).
Fifth argument:  The edge collection where the edge is to reside.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'waitForSync' true/false} (replace the single quotes with double quotes)
- waitForSync meaning if the server response should wait until the edge is saved to disk;
The option map might be passed in an arbitrary position after the first four arguments.

create-vertex

(create-vertex vertex vertex-collection & args)
Creates a new vertex.

First argument: A map representing the vertex data to be saved.
If you want to specify a key by yourself, add it as the :_key parameter to the vertex map or use method create-vertex-with-key.
If you would like the key to be created automatically, just leave this parameter out.

Second argument: The vertex collection where the vertex should be stored.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'waitForSync' true/false} (replace the single quotes with double quotes)
- waitForSync meaning if the server response should wait until the vertex is saved to disk;
The option map might be passed in an arbitrary position after the first argument.

create-vertex-with-key

(create-vertex-with-key vertex key vertex-collection & args)
Creates a new vertex.

First argument: A map representing the vertex data to be saved.
Second argument: The key for the new vertex (string or Clojure keyword)
Third argument: The vertex collection where the vertex should be stored.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'waitForSync' true/false} (replace the single quotes with double quotes)
- waitForSync meaning if the server response should wait until the vertex is saved to disk;
The option map might be passed in an arbitrary position after the first argument.

delete

(delete graph-name & args)
Deletes a graph.
Also deletes all vertex and edgea collections.

delete-edge

(delete-edge key edge-collection & args)
Deletes an edge.

Takes the edge key as first argument.
Takes the edge-collection as the second argument.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id, 'waitForSync' true/false} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
- waitForSync meaning if the server response should wait until the action was saved to disk;
The option map might be passed in an arbitrary position after the first argument.

delete-vertex

(delete-vertex key vertex-collection & args)
Deletes a vertex.

Takes the vertex key as first argument.
Takes the vertex-collection as the second argument.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id, 'waitForSync' true/false} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
- waitForSync meaning if the server response should wait until the action was saved to disk;
The option map might be passed in an arbitrary position after the first argument.

execute-traversal

(execute-traversal start-vertex vertex-collection edges-collection direction & args)
Sends a traversal to the server to execute it. Output are vertices and edges.

First argument: The key of the start vertex.
Second argument: The name of the collection that contains the vertices.
Third argument: The name of the collection that contains the edges.
Fourth argument: The direction of the traversal. Must be either 'outbound', 'inbound' or 'any'. 
Can be nil if the 'expander' attribute is set in the additional options.

Takes optionally a database name as further argument.
If omitted by user, the default database will be used.

Also optional as argument is another map containing further options for the traversal:
{'filter' {...}, 'expander' code}
- see http://www.arangodb.org/manuals/current/HttpTraversals.html#HttpTraversalsPost

The option map might be passed in an arbitrary position after the first four arguments.

get-edge

(get-edge key edge-collection & args)
Gets an edge.

Takes the edge key as the first argument.
Takes the edge-collection name as the second argument.

Optionally takes a graph-name and a db name as further arguments.
If omitted, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
The option map might be passed in an arbitrary position after the first argument.

get-info

(get-info graph-name & args)
Gets info about the Graph
Returns a map containing info about the graph.

get-vertex

(get-vertex key vertex-collection & args)
Gets a vertex.

Takes the vertex key as the first argument.
Takes the collection name as the second argument.

Optionally takes a graph-name and a db name as further arguments.
If omitted, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
The option map might be passed in an arbitrary position after the first argument.

replace-edge

(replace-edge edge-properties key edge-collection & args)
Updates a edge.

First argument: A map containing the new edge properties.
Second argument: The edge key.
Third argument: The edge collection where the edge resides.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id, 'waitForSync' true/false, 'keepNull' true/false} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
- waitForSync meaning if the server response should wait until the action was saved to disk;
- keepNull meaning if the key/value pair should be deleted in the vertex
  if the argument map contains it with a null (nil) as value;
The option map might be passed in an arbitrary position after the first argument.

replace-vertex

(replace-vertex vertex-properties key vertex-collection & args)
Updates a vertex.

First argument: A map containing the new vertex properties.
Second argument: The vertex key.
Third argument: The vertex collection where the vertex resides.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id, 'waitForSync' true/false, 'keepNull' true/false} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
- waitForSync meaning if the server response should wait until the action was saved to disk;
- keepNull meaning if the key/value pair should be deleted in the vertex
  if the argument map contains it with a null (nil) as value;
The option map might be passed in an arbitrary position after the first argument.

update-edge

(update-edge edge-properties key edge-collection & args)
Updates an edge.

First argument: A map containing the new edge properties.
Second argument: The edge key.
Third argument: The edge collection where the edge resides.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id, 'waitForSync' true/false, 'keepNull' true/false} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
- waitForSync meaning if the server response should wait until the action was saved to disk;
- keepNull meaning if the key/value pair should be deleted in the vertex
  if the argument map contains it with a null (nil) as value;
The option map might be passed in an arbitrary position after the first argument.

update-vertex

(update-vertex vertex-properties key vertex-collection & args)
Updates a vertex.

First argument: A map containing the new vertex properties.
Second argument: The vertex key.
Third argument: The vertex collection where the vertex resides.

Takes optional a graph name and a db name as further arguments.
If omitted by user, the default graph and db will be used.

Also optional as argument is another map containing further options:
{'rev' revision_id, 'waitForSync' true/false, 'keepNull' true/false} (replace the single quotes with double quotes)
- rev is the document revision; if the current document revision_id does not match the given one, an error is thrown;
- waitForSync meaning if the server response should wait until the action was saved to disk;
- keepNull meaning if the key/value pair should be deleted in the vertex
  if the argument map contains it with a null (nil) as value;
The option map might be passed in an arbitrary position after the first argument.