Gremlex.Graph (gremlex v0.4.3)
View SourceFunctions 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
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.
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 sideEffect
command to the traversal.
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
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
Types
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.
@spec anonymous() :: t()
@spec barrier(t(), non_neg_integer()) :: t()
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.
@spec g() :: t()
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 sideEffect
command to the traversal.
The side effect is a way to store the result of a traversal in a key that can be used later in the traversal. It is similar to a variable that can be used to store intermediate results.
Example:
g.V()
.hasLabel('Product')
.has('price', gt(100))
.sideEffect(__.property('discounted', true))
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.
@spec tail(t(), non_neg_integer()) :: t()
@spec to(t(), String.t() | number() | Gremlex.Vertex.t()) :: t()
@spec v(t() | number() | String.t()) :: t() | Gremlex.Vertex.t()
Appends values the V
command allowing you to select a vertex.
Returns a graph to allow chaining.
@spec v(t(), Gremlex.Vertex.t()) :: t()
@spec v(t(), number()) :: t()
@spec v(t(), list() | String.t()) :: t()
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"]))