Querying OWL 2 QL ontologies under the SPARQL Metamodeling Semantics Entailment Regime
OWL2QL is the profile of OWL2 targeted to Ontology-Based Data Access (OBDA) scenarios, where large amount of data are to be accessed, and thus answering conjunctive queries over data is the main task. However, this task is quite restrained wrt the classical KR Ask-and-Tell framework based on query- ing the whole theory, not only facts (data). If we use SPARQL as query language, we get much closer to this ideal. Indeed, SPARQL queries over OWL 2 QL, under the so-called Direct Semantics Entailment Regime, may comprise any assertion expressible in the language, i.e., both ABox atoms and TBox atoms, including inequalities expressed by means of DifferentIndividuals. Nevertheless this regime is hampered by the assumption that variables in queries need to be typed, meaning that the same variable cannot occur in positions of different types, e.g., both in class and individual position (punning). In this paper we dismiss this limiting assumption by resorting to a recent meta modeling semantics and show that query answering in the resulting entailment regime is polynomially compilable into Datalog (and hence PTIME wrt both TBox and ABox).