← Latest papers
💻 computer science

A Compositional Language for Property Graphs

This paper addresses the lack of compositionality in the standardized graph query languages GQL and SQL/PGQ by proposing a new compositional language that combines regular path queries with a fully compositional graph-to-graph #Datalog extension to bridge expressivity gaps and enable the construction of new graph elements.

Original authors: Marcelo Arenas, Leonid Libkin, Wim Martens

Published 2026-06-23
📖 5 min read🧠 Deep dive

Original authors: Marcelo Arenas, Leonid Libkin, Wim Martens

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to give directions to a friend using a map. In the world of data, this map is called a Property Graph. It's a network of dots (people, accounts, products) and lines (relationships, transfers, connections) where every dot and line can have little notes attached to them, like "balance" or "timestamp."

Recently, two new official rulebooks for asking questions about these maps were created: GQL and SQL/PGQ. Think of these as the "traffic laws" for navigating data. The authors of this paper argue that these new rulebooks have a major flaw: they aren't compositional.

The Problem: The "Broken Chain"

To understand "compositionality," imagine you are building a chain of paperclips.

  • Compositional: You can take a finished chain, look at the last link, and immediately attach the next link to it. The whole thing stays connected.
  • Non-Compositional (The current problem): In the new rulebooks, if you build a chain of connections and then try to add another link to the end, the system forgets the details of the previous links. It's like trying to build a chain, but every time you add a new link, the system drops the previous one and starts over with a blank slate.

The Real-World Example:
The paper gives a banking example.

  1. Easy Query: "Find two bank accounts where the money increases with every transfer between them." The current rulebooks can do this easily.
  2. The Hard Query: "Find two bank accounts where the time of the transfers increases with every step."
    • Imagine a chain of transfers happening at 11:00, 12:00, 1:00, and 2:00.
    • The current rulebooks fail here. Why? Because when they try to check the time of the next transfer, they lose the memory of the previous transfer's time. They can't "glue" the steps together to see the whole increasing timeline.

This is strange because these rulebooks are supposed to be powerful enough to solve almost any logical puzzle (mathematically, they should handle "NLOGSPACE" problems), but this simple "increasing time" puzzle breaks them.

The Solution: Two New Tools

The authors propose two new tools to fix this broken chain. Think of them as a better pair of scissors and a new type of glue.

Tool 1: The "Symmetric Path" (RPQVs)

Currently, the rulebooks treat Nodes (dots) and Edges (lines) differently. It's like a game where you can only step on the dots, but the lines between them are invisible or behave strangely.

  • The Fix: The authors propose a new way to write paths where dots and lines are treated equally. You can start on a line, end on a line, and the system remembers every single step and its details (like time or amount) without dropping the memory.
  • The Analogy: Instead of a game where you have to jump from island to island, forgetting the bridge you just crossed, this new tool lets you walk across the bridges while keeping a running diary of every step you took.

Tool 2: The "Graph Builder" (#Datalog)

Sometimes, the answer to a question isn't just finding a path; it's building a new map based on the old one.

  • The Fix: The authors introduce a language called #Datalog. This allows you to take the results of a query and turn them into brand new dots and lines on the map.
  • The Analogy: Imagine you have a map of a city. You find all the streets with increasing traffic. Instead of just listing them, #Datalog lets you take those streets and physically build a new highway connecting them. You can then ask questions about this new highway.
  • This creates a feedback loop: You query the map \rightarrow You build a new part of the map \rightarrow You query the new part. The current rulebooks don't allow you to build the new part; they only let you look at the old one.

The Result: A Complete Toolkit

By combining these two tools, the authors show that you can finally ask any logical question about the graph that a computer can reasonably solve, without needing to use complicated, slow workarounds that make the computer crash or run for hours.

They propose adding these features to the official GQL and SQL/PGQ standards.

  • Backward Compatibility: They promise that adding these new tools won't break existing queries. It's like adding a new lane to a highway; the old cars can still drive in the old lanes, but now there's a fast lane for complex trips.
  • The Goal: To make sure that the "traffic laws" for data graphs are logical, consistent, and powerful enough to handle the complex reasoning needed for things like fraud detection, supply chains, and financial analysis.

In short, the paper says: "The new rulebooks for data graphs are missing a key piece of logic that makes them forget the past. We have designed a simple, elegant fix that lets the system remember the whole journey and even build new roads while it's driving, making the language complete and ready for the future."

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →