Bajraktari, L. (2019). Querying rich ontologies by exploiting the structure of data [Dissertation, Technische Universität Wien]. reposiTUm. https://doi.org/10.34726/hss.2019.75782
We live in exciting times; our ability for processing and storing information is unprecedented in human history and has transformed our society. Unfortunately, managing and acquiring knowledge from today's databases is a complicated endeavour for organizations, in large part due to the limited semantic meaning of the stored data. To remedy the situation one can use Description Logics (DL) a family of ontological languages which provide rich modeling features with semantics grounded in logic that can be used effectively for representing knowledge. Recently, the Ontology-based Data Access (OBDA) paradigm has emerged as a way of managing and integrating traditional data sources through the use of ontologies. An essential reasoning service in OBDA, and the focus of this thesis is Ontology Mediated Query (OMQ) answering. OMQ answering has received much attention in the last decade, with the standard approach being query rewriting. For expressive ontologies, i.e., those that use the disjunctive operator to express knowledge, only theoretical algorithms not amenable to implementation exist. Rewritings like the ones for lighter ontologies would be desirable, but they don't scale, at least not in the usual data independent setting. In this thesis, we seek to find a feasible approach for OMQ in expressive ontologies, by utilizing the structure of data for 'guiding' the reasoning of query answering algorithms. We propose a generic description of ABoxes (the data component in DL knowledge bases) by what we call profiles, and use them in three different settings to facilitate reasoning. In the first, we propose an algorithm to compile a representation of sets of models for ALCHI ontologies, which we show is sufficient for answering any query preserved under homomorphisms. We develop algorithms for answering different query languages that make use of the computed representation, and rewrite them into ASP programs. In the second, we extend our approach into the more expressive setting of hybrid languages which combine rules with ontologies. We define a new hybrid language that we call Clopen, and provide a practicable translation into plain ASP programs which utilizes profiles for a fragment that satisfies certain restrictions. In the third, we employ profiles for optimizing a well-known query answering algorithm for Horn-SHIQ, an expressive Horn DL, and show significant gains compared to the state of the art algorithm. In the end, we show that our profiles can be easily obtained from OBDA specifications with mappings expressed in R2RML, which makes our approach deployable in practical settings.