Conjunctive Query Answering in EL using a Database System

Carsten Lutz, David Toman, Frank WolterOWLED 2008

Introduction

The Web Ontology Language (OWL) has become a cornerstone for structuring knowledge in complex domains, particularly within the life sciences. The OWL2-EL profile, based on the $\mathcal{EL}$ family of description logics, is widely adopted for massive ontologies such as SNOMED CT and the NCI Thesaurus. As these ontologies scale to include millions of instance records (the ABox), there is a growing need to leverage the performance and scalability of off-the-shelf relational database management systems (RDBMS) for query answering.

However, bridging the gap between ontology-based reasoning and relational databases is non-trivial. This paper introduces a novel hybrid approach that enables answering conjunctive queries (CQs) over $\mathcal{EL}$ ontologies using standard SQL databases, overcoming theoretical hurdles that previously limited the use of RDBMS for this specific logic.

The Semantic Gap: Open vs. Closed Worlds

The primary challenge in using relational databases for ontology reasoning lies in their conflicting semantic foundations:

  1. Closed-World Semantics (RDBMS): Databases assume that if a fact is not explicitly present in the data, it is false.
  2. Open-World Semantics (OWL): Ontologies assume that missing information is simply unknown. Furthermore, rules in the ontology (the TBox) can imply the existence of individuals not explicitly named in the data.

Existing solutions for other OWL profiles do not translate well to $\mathcal{EL}$. For instance, OWL2-QL allows for pure "backward chaining" (rewriting the query), but query answering in $\mathcal{EL}$ is PTime-hard, making it too complex for simple rewriting alone. Conversely, OWL2-RL often uses "forward chaining" (materializing all inferred facts), but $\mathcal{EL}$ allows for existential restrictions (e.g., "Every cell has a nucleus"). These restrictions can trigger an infinite chain of inferences, leading to an infinite model that cannot be stored in a finite database.

The Hybrid Approach

The authors propose a two-phase method that combines the strengths of materialization and query rewriting to handle the complexities of $\mathcal{EL}$.

1. Data Preprocessing (Finite Materialization)

Instead of attempting to materialize an infinite tree of inferred objects, the system computes a "canonical model" that is guaranteed to be finite. This is achieved by collapsing the potentially infinite structure into a cyclic, finite representation. To represent anonymous individuals inferred by the ontology, the authors introduce auxiliary database objects and a specialized unary table (Aux) to track them. This expanded dataset is then stored in a standard relational schema.

2. Linear-Time Query Rewriting

Because the finite canonical model "loops" to remain finite, it introduces cycles that do not exist in the true, infinite open-world model. If a standard SQL query were run against this data, it would return false positives—matches that rely on these artificial cycles.

To solve this, the authors developed a rewriting technique that transforms the user’s conjunctive query into a domain-independent first-order query (SQL). This rewritten query includes specific constraints using the Aux table to explicitly forbid invalid cyclic matches. A key innovation here is that the rewriting process is independent of both the specific data and the ontology; it only needs to analyze the structure of the query itself.

Key Insights: Smart Queries over Collapsed Data

The "aha moment" of this research is the realization that one does not need to fix the data to remove cycles—a process that would lead back to the problem of infinite data. Instead, one can keep the "flawed" finite data and make the query "smart" enough to ignore the flaws. By decoupling the reasoning:

  • The ontology's logic is handled during the polynomial-time preprocessing phase.
  • The structural validity (avoiding infinite loops) is handled by the query rewriter.

Theoretical Results

The paper provides a rigorous mathematical foundation for this approach, yielding several significant results:

  • Correctness: The authors prove (Theorem 1) that the results of the rewritten SQL query on the preprocessed database are exactly the "certain answers" required by OWL semantics.
  • Efficiency: The query rewriting step is highly efficient, running in linear time relative to the size of the query. This avoids the exponential query blowup often associated with other rewriting methods.
  • Bounded Growth: The preprocessing phase is guaranteed to complete in polynomial time. The resulting database size is bounded by $\mathcal{O}(n \cdot m)$, where $n$ is the number of individuals and $m$ is the number of subconcepts in the ontology.

Conclusion and Future Work

This research provides a theoretically sound framework for using RDBMS to query $\mathcal{EL}$ ontologies without the need for custom database engines or infinite materialization. While the paper is primarily theoretical, it sets the stage for practical implementations that could significantly speed up data access in bio-informatics and other knowledge-heavy fields.

Future work remains to be done in empirical evaluation to see how the polynomial growth of the database behaves with real-world datasets like SNOMED CT. Additionally, the authors aim to extend this technique to more expressive logics, including those with role hierarchies, transitive roles, and disjointness constraints.

Summary updated

BibTeX
@inproceedings{lutz2008conjunctive,
  author = {Carsten Lutz and David Toman and Frank Wolter},
  title = {{Conjunctive Query Answering in EL using a Database System}},
  booktitle = {OWLED},
  year = {2008},
}
Figure