<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Meta-reasoning over OWL 2 QL using Datalog</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Haya Majid Qureshi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Wolfgang Faber</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Klagenfurt</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <fpage>181</fpage>
      <lpage>187</lpage>
      <abstract>
        <p>There has been increasing interest in enriching ontologies with meta-modeling and meta-querying for the past few years. Unfortunately, the Direct Semantics for OWL2 and SPARQL does not support meta-constructs in a satisfactory way: While meta-axioms can be syntactically expressed using punning, they are not treated as expected semantically. Meta-queries (for example, asking for classes that also occur as individuals) are not defined in SPARQL under the Direct Semantics Entailment Regime. To overcome this, a new semantic flavour for SPARQL, called Metamodeling Semantics Entailment Regime (MSER), has been introduced. In previous work, Cima et al. have proposed a reduction from OWL 2 QL query answering to query answering over Datalog. In this paper, we report on experiments for MSER query answering conducted with various Datalog engines.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Meta-Reasoning</kwd>
        <kwd>Ontology</kwd>
        <kwd>SPARQL</kwd>
        <kwd>Datalog</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        2 QL. It provides a reduction from query-answering over OWL 2 QL to Datalog queries and
reported experimental results using two Datalog engines, Logicblox and RDFox. This work
summarises results obtained in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], in which more Datalog engines have been evaluated. Some
additional experimental results obtained since the publication of [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] are also included.
      </p>
      <p>This work aims to reflect the idea of query answering under MSER that addresses the
