Abstract. Query answering for the QL profile of OWL 2 and a substantial fragment of the EL profile can be implemented via query rewriting. In our previous work, we presented RQR—a rewriting algorithm for OWL QL that can also deal with most of the EL profile. In order to test the likely practicality of RQR, we have implemented it in a query rewriting system that we call REQUIEM. A recent empirical evaluation of REQUIEM, in which we considered OWL 2 QL ontologies, indicates that it produces significantly smaller rewritings than existing approaches in most cases. However, our results suggest that typical queries over realistic ontologies can still lead to very large rewritings (e.g., containing many thousands of queries). In this paper, we describe query rewriting, briefly present the results of our empirical evaluation, and discuss various optimization techniques aimed at reducing the size of the rewritings. We additionally discuss the consequences of rewriting queries w.r.t. OWL ...