The page describes how Spanner Graph supports the ISO international standard query language for graph databases.
Spanner Graph is based on two ISO standards:
- ISO/IEC 9075-16:2023 - Information technology — Database languages SQL Property Graph Queries (SQL/PGQ) , Edition 1, 2023
- ISO/IEC 39075:2024 - Information technology — Database languages — GQL , Edition 1, 2024
The following tables describe the high-level relationship between SQL/PGQ, GQL, and how Spanner Graph supports these standards.
Standard | SQL/PGQ | GQL | Spanner Graph | |
---|---|---|---|---|
Query
|
Graph pattern matching capabilities | Shares the core Graph Pattern Matching Language (GPML) functionalities with GQL. | Shares the core GPML functionalities with SQL/PGQ. | Both standards are supported. For more information, see Spanner Graph GQL patterns . |
Query
|
Other query language features (for example, LIMIT
, ORDER
, aggregation) |
SQL-based. | Similar to SQL, but the GQL query features are linearly composable graph query statements. | Both standards are supported. For more information, see Spanner Graph GQL query statements and Query syntax in GoogleSQL . |
Query
|
Graph and table interoperability | Supported. | Not supported. | Both standards are supported. For more information, see GRAPH_TABLE
operator
. |
Types
|
Data types, functions and expressions in SQL/PGQ and GQL are similar. | Data types, functions and expressions in SQL/PGQ and GQL are similar. | Supports most data types and expressions in SQL/PGQ and GQL. For more information, see Data types in GoogleSQL . | |
DML
|
SQL/PGQ inherits DML from SQL. | Graph-based DML is supported. | Supports SQL table-based DML. For more information, see the GoogleSQL data manipulation language . | |
Schema
|
Supports using CREATE PROPERTY GRAPH
from tables. |
Supports using CREATE PROPERTY GRAPH
with open types and closed types. |
Supports the SQL/PGQ method. For more information, see the CREATE PROPERTY GRAPH
definition. |
SQL/PGQ support
Standard | SQL/PGQ feature ID | Spanner Graph |
---|---|---|
Query (Graph and table interoperability)
|
Feature G900: GRAPH_TABLE
|
Supported. For more information, see GRAPH_TABLE
operator. |
Schema
|
Feature G924: Explicit key clause for element tables. This implies a claim of conformance to Feature G920: DDL-based SQL-property graphs. | Supported. For more information, see CREATE_PROPERTY_GRAPH
statement
. |
Schema
|
Feature G925: Explicit label and properties clause for element tables. This implies a claim of conformance to Feature G920: DDL-based SQL-property graphs. | Supported. For more information, see CREATE_PROPERTY_GRAPH
statement
. |
Query (GPML)
|
Feature G001: Repeatable-elements match mode. | Supported. Repeatable elements match mode is the default semantic. Explicit repeatable elements match mode clause syntax is not supported. |
Query (GPML)
|
Feature G008: Graph pattern WHERE
clause. This implies a claim of conformance to Feature G000: Graph pattern. |
Supported. For more information, see Graph pattern . |
Query (GPML)
|
Feature G034: Path concatenation. | Supported. For more information, see see Graph pattern . |
Query (GPML)
|
Feature G040: Vertex pattern. | Supported. For more information, see Element pattern . |
Query (GPML)
|
Feature G042: Basic full edge patterns. | Supported. For more information, see Element pattern . |
Query (GPML)
|
Feature G070: Label expression: label disjunction. | Supported. For more information, see Label expression . |
Query (GPML)
|
Feature G073: Label expression: individual label name. | Supported. For more information, see Label expression . |
Query (GPML)
|
Feature G090: Property reference. | Supported. |
GQL support
- Feature GG20: Explicit element type names.
- Feature GG21: Explicit element type key label sets.
- Feature GG22: Element type key label set inference.
- Feature GG22: Element type key label set inference.
- Feature GG23 Optional element type key label sets.
Spanner Graph doesn't support the exact same
CREATE_GRAPH_TYPE
statement as GQL. However, the CREATE_PROPERTY_GRAPH
statement
supported by Spanner Graph is closely related to GG02 (with similar support for GG20, GG21, GG22, and GG23).- The character string type specified by
STRING
orVARCHAR
.
- The boolean type specified by
BOOLEAN
orBOOL
.
- The signed regular integer type specified by
SIGNED INTEGER
,INTEGER
, orINT
.
- The approximate numeric type specified by
FLOAT
."
Additional features
The features listed in the previous sections are the minimal conformance features of the standards. Spanner Graph supports additional features in the ISO standards. To learn more, see Spanner Graph schema overview and GQL overview .