feasibility challenge for OWL 2 QL ontology language with (or without) the distinct flavour of
metamodeling in Datalog back-end tools. Also, we investigated the problem of typing constraints
by DSER via posing meta-queries to OWL 2 QL theories and evaluating the performance of
these queries in Datalog engines.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>
        ment Regime (MSER) from [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>In this section, we briefly recall query answering under the Meta-modelling Semantics
EntailIn MSER, SPARQL query answering over OWL 2 QL ontologies is reduced to Datalog query
ℛ
answering. It defines (i) a translation function  mapping OWL 2 QL axioms to Datalog facts is
summarised Table 1 and (ii) a fixed rule base</p>
      <p>that captures inferences in OWL 2 QL reasoning
(the full set of rules is available at https://git-ainf.aau.at/Haya.Qureshi/mhf-algo-testing). This
representation is closer to a meta-programming representation than other Datalog embeddings
that translate each axiom to a rule.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Experiments</title>
      <p>
        In this section we briefly describe the experiments that we have conducted, including the
tools we used, the ontologies and queries we considered, and report on the outcomes. For a
detailed discussion, see [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. All material is available at https://git-ainf.aau.at/Haya.Qureshi/
mhf-algo-testing. We have implemented MSER in Java. For the Datalog back-end, we have
evaluated nine tools, which stem from diferent paradigms. These tools are: RDFox, LogicBlox,
XSB, Clingo, DLV2, DLVHex, HexLite, Alpha and NoHR .
      </p>
      <p>Our experiments are based on the widely used Lehigh University Benchmark (LUBM)1 dataset
(with 1 and 9 universities) and Making Open Data Efectively USable (MODEUS) 2 ontologies in
four sizes.</p>
      <p>The LUBM datasets describe a university domain with information like departments, courses,
students, and faculty. This dataset comes with 14 queries with diferent characteristics (low
selectivity vs high selectivity, implicit relationships vs explicit relationships, small input vs large
input, etc.).</p>
      <p>
        The MODEUS ontologies describe the Italian Public Debt domain with information like
ifnancial liability or financial assets to any given contracts [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. It comes with 8 queries. These
queries are pure meta-queries as they span over several levels of the knowledge base. MODEUS
ontologies are meta-modelling ontologies with meta-classes and meta-properties.
      </p>
      <p>We ran experiments on a Linux batch server, running Ubuntu 20.04.3 LTS (GNU/Linux
5.4.088-generic x86_64) on one AMD EPYC 7601 (32-Core CPU), 2.2GHz, Turbo max. 3.2GHz. The
machine is equipped with 515GB RAM and a 4TB hard disk. Java applications used OpenJDK
11.0.11 with a maximum heap size of 25GB. For each query, we have limited RAM to 8GB
and runtime to 15 minutes. OFT and OFM refer to exceeding the time and memory limits,
respectively.
3.1. Results
We next report the results of our experiments. All reported times are in seconds and include
loading the Datalog program including facts and rules and answering the query. The best
performance for each query is highlighted in bold face.</p>
      <p>In Tables 2 we report the performance on standard queries over LUBM, respectively. While
for the smaller ontology almost all queries could be answered by all systems within the resource
limits, performance varies considerably. This situation is exasperated for the larger ontology,
for which LogicBlox, NoHR, and Alpha could not answer any of the queries. On the other hand,
Clingo and DLV2 exhibit consistently fast performance.</p>
      <p>
        In Table 3, we have considered the meta-queries mq1, mq4, mq5, and mq10 from [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] as
they contain variables in-property positions and are long conjunctive queries. We have also
considered two special-case queries sq1 and sq2 from [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to exercise the MSER features and
identify the new challenges introduced by the additional expressivity over the ABox queries.
Basically, in special-case queries, we check the impact of DISJOINTWITH and meta-classes in a
query. For this, like in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], we have introduced a new class named TypeOfProfessor and make
FullProfessor, AssociateProfessor and AssistantProfessor an instance of this new class and also
we define FullProfessor, AssociateProfessor and AssistantProfessor to be disjoint from each other.
Then, in sq1 we are asking for all those  and , where  is a professor,  is a type of professor
and  is an instance of . In sq2, we have asked for diferent pairs of professors.
1http://swat.cse.lehigh.edu/projects/lubm/
2http://www.modeus.uniroma1.it/modeus/node/6
It can be seen in Table 3 that the overall performance of meta-query evaluation is similar to
the one in Table 2. Clingo and DLV2 exhibits the regular performance. XSB and RDFox shows
the good performance on LUBM(1) but their performance get efected by the size of ontology.
On the other hand, LogicBlox, NoHR, Alpha, HexLite and DLVHex shows slower performance
but deteriorates with the size of the ontology.
      </p>
      <p>In Table 4 we report the performance on the larger MODEUS queries. It can be seen
immediately that many of the systems struggle considerably with these. Some considerations on the
causes of this are: The MODEUS dataset consists of meta-layers, which appear to cause many
tools to do more inferencing. We also conjecture that the presence of many disjoint axioms
causes particularly many inferences.</p>
      <p>On the positive side, DLV2 and XSB exhibit acceptable performance for these queries, with
DLV2 being the best overall performer. DLV2 exhibits very stable performance with roughly
the same execution time for all queries, which is quite remarkable. We assume that the magic
set technique implemented in DLV2 has a huge impact here. The time is afected slightly by the
size of the dataset, which is expected, though. XSB uses a top-down evaluation and therefore
has similar advantages as the magic set technique.</p>
      <p>Interestingly, we believe that at least LogicBlox (and perhaps also RDFox) also implements a
magic set technique, yet does not seem to be able to take advantage from it. We conjecture that
those systems build quite complicated and large datastructures for the Datalog program, for
instance various indices. These systems might perform better when huge amounts of memory
are available and several queries are posed over the same program without reloading it.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>
        In this work, we have tested several Datalog engines on OWL 2 QL MSER query answering
without any restriction, as defined in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. While most tools are able to answer queries over
smaller ontologies, scalability seems to be an issue for many of them. However, there are some
exceptions, notably XSB and DLV2, which also show good performance over large and complex
ontologies. Indeed, our experiments show that DLV2 appears to be a promising back-end for
meta-querying over OWL 2 QL.
      </p>
      <p>We show that query answering under Datalog reduction of MSER with metamodeling and
meta-querying feature is feasible for some tools (or, in our case, just DLV2). At the same time,
some sufer from the existence of meta-axioms over several layers. The meta-queries over LUBM
do not include meta-axioms. However, most tools could perform well despite the metamodeling
capabilities associated with the query language that extracts the information spanning several
levels of an ontology. On the other hand, some tools could perform with MSER without the
metamodeling feature in ontologies and with standard queries, while others get afected by the
size of the ontology.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>B.</given-names>
            <surname>Motik</surname>
          </string-name>
          ,
          <article-title>On the properties of metamodeling in OWL</article-title>
          ,
          <source>Journal of Logic and Computation</source>
          <volume>17</volume>
          (
          <year>2007</year>
          )
          <fpage>617</fpage>
          -
          <lpage>637</lpage>
          . doi:
          <volume>10</volume>
          .1093/logcom/exm027.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>B.</given-names>
            <surname>Glimm</surname>
          </string-name>
          ,
          <article-title>Using SPARQL with RDFS and OWL Entailment</article-title>
          ,
          <source>in: Reasoning Web International Summer School</source>
          , Springer,
          <year>2011</year>
          , pp.
          <fpage>137</fpage>
          -
          <lpage>201</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>G.</given-names>
            <surname>Cima</surname>
          </string-name>
          , G. De Giacomo,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lenzerini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Poggi</surname>
          </string-name>
          ,
          <article-title>On the SPARQL metamodeling semantics entailment regime for OWL 2 QL ontologies</article-title>
          ,
          <source>in: Proceedings of the 7th International Conference on Web Intelligence, Mining and Semantics</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>H. M.</given-names>
            <surname>Qureshi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Faber</surname>
          </string-name>
          ,
          <article-title>An Evaluation of Meta-reasoning over OWL 2 QL</article-title>
          , in:
          <source>International Joint Conference on Rules and Reasoning</source>
          , Springer,
          <year>2021</year>
          , pp.
          <fpage>218</fpage>
          -
          <lpage>233</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Lenzerini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Lepore</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Poggi</surname>
          </string-name>
          ,
          <article-title>Metaquerying made practical for OWL 2 QL ontologies</article-title>
          ,
          <source>Information Systems</source>
          <volume>88</volume>
          (
          <year>2020</year>
          )
          <fpage>101294</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Rezk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Rodriguez-Muro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Xiao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          ,
          <article-title>Answering SPARQL queries over databases under OWL 2 QL entailment regime</article-title>
          , in: International Semantic Web Conference, Springer,
          <year>2014</year>
          , pp.
          <fpage>552</fpage>
          -
          <lpage>567</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>