First Order-Rewritability and Containment of Conjunctive Queries in Horn Description Logics

Meghyn Bienvenu, Peter Hansen, Carsten Lutz, Frank Wolter

TL;DR

This paper explores the computational limits of translating complex ontology-mediated queries into standard SQL (First-Order logic). The authors reveal a surprising "complexity jump": while most common ontology queries are relatively easy to handle, adding "inverse roles" (the ability to traverse relationships in both directions) makes the problem exponentially harder, jumping from EXPTIME to 2EXPTIME complexity.

What Problem Does This Paper Address?

In the world of "Ontology-Mediated Query Answering" (OMQA), we use ontologies to add background knowledge to incomplete data. For example, an ontology might know that "every Professor is a Faculty Member," so a query for faculty members should also return professors, even if they aren't explicitly labeled as such in the database.

The gold standard for efficiency is FO-rewritability. If a query combined with an ontology can be rewritten into a First-Order (FO) logic query—essentially a standard SQL query—we can run it directly on existing, highly optimized database systems.

However, not all queries are FO-rewritable. This paper tackles two critical questions:

  1. Characterization: Under what semantic conditions is a query FO-rewritable?
  2. Complexity: How hard is it to decide if a given query can be rewritten, and how hard is it to determine if one query is "contained" within another (query containment)?

Methods

The authors employ a mix of semantic analysis and heavy-duty computational theory:

  • Semantic Characterization: They define "pseudo tree ABoxes"—a specific way of structuring data—to identify the boundaries of when a query can be simplified into FO logic.
  • Automata-Based Approach: To prove upper complexity bounds, they translate the problem into the language of Two-way Alternating Parity Automata (TWAPAs). By checking if these automata accept certain tree-structured data, they can decide rewritability.
  • Complexity Reductions: For lower bounds, they use reductions from "tiling problems" and "word problems" for exponentially space-bounded Turing machines.
  • Normalization: They provide a way to simplify complex ontologies (Horn-$\mathcal{SHIF}$) into a normal form ($\mathcal{ELIHF}_\perp$) without losing the ability to answer queries, making the proofs more manageable.

Datasets

This is a theoretical research paper focused on proving complexity classes and logical characterizations. As such, it does not use empirical datasets or benchmarks for training or evaluation. It builds upon theoretical frameworks established in previous literature (e.g., the $\mathcal{EL}$ family of description logics).

Key Insights and Ideas

  • The "Inverse Role" Penalty: The most significant finding is that inverse roles (e.g., knowing that if $x$ is the parent of $y$, then $y$ is the child of $x$) drastically increase complexity for Conjunctive Queries (CQs), but not for simpler Atomic Queries (AQs). This highlights a specific interaction between query structure and relationship directionality.
  • Rooted Queries are Easier: The authors show that for "rooted" CQs—queries that are connected and have at least one answer variable—the complexity drops from 2EXPTIME to CONEXPTIME. Since most real-world queries are rooted, this is a silver lining for practitioners.
  • Query Size vs. Ontology Size: While 2EXPTIME sounds terrifying, the authors point out that the "double exponential" part only applies to the size of the query (usually very small), while the complexity remains "single exponential" relative to the ontology (which can be very large).
  • Closing Open Problems: The paper also solves a long-standing open problem in database theory regarding the complexity of monadic Datalog containment.

Key Results

The paper establishes a hierarchy of complexity for deciding FO-rewritability and containment:

  • EXPTIME-complete: For logics between $\mathcal{EL}$ and $\mathcal{ELHF}_\perp$ (no inverse roles).
  • 2EXPTIME-complete: For logics between $\mathcal{ELI}$ and $\text{Horn-}\mathcal{SHIF}$ (with inverse roles).
  • CONEXPTIME-complete: When restricted to rooted CQs in logics with inverse roles.
  • UCQ-Rewriting: The authors prove that if a query is FO-rewritable in these logics, it can always be effectively constructed as a Union of Conjunctive Queries (UCQ).

Limitations and Future Work

  • Practical Algorithms: The algorithms described are "decision procedures" designed to prove complexity bounds. They are not yet optimized for real-world performance. The authors suggest that the next step is to turn these theoretical insights into practically efficient rewriting engines.
  • Signature Restrictions: An open theoretical question remains: what happens to the complexity if the data is allowed to use all possible concept and role names, rather than being restricted to a specific "ABox signature"?
  • Transitive Roles: The current work excludes transitive roles in the queries themselves, as this adds significant layers of logical complication that were outside the scope of this study.

Summary updated

BibTeX
@inproceedings{bienvenu2016first,
  author = {Meghyn Bienvenu and Peter Hansen and Carsten Lutz and Frank Wolter},
  title = {{First Order-Rewritability and Containment of Conjunctive Queries in Horn Description Logics}},
  booktitle = {Description Logics},
  year = {2016},
}
Figure