Abstract:
We investigate the size of rewritings of conjunctive queries over $OWL2QL$ ontologies of depth 1 and 2 by means of a new hypergraph formalism for computing Boolean functions. Both positive and negative results are obtained. All conjunctive queries over ontologies of depth 1 have polynomial-size nonrecursive datalog rewritings; treeshaped queries have polynomial-size positive existential rewritings; however, for some queries and ontologies of depth 1, positive existential rewritings can only be of superpolynomial size. Both positive existential and nonrecursive datalog rewritings of conjunctive queries and ontologies of depth 2 suffer an exponential blowup in the worst case, while first-order rewritings can grow superpolynomially unless $\mathrm{NP \subseteq P/poly}$.