Skip to main content
QUICK REVIEW

[Paper Review] Database Theory in Action: Cypher, GQL, and Regular Path Queries

Alin Deutsch, Nadime Francis|arXiv (Cornell University)|Dec 12, 2021
Semantic Web and OntologiesComputer Science3 citations
TL;DR

This paper presents GPML (Graph Pattern Matching Language), the core query language standard shared by GQL and SQL/PGQ, unifying property graph querying across SQL and native graph databases. It formalizes path pattern matching with variables, path bindings, and multiplicity-aware aggregation, enabling consistent, standardized graph pattern matching across industrial and academic systems.

ABSTRACT

As graph databases become widespread, JTC1 -- the committee in joint charge of information technology standards for the International Organization for Standardization (ISO), and International Electrotechnical Commission (IEC) -- has approved a project to create GQL, a standard property graph query language. This complements a project to extend SQL with a new part, SQL/PGQ, which specifies how to define graph views over an SQL tabular schema, and to run read-only queries against them. Both projects have been assigned to the ISO/IEC JTC1 SC32 working group for Database Languages, WG3, which continues to maintain and enhance SQL as a whole. This common responsibility helps enforce a policy that the identical core of both PGQ and GQL is a graph pattern matching sub-language, here termed GPML. The WG3 design process is also analyzed by an academic working group, part of the Linked Data Benchmark Council (LDBC), whose task is to produce a formal semantics of these graph data languages, which complements their standard specifications. This paper, written by members of WG3 and LDBC, presents the key elements of the GPML of SQL/PGQ and GQL in advance of the publication of these new standards.

Motivation & Objective

  • To define a common, standardized graph pattern matching language (GPML) for both GQL and SQL/PGQ to ensure interoperability across property graph systems.
  • To formalize the semantics of GPML to support precise, consistent query evaluation across diverse implementations.
  • To unify the core query language of GQL and SQL/PGQ under a single specification, leveraging shared design principles from ISO/IEC JTC1 SC32 WG3.
  • To address the lack of a standard property graph query language despite widespread adoption of property graph databases.
  • To support practical, real-world graph workloads by incorporating features like path binding, aggregation, and cycle handling from industrial languages like Cypher and PGQL.

Proposed method

  • Define GPML as a shared sublanguage for GQL and SQL/PGQ, based on conjunctive regular path queries (CRPQs) extended with path variables and multiplicity-sensitive aggregation.
  • Formalize path pattern matching using variable bindings to nodes and edges, with support for path-level variables and property access.
  • Introduce a fine-grained matching semantics that distinguishes between different path bindings and supports filtering via path restrictors (e.g., simple path, trail).
  • Leverage existing industrial query languages (Cypher, PGQL, GSQL) as design foundations, while abstracting away vendor-specific syntax.
  • Use the LDBC academic working group to develop formal semantics that complement the standard specifications.
  • Ensure identical evaluation behavior for the same pattern across GQL and SQL/PGQ by unifying the core GPML engine logic.

Experimental results

Research questions

  • RQ1How can a common graph pattern matching language be designed to unify GQL and SQL/PGQ while preserving their distinct use cases?
  • RQ2What formal semantics are required to ensure consistent and predictable evaluation of path patterns across different systems?
  • RQ3How do path restrictors (e.g., simple path, trail) affect the computational complexity and practical usability of graph queries?
  • RQ4What features from existing industrial languages (e.g., Cypher, PGQL) are essential to include in GPML for real-world expressiveness?
  • RQ5How can path-level variables and aggregation over paths be formally defined and integrated into a standardized query language?

Key findings

  • GPML is formally defined as the shared core of both GQL and SQL/PGQ, ensuring identical evaluation of path patterns across the two standards.
  • The language supports path variables and multiplicity-aware aggregation (e.g., count, sum, average), enabling more expressive and semantically precise queries than traditional CRPQs.
  • Path restrictors such as 'simple path' and 'trail' are reintroduced with formal semantics, resolving prior concerns about high computational complexity through careful design.
  • The formal semantics developed by the LDBC academic group provide a rigorous foundation that complements the normative specifications of GQL and SQL/PGQ.
  • The integration of GPML into both standards ensures that the same query will produce identical results regardless of whether it is executed in a native graph database (GQL) or via a SQL-based graph view (SQL/PGQ).
  • The design successfully balances expressiveness with performance, supporting complex graph patterns while avoiding non-termination issues through controlled path enumeration.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.