FO-Rewritability of Expressive Ontology-Mediated Queries

Cristina Feier, Antti Kuusisto, Carsten Lutz

Abstract

In the field of knowledge representation and database theory, a fundamental challenge is determining when a complex query, enriched by background knowledge from an ontology, can be simplified into a standard first-order (FO) query. This paper settles a long-standing question regarding the decidability of this problem for expressive ontology-mediated queries (OMQs). By bridging the gap between Description Logics and Constraint Satisfaction Problems (CSPs), the authors demonstrate that FO-rewritability is decidable and 2NExpTime-complete for logics such as $\mathcal{ALC}$ and $\mathcal{SHI}$ combined with Unions of Conjunctive Queries (UCQs).

Introduction

Ontology-Based Data Access (OBDA) allows users to query data while accounting for the semantic relationships defined in an ontology. While powerful, answering these queries directly is often computationally prohibitive. The "holy grail" of OBDA is FO-rewritability: the ability to transform a complex ontology-mediated query into a standard SQL-like query. If a query is FO-rewritable, it can be executed efficiently using highly optimized, off-the-shelf relational database systems.

While the decidability of FO-rewritability was previously established for simpler languages and atomic queries, it remained an open question for more expressive Description Logics (DLs) paired with Unions of Conjunctive Queries (UCQs). This paper fills that gap, providing a comprehensive complexity analysis and structural insights into the nature of these rewritings.

Methodology: From Logics to CSPs

The authors' approach relies on a sophisticated chain of reductions that connects the world of Description Logics to the theory of Constraint Satisfaction Problems (CSPs). The methodology follows four primary stages:

  1. Translation to MDDLog: The authors show that OMQs based on expressive DLs can be translated into Monadic Disjunctive Datalog (MDDLog). This formalism is equivalent in expressive power to MMSNP (Monadic Monotone SnP), a logic closely related to CSPs.
  2. Reduction to Generalized CSPs: Utilizing classical techniques, the MDDLog programs are transformed into generalized CSPs. This allows the authors to leverage the extensive theoretical framework already established for CSP rewritability.
  3. Girth Analysis and the Transfer Lemma: A significant technical hurdle in this reduction is that the equivalence between MDDLog and CSPs typically only holds on data structures without short cycles (high girth). To overcome this, the authors prove a "transfer lemma" (Lemma 1). This lemma demonstrates that if a query is FO-rewritable on high-girth structures, it is necessarily rewritable on all structures.
  4. Complexity Mapping: By analyzing the "blowup" in size during these translations and applying known NP-completeness results for CSP rewritability, the authors derive the final complexity bounds.

Key Insights and Structural Results

The Decidability Frontier

The paper pushes the boundaries of formal decidability. It proves that even for highly expressive ontologies like $\mathcal{SHI}$, we can algorithmically determine if a query is "simple enough" for a standard database. This provides a theoretical foundation for building more intelligent query optimizers in OBDA systems.

The Girth Trick

The most elegant technical contribution is the realization that we only need to consider "locally tree-like" data. The transfer lemma ensures that the behavior of a query on these restricted structures is representative of its behavior on arbitrary, complex data structures. This simplifies the analysis of rewritability significantly.

The Shape of Rewritings

The research reveals that if a rewriting exists, it is not an arbitrary FO query. Specifically, for a Boolean MDDLog program of diameter $k$, any FO-rewriting takes the form of a Union of Conjunctive Queries (UCQ) where each component has a treewidth bounded by $(1, k)$. This provides a concrete search space for algorithms attempting to generate actual SQL rewritings.

Complexity and Results

The paper establishes that deciding FO-rewritability for OMQs based on $(\mathcal{ALC}, \text{UCQ})$ and $(\mathcal{SHI}, \text{UCQ})$ is 2NExpTime-complete. While this doubly exponential non-deterministic time complexity is high, it reflects the inherent difficulty of reasoning with expressive logics. More importantly, it moves the problem from the realm of the unknown into the realm of the decidable.

Conclusion and Future Work

This work provides a definitive answer to a major theoretical question in knowledge representation. However, several challenges remain:

  • Computational Practicality: The 2NExpTime-complete bound suggests that worst-case scenarios are extremely difficult. Future work must focus on heuristics to make these checks viable in real-world systems.
  • Unrestricted Datalog: The current study focuses on monadic disjunctive Datalog. The authors are currently investigating "unrestricted" Datalog, which allows relations with multiple slots—a significantly more complex problem.
  • Algorithmic Production: While the paper identifies the shape of rewritings, it does not provide an optimized algorithm for producing the most efficient possible SQL query. Bridging the gap between the decision problem and the construction problem remains a key area for future research.

Summary updated

BibTeX
@inproceedings{feier2016fo,
  author = {Cristina Feier and Antti Kuusisto and Carsten Lutz},
  title = {{FO-Rewritability of Expressive Ontology-Mediated Queries}},
  booktitle = {Description Logics},
  year = {2016},
}
Figure