Theoretically Optimal Datalog Rewritings for OWL 2 QL Ontology-Mediated Queries

Meghyn Bienvenu,Stanislav Kikot,Roman Kontchakov,Vladimir V. Podolskii,Michael Zakharyaschev
DOI: https://doi.org/10.48550/arXiv.1604.05258
2016-04-19
Abstract:We show that, for OWL 2 QL ontology-mediated queries with (i) ontologies of bounded depth and conjunctive queries of bounded treewidth, (ii) ontologies of bounded depth and bounded-leaf tree-shaped conjunctive queries, and (iii) arbitrary ontologies and bounded-leaf tree-shaped conjunctive queries, one can construct and evaluate nonrecursive datalog rewritings by, respectively, LOGCFL, NL and LOGCFL algorithms, which matches the optimal combined complexity.
Logic in Computer Science
What problem does this paper attempt to address?
The problem that this paper attempts to solve is about the optimal non - recursive Datalog rewrites of Ontology - Mediated Queries (OMQs) under different conditions and the complexity of their evaluation. Specifically, the author explores the optimal non - recursive Datalog rewrites of the following three types of OMQs: 1. **OMQs with bounded - depth ontologies and bounded - treewidth conjunctive queries (CQs)**: - The author proves that non - recursive Datalog rewrites for this type of OMQs can be constructed and evaluated by the LOGCFL algorithm. 2. **OMQs with bounded - depth ontologies and bounded - leaf - tree - shaped conjunctive queries**: - The author proves that non - recursive Datalog rewrites for this type of OMQs can be constructed and evaluated by the NL algorithm. 3. **OMQs with arbitrary ontologies and bounded - leaf - tree - shaped conjunctive queries**: - The author proves that non - recursive Datalog rewrites for this type of OMQs can be constructed and evaluated by the LOGCFL algorithm. These results show that in these three types of OMQs, theoretically optimal non - recursive Datalog rewrites can be constructed, and the evaluation complexity of these rewrites matches LOGCFL, NL and LOGCFL respectively, thus ensuring the optimal combined complexity. ### Main contributions of the paper - **Theoretical optimality**: The paper shows how to construct theoretically optimal non - recursive Datalog rewrites for the above three types of OMQs, and these rewrites can be evaluated in optimal complexity classes such as LOGCFL and NL. - **Algorithm implementation**: The author not only provides theoretical proofs but also verifies the feasibility and efficiency of these rewrites through experiments. They generate a series of OMQs and compare their proposed rewrite methods with existing tools (such as Clipper and Rapid), and the results show that their methods are more efficient in some cases. ### Key formulas and concepts 1. **Non - recursive Datalog program (NDL)**: \[ \Pi=\{\forall z(\gamma_0\leftarrow\gamma_1\land\cdots\land\gamma_m)\} \] where each \(\gamma_i\) is an atom \(S(y)\), where \(y\subseteq z\) or an equation \(z = z'\). 2. **Linear NDL query**: Each clause in a linear NDL program contains at most one IDB predicate. 3. **Width**: The width \(w(\Pi, G)\) refers to the maximum number of non - parametric variables in each clause of the NDL program. 4. **Depth**: The depth \(d(\Pi, G)\) refers to the length of the longest dependency path from the goal predicate \(G\) to other predicates. 5. **Weight function**: The weight function \(\nu\) satisfies: \[ \nu(P)>0\quad\text{and}\quad\nu(P)\geq\nu(Q_1)+\cdots+\nu(Q_n) \] for each clause \(P(z)\leftarrow Q_1(z_1)\land\cdots\land Q_n(z_n)\). ### Experimental results The paper verifies the effectiveness of the proposed method through experiments. The experimental results show that for shorter conjunctive queries (CQs), the number of rewrite rules generated by their method grows linearly with the query length, while existing tools (such as Clipper and Rapid) fail when dealing with longer queries. In addition, in terms of actual execution efficiency, when the number of answers is small, their method is usually faster than existing tools; and for cases with a large number of answers, the execution times are comparable. In conclusion, this paper solves the problem of optimal non - recursive Datalog rewrites of ontology - mediated queries under specific conditions and the complexity of their evaluation, and verifies its effectiveness and superiority through theoretical analysis and experimental verification.