A top-level grammar, consisting of just one stage.
No Additional PropertiesThe list of subgraph transformation rules in this grammar.
No Additional ItemsAn individual subgraph transformation rule. Each rule proceeds by matching a subgraph whose pattern is specified on the left-hand side (the lhs
), and replacing it with a subgraph specified on the right-hand side (rhs
). There are various different syntactical forms depending on the complexity and topology of the matching and replacement subgraphs, and whether properties (like edges and labels) are to be changed or copied over unmodified.
The name of this rule.
This block specifies a pattern with which to match the subgraph on the left-hand side of the transformation rule.
An array of node labels. The matched subgraph is a chain of nodes.
No Additional ItemsA node label.
A single node label. The matched subgraph contains exactly one node.The string can be a regular expression, to be matched against the node label.
A full description, including nodes and edges, of the subgraph to be matched.
No Additional PropertiesThe set of nodes in the matching subgraph.
Must contain a minimum of 1
items
A node label.This pattern will match any node that has the corresponding string label.
A (node ID, node label) pair; both are strings. The ID can be used to reference the node elsewhere in the rule.
Must contain a minimum of 2
items
Must contain a maximum of 2
items
A pattern for matching a node in a subgraph.
No Additional PropertiesA node identifier that can be used to reference the node elsewhere in the rule.
Must match regular expression:^[a-zA-Z_0-9]+$
A query expression for matching a label on the left-hand side of a subgraph transformation rule.
This query will match any label that has exactly the specified type and value.
A compound query expression that is formed by combining, or modifying, one or more constituent query expressions.
No Additional PropertiesThe label object must exactly match the given query expression, with no additional properties.
Same definition as labelThe label object must match the given query expression, but is allowed to contain additional properties.
Same definition as labelA recursive descent search of the label object must find an element that matches the given query expression.
Same definition as labelThe label must match all of the query expressions given in the list.
Must contain a minimum of 1
items
A query for matching a label in a graph entity (i.e. a node or edge).
Same definition as labelThe label must match one of the query expressions given in the list.
Must contain a minimum of 1
items
A query for matching a label in a graph entity (i.e. a node or edge).
Same definition as labelA flexible user-defined query. The text value of this query expression, when eval
'd, defines a JavaScript function which, when called with the label as its sole argument, must return a truthy value.
The label must be a JSON object, it must have a key that matches the given key (which can be any string that does not begin with a "$" character), and the value must match the query expression associated with that key.
No Additional PropertiesAll properties whose name matches the following regular expression must respect the following conditions
Property name regular expression:^[^$].*$
A query for matching a label in a graph entity (i.e. a node or edge).
Same definition as labelIf true, then any graph node that matches this pattern rule cannot have any neighbors that are not also in the subgraph defined by the pattern rule
The set of edges in the matching subgraph. Note that, unless the induce
property is set (within this rule or at a higher level in the grammar), this match is permissive rather than strict: the subgraph is allowed to contain more edges than specified here. In contrast, if induce
is set, then ONLY the edges in this subgraph are allowed for a match.
An edge being matched on the left-hand side of a transformation rule. Note that the edge may be specified as an array of the form [v,w,label,id]
or as an object with those properties; the two are functionally equivalent. v
and w
represent source and target node IDs, respectively; label
is a query expression to match edge labels; and id
is a temporary identifier for the edge. label
and id
are optional.
A tuple describing an edge being matched on the left-hand side of a transformation rule.
Must contain a minimum of 2
items
Must contain a maximum of 4
items
The source node of the edge, using the node numbering or naming scheme defined in the node
block.
The target node of the edge, using the node numbering or naming scheme defined in the node
block.
A temporary identifier for the edge being matched. This is temporary in the sense that it is defined only while the transformation rule is being applied.
An object describing an edge being matched on the left-hand side of a transformation rule.
No Additional PropertiesThe source node of the edge, using the node naming scheme defined in the node
block.
The target node of the edge, using the node naming scheme defined in the node
block.
A temporary identifier for the edge being matched. This is temporary in the sense that it is defined only while the transformation rule is being applied.
Same definition as idThis block specifies the subgraph generated on the right-hand side of the transformation rule, replacing the matched subgraph on the left-hand side.
An array of node labels. The replacement subgraph is a chain of nodes. The head
and tail
properties will be automatically set to (respectively) the first and last nodes on the left-hand side of the rule.
A node label.
A single node label. The replacement subgraph contains exactly one node. The head
and tail
properties will automatically be set to (respectively) the first and last nodes on the left-hand side of the rule.
A full description, including nodes and edges, of the subgraph to be used for replacement. If the node
block is absent, it will be copied from the left-hand side.
The set of nodes in the replacement subgraph.
Must contain a minimum of 1
items
A node label.
A (node ID, node label) pair; both are strings. The ID either refers to a node that was matched on the left-hand side of the rule, or is completely new.
Must contain a minimum of 2
items
Must contain a maximum of 2
items
An incremental update to a node in the matched subgraph.
No Additional PropertiesA node identifier that refers to a node that was matched on the left-hand side of the rule.
Same definition as idAn update to the existing node label, whose properties will be copied over to the existing node label using Lodash assign
semantics. It follows that this update will typically be an object rather than another type of value (though the schema also allows string-valued, array-valued, or numeric values here).
Generates a label with exactly the specified type and value. For string-valued labels, or arrays that include strings, the string may include substrings of the form ${id.label}
where id
is an identifier that has been assigned, during this transformation rule, to a previously referenced node or edge.
Generates a label using a functional expression that typically involves evaluating a string as JavaScript. The JavaScript may refer to the labels of nodes or edges that have previously been assigned IDs, using the syntax $id.label
.
Generates a label by evaluating a JavaScript string.
Generates a label by applying extend
to its arguments, where the semantics of extend
skip undefined values.
Must contain a minimum of 2
items
Generates a label by applying the Lodash assign
function to its arguments, where the semantics of assign
do not skip undefined values.
Must contain a minimum of 2
items
Generates a label by applying the Lodash merge
function to its arguments, i.e. performing a recursive traversal and attempting to merge at each level.
Must contain a minimum of 2
items
Generate text using command-line LLM interface. This option is only enabled in the command-line tool. The default LLM toolname is llm, which must be separately installed: https://github.com/simonw/llm
Argument to 'llm'
Argument to 'llm'
Generates a JSON object with the given key(s) (which can be any string that does not begin with a "$" character), mapping to value(s) which are themselves label expressions.
No Additional PropertiesAll properties whose name matches the following regular expression must respect the following conditions
Property name regular expression:^[^$].*$
A description of a node in the replacement subgraph.
No Additional PropertiesA node identifier that either refers to a node that was matched on the left-hand side of the rule, or is completely new.
Same definition as idA recipe for generating a label on the right-hand side of a subgraph transformation rule.
Same definition as updateThe set of edges in the replacement subgraph. (Note that under some circumstances, edges will be automatically added even if not specified here. Specifically, if the node
property is array-valued, then a chain of edges will be added automatically between consecutive nodes in the list.)
An edge being added on the right-hand side of a transformation rule. The edge may be specified in a variety of ways, but the basic idea is to either specify a source and target (v,w
) or an identifier referencing an existing edge (id
), and then to replace the label completely (label
) or update it incrementally (update
). Specifically the edge can be a [v,w,label]
tuple (where v
and w
are the source and target of the new edge), as an {id,label}
object (where id
is the ID of an edge introduced on the left-hand side of the transformation rule; in this and the [v,w,label]
tuple the label is optional, and will be copied from an existing edge if one exists), as an {id,update}
object (where update
represents an incremental update to the existing edge label), as a {v,w,update}
object, as a string (which will be interpreted as the ID of an existing edge), or as a {v,w,label}
object.
A tuple describing an edge being added on the right-hand side of a transformation rule.
Must contain a minimum of 2
items
Must contain a maximum of 3
items
The source node of the edge, using the node numbering or naming scheme defined in the node
block.
The target node of the edge, using the node numbering or naming scheme defined in the node
block.
An object describing an edge being added on the right-hand side of a transformation rule.
No Additional PropertiesAn edge identifer from the subgraph matched on the left-hand side of the transformation rule.
Same definition as idA recipe for generating a label on the right-hand side of a subgraph transformation rule.
Same definition as updateAn object describing an incremental update to an edge on the right-hand side of a transformation rule.
No Additional PropertiesAn object describing an incremental update to an edge on the right-hand side of a transformation rule.
No Additional PropertiesThe source node of the edge, using the node identifiers defined in the node
block.
The target node of the edge, using the node identifiers defined in the node
block.
An edge identifer from the subgraph matched on the left-hand side of the transformation rule. The edge will be copied unmodified.
An object describing an edge being added on the right-hand side of a transformation rule.
No Additional PropertiesThe source node of the edge, using the node naming scheme defined in the node
block.
The target node of the edge, using the node naming scheme defined in the node
block.
If true, then the subgraph induced by the nodes on the left-hand side of the rule must exactly match the subgraph as specified in the rule: no additional nodes within the subgraph are allowed.
A string that will be passed to JavaScript's eval
for evaluation, to test whether the match should proceed. Use $id.label for labels, $id.match[n] for n'th matching group, $$iter for iteration#, $$graph for graph.
A probabilistic weight that is used to determine which rules should be randomly applied, in the event that multiple patterns match.
The maximum number of times this rule can be used to transform the graph.
If a type
is specified, then any limit
specified for this rule is interpreted as the maximum number of times any rule with the same type
can be used.
The minimum number of times another transformation rule must be applied to the graph before this rule can be used.
The name of this grammar.
The maximum number of rule applications.
Default value of the induced
parameter, which governs the specificty of subgraph-matching. Can be overridden by the induced
parameter for stages and rules.
The start node label for the default initial graph.
A top-level grammar, consisting of one or more stages.
No Additional PropertiesThe successive stages to be applied. Each stage is a separate subgrammar of transformations.
Must contain a minimum of 1
items
A subgrammar, corresponding to an individual stage of graph transformation.
No Additional PropertiesThe list of subgraph transformation rules in this grammar.
Same definition as rulesThe name of this subgrammar.
The maximum number of rule applications.
Default value of the induced
parameter, which governs the specificty of subgraph-matching. Can be overridden by the induced
parameter for stages and rules.
The name of this grammar.
The maximum number of rule applications.
Default value of the induced
parameter, which governs the specificty of subgraph-matching. Can be overridden by the induced
parameter for stages and rules.
The start node label for the default initial graph.