[Paper Review] Ontological Queries: Rewriting and Optimization (Extended Version)
This paper presents a novel rewriting and optimization framework for ontological queries in the Datalog± family, particularly for linear Datalog±, enabling efficient compilation of ontological queries into equivalent unions of conjunctive queries (UCQs) over relational databases. The key contribution is a new algorithm that ensures sound and complete rewriting while significantly reducing query size through query elimination and factorization, achieving substantial performance improvements in real-world and synthetic workloads.
Ontological queries are evaluated against an ontology rather than directly on a database. The evaluation and optimization of such queries is an intriguing new problem for database research. In this paper we discuss two important aspects of this problem: query rewriting and query optimization. Query rewriting consists of the compilation of an ontological query into an equivalent query against the underlying relational database. The focus here is on soundness and completeness. We review previous results and present a new rewriting algorithm for rather general types of ontological constraints. In particular, we show how a conjunctive query against an ontology can be compiled into a union of conjunctive queries against the underlying database. Ontological query optimization, in this context, attempts to improve this process so to produce possibly small and cost-effective UCQ rewritings for an input query. We review existing optimization methods, and propose an effective new method that works for linear Datalog+/-, a class of Datalog-based rules that encompasses well-known description logics of the DL-Lite family.
Motivation & Objective
- To address the challenge of efficiently evaluating ontological queries over large relational databases by compiling them into equivalent relational queries.
- To improve the efficiency and scalability of ontological query processing in the context of ontology-based data access (OBDA).
- To develop optimization techniques that reduce the size and computational cost of rewritten queries without sacrificing correctness.
- To extend existing rewriting methods to handle linear Datalog±, a tractable fragment of Datalog± that captures important description logics like DL-Lite.
- To evaluate the effectiveness of query rewriting and optimization in practice using real-world and synthetic ontologies.
Proposed method
- Proposes a new rewriting algorithm that compiles a conjunctive query over an ontology into a union of conjunctive queries (UCQ) over the underlying relational database, ensuring soundness and completeness.
- Introduces a novel optimization technique based on query elimination, which removes redundant atoms from input queries before rewriting to reduce the size of the final UCQ.
- Employs factorization to further compress the rewritten UCQs by sharing common subexpressions across disjuncts.
- Applies the method to linear Datalog±, a class of Datalog-based rules that generalizes DL-Lite and supports efficient data complexity.
- Employs a two-phase process: first, query rewriting via a sound and complete algorithm; second, optimization via factorization and query elimination to minimize UCQ size.
- Evaluates the approach using real-world ontologies (A, U, S) and synthetic ones (P5, P5X), comparing against QuOnto and Requiem using execution time and rewriting size.
Experimental results
Research questions
- RQ1How can ontological queries be efficiently rewritten into equivalent relational queries while preserving soundness and completeness?
- RQ2What optimization techniques can be applied to reduce the size of the rewritten UCQs without affecting correctness?
- RQ3To what extent does query elimination and factorization reduce the size and execution cost of ontological query rewritings?
- RQ4How does the proposed method scale on real-world and synthetic ontologies with varying structural complexity?
- RQ5Can the proposed optimization strategy outperform existing systems like QuOnto and Requiem in terms of rewriting size and execution time?
Key findings
- Query elimination significantly reduces the size of the final UCQ rewriting, especially in real-world ontologies such as A, U, and S, where redundant atoms are removed from input queries.
- For the U and S ontologies, the method eliminated all redundant atoms in Q2, drastically reducing the number of disjuncts in the final rewriting.
- Factorization further compresses the UCQs by sharing common subexpressions, contributing to smaller and more efficient rewritings.
- The proposed method outperforms QuOnto and Requiem in terms of rewriting size and execution time, particularly on complex real-world ontologies.
- In synthetic workloads like P5 and P5X, which are designed to generate exponentially large rewritings, the method still provides measurable improvements, though the inherent complexity limits gains.
- The system achieved complete rewriting within 15 minutes for all test cases except a few, where tools like QuOnto and Requiem failed to complete.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.