GQL conformance#
AgensGraph implements part of ISO/IEC 39075:2024, Information technology — Database languages — GQL. This appendix is not a full statement of conformance. It covers the main topics in as much detail as is reasonable and useful.
The tables below are keyed by subclause of the standard, because that is the unit the standard itself uses to attach a conformance rule to a piece of syntax. Every row was checked against a running 2.18 server. A row says Yes only when the syntax the subclause defines was accepted and produced the result the subclause requires. It says Partial when some of the subclause’s syntax is accepted and the rest raises an error, and No when none of it parses. Where the standard offers several spellings of the same idea, the comment says which one AgensGraph takes.
Three general points hold across every row and are not repeated in each comment.
GQL is not a separate mode. A GQL statement and a Cypher statement go through the same
parser and may be mixed in one pipeline, so LET sits next to WITH and INSERT next to
CREATE. See Cypher, GQL and SQL.
A graph is a PostgreSQL schema and a label is a table. So the parts of the standard that
describe a catalog of directories, schemas and graph types have a PostgreSQL counterpart
rather than a GQL one. The working graph comes from the graph_path setting instead of a
USE clause, and privileges are PostgreSQL privileges. See How a graph is stored.
Errors carry a five-character SQLSTATE, not a GQLSTATUS. See Error codes.
Supported features#
These subclauses are wholly or partly implemented. A Partial comment names what is missing, so that a reader porting standard GQL knows what to look for.
Subclause |
Name |
Support |
Comment |
|---|---|---|---|
8.1–8.4 |
|
Yes |
PostgreSQL’s own transaction statements answer these. |
9.2 |
|
Partial |
|
11.1 |
|
Partial |
|
12.4 |
|
Partial |
|
12.5 |
|
Partial |
|
13.1 |
|
Yes |
A statement composes read clauses and write clauses in one pipeline, and a write clause’s changes are visible to a read clause after it. |
13.2 |
|
Yes |
|
13.3 |
|
Partial |
Property assignment works, including the non-standard |
13.4 |
|
Partial |
|
13.5 |
|
Yes |
|
14.2 |
|
Partial |
|
14.3 |
|
Yes |
A query is a sequence of the primitive query statements below, ending in a primitive result statement. |
14.4 |
|
Partial |
|
14.5 |
|
Partial |
Both call forms work. See 15.2 and 15.3 for what each one requires. |
14.6 |
|
Yes |
Both |
14.7 |
|
Yes |
Additive, row-wise, and able to lead a query. An aggregate in a |
14.8 |
|
Partial |
Iterating a list works, with |
14.9 |
|
Yes |
|
14.10 |
|
Yes |
|
14.11 |
|
Partial |
|
15.1 |
|
Yes |
|
15.2 |
|
Partial |
|
15.3 |
|
Partial |
|
16.3 |
|
Partial |
A graph pattern produces a binding table. The pattern |
16.4 |
|
Partial |
Comma-separated path patterns work. The match modes ( |
16.5 |
|
Yes |
The pattern after |
16.7 |
|
Partial |
Concatenation works. Path multiset alternation and path pattern union — two path patterns separated by |
16.8 |
|
Partial |
A single label name only. Disjunction ( |
16.9 |
|
Yes |
|
16.10 |
|
Yes |
A pattern variable is in scope for every clause after it. |
16.11 |
|
Partial |
The edge quantifier |
16.13 |
|
Partial |
|
16.16 |
|
Yes |
Multiple sort keys, |
16.17 |
|
Yes |
As 16.16. An integer sort key is a constant, not an output-column number — see Cypher compatibility. |
16.18 |
|
Yes |
|
16.19 |
|
Yes |
Both spellings the subclause defines, |
19.1 |
|
Yes |
A condition takes a boolean and nothing else, which is what the subclause requires. |
19.2 |
|
Partial |
The four predicates below. The nine others 19.6–19.13 defines are not supported. |
19.3 |
|
Yes |
|
19.4 |
|
Partial |
Four of the five forms the subclause defines: |
19.5 |
|
Yes |
|
20.1 |
|
Yes |
Operators, function calls, |
20.2 |
|
Yes |
Literals, variables, property references, parenthesized expressions. |
20.3 |
|
Partial |
|
20.6 |
|
Yes |
|
20.7 |
|
Yes |
Both the searched and the simple form, plus |
20.8 |
|
Partial |
The |
20.9 |
|
Partial |
|
20.11 |
|
Yes |
|
20.12 |
|
Yes |
Names bound by a pattern, |
20.13 |
|
Partial |
A path bound by |
20.15 |
|
Partial |
|
20.17 |
|
Partial |
As 20.15. |
20.18 |
|
Partial |
|
20.19 |
|
Yes |
Field access on a map, |
20.20 |
|
Yes |
|
20.21 |
|
Yes |
|
20.22 |
|
Yes |
|
20.23 |
|
Yes |
Concatenation with |
20.24 |
|
Partial |
|
20.26 |
|
Partial |
Date and timestamp arithmetic through PostgreSQL’s types. |
20.27 |
|
Partial |
|
21.1 |
Names and variables |
Partial |
An unquoted identifier folds to lower case; a double-quoted identifier keeps its case. The standard’s backtick-delimited identifier is a syntax error. |
21.2 |
|
Partial |
Integers including hexadecimal, octal, binary and underscore-separated forms; floats; strings; |
21.3 |
|
Partial |
|
Features not supported#
None of the syntax these subclauses define is accepted. The comment gives the AgensGraph route to the same result where there is one.
Subclause |
Name |
Support |
Comment |
|---|---|---|---|
7.1 |
|
No |
|
7.2 |
|
No |
Use |
7.3 |
|
No |
Close the connection. |
7.4 |
|
No |
None. |
10.1 |
|
No |
None. A query addresses one graph, named by |
10.2 |
|
No |
A |
10.3 |
|
No |
Use |
11.2 |
|
No |
None. |
11.3 |
|
No |
None. |
12.1 |
|
No |
Catalog changes are PostgreSQL DDL statements and are not composable into a query pipeline. |
12.2 |
|
No |
A graph is a schema; |
12.3 |
|
No |
|
12.6 |
|
No |
None. A label is untyped, except for a property promoted to a column, which acquires that column’s type. See |
12.7 |
|
No |
None. |
12.8 |
|
No |
None. |
13.6 |
|
No |
A write clause inside a |
14.1 |
|
No |
The optional |
14.12 |
|
No |
|
16.1 |
|
No |
A statement runs in the database it is connected to. |
16.2 |
|
No |
|
16.6 |
|
No |
Neither the path modes ( |
16.12 |
|
No |
The |
16.15 |
|
No |
An explicit |
17.1–17.8 |
|
No |
An object is named by a PostgreSQL schema-qualified name. The standard’s directory paths, |
18.1–18.10 |
|
No |
None. |
19.6 |
|
No |
|
19.7 |
|
No |
None. |
19.8 |
|
No |
Every edge is directed. |
19.9 |
|
No |
|
19.10 |
|
No |
|
19.11 |
|
No |
Compare identities pairwise. |
19.12 |
|
No |
|
19.13 |
|
No |
|
20.4 |
|
No |
The driver’s parameter placeholder, |
20.5 |
|
No |
|
20.10 |
|
No |
|
20.14 |
|
No |
A path comes from a pattern, not from a constructor. |
20.16 |
|
No |
|
20.25 |
|
No |
PostgreSQL’s |
20.28 |
|
No |
PostgreSQL’s |
20.29 |
|
No |
|
21.4 |
|
No |
The lexer is PostgreSQL’s, extended for Cypher; it does not implement the standard’s character set rules. |
22.1–22.20 |
Additional common rules |
No |
These subclauses define the standard’s evaluation machinery rather than syntax. AgensGraph evaluates a query through the PostgreSQL planner and executor, so they are not implemented as written. |
23.1 |
GQLSTATUS |
No |
An error carries a SQLSTATE. See Error codes. |
23.2 |
Diagnostic records |
No |
Diagnostics come from PostgreSQL’s error report fields. |
Extensions beyond the standard#
AgensGraph accepts a good deal that ISO/IEC 39075 does not define. Some of it is openCypher, which the product supported first. Some of it exists because a graph here is stored in PostgreSQL and both halves are addressable.
Extension |
What it adds |
|---|---|
A SQL statement over a Cypher subquery, and Cypher over a label table |
A Cypher query is a table expression and a label is a table, so one statement can join graph and relational data. See SQL and Cypher. |
|
Creates graph elements from the rows of a relation, including a foreign table. See Loading data. |
Label inheritance |
|
|
Merges a map into the properties instead of replacing them. |
|
Weighted and unweighted shortest-path search, in place of the standard’s path search prefixes. |
Promoted properties |
|
Graph DDL |
|
openCypher clauses |
|
|
Four subquery value expressions the standard has no form for — 20.9 defines only |
openCypher operators and functions |
|
PostgreSQL’s whole surface |
Every SQL type, function, index method, extension and setting is available to a graph query, which is how vector and full-text search work. See vector search. |
See also#
Cypher, GQL and SQL — how the three languages relate in one statement
Cypher compatibility — where AgensGraph differs from other Cypher implementations
Keywords — the words the standard’s new statements reserved
AgensGraph 2.18.6.1 release notes — the GQL statements this release added