Rewriting Conjunctive Queries under Description Logic Constraints (Technical Report) H´ector P´erez-Urbina, Boris Motik, and Ian Horrocks Computing Laboratory University of Oxford Oxford, UK {hector.perez-urbina,boris.motik,ian.horrocks}@comlab.ox.ac.uk Abstract. We consider the problems of conjunctive query answering and rewriting under Description Logic constraints. We present a query rewriting algorithm for ELHI knowledge bases, and use it to show that query answering in this setting is PTime-complete w.r.t. data complexity. We show that our algorithm is worst-case optimal for languages with data complexity of query answering ranging from LogSpace to PTime- complete. 1 Introduction Query answering under constraints is the problem of computing the answers to a query over an incomplete database w.r.t. a set of constraints [19]. Since an incomplete database is only partially specified, the task is to compute the tuples that satisfy the query in every database that conforms to the partial specification and satisfies the constraints. Answering conjunctive queries under constraints is also relevant in several other contexts, including information integration [14], data exchange [9], and data warehousing [20]. Query answering under constraints can be solved via query rewriting under constraints: given a query Q over an incomplete database D, consisting of a set of extensions E and a set of constraints C, we can compute a query Q ′ (which depends on Q and C), such that for every set of extensions E, the answers of Q over D, and the answers of Q ′ over E coincide. This problem has been tackled by several authors (see for example [5]), who have considered standard database constraints, such as inclusion dependencies, functional dependencies, and so on. It is well known that rewriting queries under general constraints is undecidable; therefore, the expressivity of the constraint languages considered is typically restricted in order to achieve decidability. Description Logics (DLs) [2] can be viewed as very expressive but decidable first-order fragments, which makes them natural candidates for constraint lan- guages. DLs are a family of knowledge representation formalisms that represent a given domain in terms of concepts (unary predicates), roles (binary predi- cates), and individuals (constants). A DL Knowledge Base (KB) consists of a