Table of Contents
Fetching ...

On the Expressiveness of Languages for Querying Property Graphs in Relational Databases

Hadar Rotschield, Liat Peterfreund

TL;DR

The paper analyzes the expressive power of SQL/PGQ for querying property graphs defined as relational views, introducing three fragments: $ extsc{PGQ}^{ro}$, $ extsc{PGQ}^{rw}$, and $ extsc{PGQ}^{ext}$. It demonstrates that graph-view construction is the critical factor in expressiveness and establishes a strict hierarchy $ extsc{PGQ}^{ro} ull< extsc{PGQ}^{rw} ull< extsc{PGQ}^{ext}$, with $ extsc{PGQ}^{ext}$ equaling $FO[TC]$ and capturing all $NL$ queries on ordered structures; for unary identifiers this reduces to $FO[TC^{1}]$, while higher arities yield $FO[TC^{n}]$, which collapses to $FO[TC^{2}]$ for $n eq 1$. The results also show that allowing $n$-ary identifiers lifts the language to full $NL$ expressiveness, and that on ordered structures the arity-collapsing behavior mirrors the classical transitive-closure collapse. Collectively, the work provides a precise descriptive-complexity account of how graph views and identifier arities determine the recursion and path-query capabilities of SQL/PGQ, informing standardization and implementation for graph-aware relational engines.

Abstract

SQL/PGQ is the emerging ISO standard for querying property graphs defined as views over relational data. We formalize its expressive power across three fragments: the read-only core, the read-write extension, and an extended variant with richer view definitions. Our results show that graph creation plays a central role in determining the expressiveness. The read-only fragment is strictly weaker than the read-write fragment, and the latter is still below the complexity class NL. Extending view definitions with arbitrary arity identifiers closes this gap: the extended fragment captures exactly NL. This yields a strict hierarchy of SQL/PGQ fragments, whose union covers all NL queries. On ordered structures the hierarchy collapses: once arity-2 identifiers are allowed, higher arities add no power, mirroring the classical transitive-closure collapse and underscoring the central role of view construction in property graph querying.

On the Expressiveness of Languages for Querying Property Graphs in Relational Databases

TL;DR

The paper analyzes the expressive power of SQL/PGQ for querying property graphs defined as relational views, introducing three fragments: , , and . It demonstrates that graph-view construction is the critical factor in expressiveness and establishes a strict hierarchy , with equaling and capturing all queries on ordered structures; for unary identifiers this reduces to , while higher arities yield , which collapses to for . The results also show that allowing -ary identifiers lifts the language to full expressiveness, and that on ordered structures the arity-collapsing behavior mirrors the classical transitive-closure collapse. Collectively, the work provides a precise descriptive-complexity account of how graph views and identifier arities determine the recursion and path-query capabilities of SQL/PGQ, informing standardization and implementation for graph-aware relational engines.

Abstract

SQL/PGQ is the emerging ISO standard for querying property graphs defined as views over relational data. We formalize its expressive power across three fragments: the read-only core, the read-write extension, and an extended variant with richer view definitions. Our results show that graph creation plays a central role in determining the expressiveness. The read-only fragment is strictly weaker than the read-write fragment, and the latter is still below the complexity class NL. Extending view definitions with arbitrary arity identifiers closes this gap: the extended fragment captures exactly NL. This yields a strict hierarchy of SQL/PGQ fragments, whose union covers all NL queries. On ordered structures the hierarchy collapses: once arity-2 identifiers are allowed, higher arities add no power, mirroring the classical transitive-closure collapse and underscoring the central role of view construction in property graph querying.

Paper Structure

This paper contains 34 sections, 15 theorems, 75 equations, 6 figures.

Key Result

Theorem 4.1

$\textsc{PGQ}^{\textsc{rw}}$ is strictly more expressive than $\textsc{PGQ}^{\textsc{ro}}$.

Figures (6)

  • Figure 1: Syntax of Patterns and Output Patterns.
  • Figure 2: Semantics of Patterns and Output Patterns.
  • Figure 3: Syntax of $\textsc{PGQ}^{\textsc{ro}}$, $\textsc{PGQ}^{\textsc{rw}}$, and $\textsc{PGQ}^{\textsc{ext}}$: Each part shows the additions to the previous fragment: $\textsc{PGQ}^{\textsc{rw}}$ extends $\textsc{PGQ}^{\textsc{ro}}$ with constants and pattern matching on query results, and $\textsc{PGQ}^{\textsc{ext}}$ further extends $\textsc{PGQ}^{\textsc{rw}}$ with pattern matching on more elaborate query results.
  • Figure 4: Semantics of core PGQ queries.
  • Figure 5: Illustration of the view-construction step in Example \ref{['ex:ex-incr-edges']}.
  • ...and 1 more figures

Theorems & Definitions (35)

  • Definition 2.1: Property Graphs
  • Remark 2.1
  • Definition 3.1
  • Definition 3.2
  • Theorem 4.1
  • Theorem 4.2
  • Definition 5.1
  • Remark 5.1
  • Definition 5.2
  • Definition 5.3
  • ...and 25 more