Introduction
Graph Query Language (GQL) standard was published in 2024. The standard formalizes pattern matching which the workhorse of graph query languages. This pattern matching is represented as ASCII-art like syntax. At a high level, when evaluating a query, GQL keeps track of three things:- the working graph, which is the property graph we are using to match our patterns currently;
- the working table, that stores the information computed thus far; and
- the working record, which contains the tuple of the result we are currently using.
(a)-[:links_to]->{m,n}(b) selects all nodes b that are reachable from a by following one or more edges in the graph, traversing the graph using the :links_to relation. Recursive queries compute the transitive closure of the graph, and return the nodes in the graph that can be reached starting from a given one.