Graphical Conjunctive Queries

04/20/2018
by   Filippo Bonchi, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/16/2020

Completeness of Nominal PROPs

We introduce nominal string diagrams as string diagrams internal in the ...
research
04/16/2019

Nominal String Diagrams

We introduce nominal string diagrams as, string diagrams internal in the...
research
03/01/2012

Pictures of Processes: Automated Graph Rewriting for Monoidal Categories and Applications to Quantum Computing

This work is about diagrammatic languages, how they can be represented, ...
research
03/14/2022

Relational Diagrams: a pattern-preserving diagrammatic representation of non-disjunctive Relational Queries

Analyzing relational languages by their logical expressiveness is well u...
research
12/06/2022

Synthesizing nested relational queries from implicit specifications: via model theory and via proof theory

Derived datasets can be defined implicitly or explicitly. An implicit de...
research
10/13/2022

Soundness and Completeness of SPARQL Query Containment Solver SpeCS

Tool SPECS implements an efficient automated approach for reasoning abou...
research
06/14/2021

String Diagrammatic Electrical Circuit Theory

We develop a comprehensive string diagrammatic treatment of electrical c...

Please sign up or login with your details

Forgot password? Click here to reset