Skip to main content
QUICK REVIEW

[Paper Review] Graphical Conjunctive Queries

Filippo Bonchi, Jens Seeber|arXiv (Cornell University)|Apr 20, 2018
Logic, Reasoning, and KnowledgeComputer Science5 references6 citations
TL;DR

This paper introduces Graphical Conjunctive Queries (GCQ), a string diagram-based language with equivalent expressivity to the Calculus of Conjunctive Queries (CCQ). By modeling queries as cospans of hypergraphs and leveraging Carboni and Walters' cartesian bicategory of relations, the authors provide a sound and complete axiomatization of query inclusion, proving decidability and completeness via categorical model theory.

ABSTRACT

The Calculus of Conjunctive Queries (CCQ) has foundational status in database theory. A celebrated theorem of Chandra and Merlin states that CCQ query inclusion is decidable. Its proof transforms logical formulas to graphs: each query has a natural model - a kind of graph - and query inclusion reduces to the existence of a graph homomorphism between natural models. We introduce the diagrammatic language Graphical Conjunctive Queries (GCQ) and show that it has the same expressivity as CCQ. GCQ terms are string diagrams, and their algebraic structure allows us to derive a sound and complete axiomatisation of query inclusion, which turns out to be exactly Carboni and Walters' notion of cartesian bicategory of relations. Our completeness proof exploits the combinatorial nature of string diagrams as (certain cospans of) hypergraphs: Chandra and Merlin's insights inspire a theorem that relates such cospans with spans. Completeness and decidability of the (in)equational theory of GCQ follow as a corollary. Categorically speaking, our contribution is a model-theoretic completeness theorem of free cartesian bicategories (on a relational signature) for the category of sets and relations.

Motivation & Objective

  • To establish a diagrammatic, categorical foundation for conjunctive queries that mirrors the expressivity of the Calculus of Conjunctive Queries (CCQ).
  • To provide a sound and complete equational theory for query inclusion using string diagrams and hypergraph cospans.
  • To show that the equational theory of GCQ is decidable by linking it to the combinatorial structure of graph homomorphisms.
  • To demonstrate that free cartesian bicategories over a relational signature are complete models for the category of sets and relations.

Proposed method

  • Representing conjunctive queries as string diagrams in a symmetric monoidal category, where boxes denote relations and wires denote variables.
  • Formalizing GCQ terms as cospans of hypergraphs to capture query structure and variable sharing.
  • Applying the theory of cartesian bicategories of relations (Carboni and Walters) to derive a complete equational axiomatization of query inclusion.
  • Reducing query inclusion to the existence of a graph homomorphism between natural models, inspired by Chandra and Merlin’s theorem.
  • Establishing a correspondence between spans and cospans of hypergraphs to exploit combinatorial properties for completeness.
  • Proving completeness and decidability of the equational theory by leveraging the categorical structure of free cartesian bicategories.

Experimental results

Research questions

  • RQ1Can conjunctive queries be equivalently represented and reasoned about using a diagrammatic language based on string diagrams?
  • RQ2Is there a complete and sound equational axiomatization of query inclusion in this diagrammatic framework?
  • RQ3Does the categorical structure of cartesian bicategories of relations provide a foundation for proving decidability of query inclusion?
  • RQ4How do the natural models of CCQ queries relate to the structure of cospans of hypergraphs?
  • RQ5Can the completeness of free cartesian bicategories over a relational signature be established for the category of sets and relations?

Key findings

  • GCQ has the same expressive power as the Calculus of Conjunctive Queries (CCQ), establishing a diagrammatic equivalent.
  • The equational theory of GCQ is sound and complete for query inclusion, with the axioms corresponding exactly to those of a cartesian bicategory of relations.
  • Query inclusion in GCQ is decidable, following from the completeness and combinatorial structure of the underlying hypergraph cospans.
  • The paper proves a model-theoretic completeness theorem: free cartesian bicategories (on a relational signature) are complete models for the category of sets and relations.
  • A novel correspondence is established between spans and cospans of hypergraphs, which enables the reduction of query inclusion to graph homomorphism existence.
  • The result generalizes Chandra and Merlin’s decidability theorem by providing a categorical and diagrammatic proof framework.

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.