gremlex v0.3.2 Gremlex.Graph View Source

Functions for traversing and mutating the Graph.

Graph operations are stored in a queue which can be created with g/0. Mosts functions return the queue so that they can be chained together similar to how Gremlin queries work.

Example:

g.V(1).values("name")

Would translate to

g |> v(1) |> values("name")

Note: This module doesn’t actually execute any queries, it just allows you to build one. For query execution see Gremlex.Client.query/1

Link to this section Summary

Functions

Appends an addE command to the traversal. Returns a graph to allow chaining

Adds a namespace as property

Appends an addV command to the traversal. Returns a graph to allow chaining

Appends an aggregate command to the traversal. Returns a graph to allow chaining

Appends a coin command to the traversal. Takes in a graph and a probability modifier as parameters. Returns a graph to allow chaining

Appends values the E command allowing you to select an edge. Returns a graph to allow chaining

Compiles a graph into the Gremlin query

g()

Start of graph traversal. All graph operations are stored in a queue

Appends groupCount command to the traversal. Takes in a graph and the name of the key that will hold the aggregated grouping. Returns a graph to allow chainig

Appends properties command to the traversal. Returns a graph to allow chaining

Appends property command to the traversal. Returns a graph to allow chaining

Appends the store command to the traversal. Takes in a graph and the name of the side effect key that will hold the aggregate. Returns a graph to allow chaining

Appends values the V command allowing you to select a vertex. Returns a graph to allow chaining

Appends values the V command allowing you to select a vertex. Returns a graph to allow chaining

Appends valueMap command to the traversal. Returns a graph to allow chaining

Appends values command to the traversal. Returns a graph to allow chaining

Creates a within predicate that will match at least one of the values provided. Takes in a range or a list as the values. Examples:

g.V().has('age', within(1..18))
g.V().has('name', within(["some", "value"]))

Creates a without predicate that will filter out values that match the values provided. Takes in a range or a list as the values. Examples:

g.V().has('age', without(18..30))
g.V().has('name', without(["any", "value"]))

Link to this section Types

Link to this section Functions

Appends an addE command to the traversal. Returns a graph to allow chaining.

Link to this function add_namespace(graph) View Source
add_namespace(Gremlex.Graph.t()) :: Gremlex.Graph.t()

Adds a namespace as property

Link to this function add_namespace(graph, ns) View Source
add_namespace(Gremlex.Graph.t(), any()) :: Gremlex.Graph.t()

Appends an addV command to the traversal. Returns a graph to allow chaining.

Link to this function aggregate(graph, aggregate) View Source

Appends an aggregate command to the traversal. Returns a graph to allow chaining.

Link to this function barrier(graph, max_barrier_size) View Source
Link to this function coalesce(graph, traversals) View Source

Appends a coin command to the traversal. Takes in a graph and a probability modifier as parameters. Returns a graph to allow chaining.

Appends values the E command allowing you to select an edge. Returns a graph to allow chaining.

Compiles a graph into the Gremlin query.

Start of graph traversal. All graph operations are stored in a queue.

Appends groupCount command to the traversal. Takes in a graph and the name of the key that will hold the aggregated grouping. Returns a graph to allow chainig.

Link to this function has_label(graph, label) View Source
has_label(Gremlex.Graph.t(), any()) :: Gremlex.Graph.t()
Link to this function has_namespace(graph) View Source
has_namespace(Gremlex.Graph.t()) :: Gremlex.Graph.t()
Link to this function has_namespace(graph, ns) View Source
has_namespace(Gremlex.Graph.t(), any()) :: Gremlex.Graph.t()

Appends properties command to the traversal. Returns a graph to allow chaining.

Link to this function property(graph, key, value) View Source
property(Gremlex.Graph.t(), String.t(), any()) :: Gremlex.Graph.t()

Appends property command to the traversal. Returns a graph to allow chaining.

Link to this function property(graph, atom, key, value) View Source
property(Gremlex.Graph.t(), atom(), String.t(), any()) :: Gremlex.Graph.t()
property(Gremlex.Graph.t(), atom(), String.t(), any()) :: Gremlex.Graph.t()
property(Gremlex.Graph.t(), atom(), String.t(), any()) :: Gremlex.Graph.t()

Appends the store command to the traversal. Takes in a graph and the name of the side effect key that will hold the aggregate. Returns a graph to allow chaining.

Appends values the V command allowing you to select a vertex. Returns a graph to allow chaining.

Appends values the V command allowing you to select a vertex. Returns a graph to allow chaining.

Appends valueMap command to the traversal. Returns a graph to allow chaining.

Appends values command to the traversal. Returns a graph to allow chaining.

Creates a within predicate that will match at least one of the values provided. Takes in a range or a list as the values. Examples:

g.V().has('age', within(1..18))
g.V().has('name', within(["some", "value"]))

Creates a without predicate that will filter out values that match the values provided. Takes in a range or a list as the values. Examples:

g.V().has('age', without(18..30))
g.V().has('name', without(["any", "value"]))