<!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>RuQAR : Reasoning with OWL 2 RL Using Forward Chaining Engines</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jaroslaw Bak</string-name>
          <email>jaroslaw.bak@put.poznan.pl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Control and Information Engineering, Poznan University of Technology</institution>
          ,
          <addr-line>Piotrowo 3a, 60-965 Poznan</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present the Rule-based Query Answering and Reasoning framework (RuQAR). The tool supports ABox reasoning and query answering with OWL 2 RL ontologies executed by the forward chaining rule reasoners Jess and Drools. We describe RuQAR's main features, its architecture as well as implementation details. Ontologies, as a way of expressing knowledge, are becoming more and more popular in various elds, such as web technologies, database integration, medical systems etc. Ontologies can be expressed in the Web Ontology Language 2 (OWL 2). The language provides a set of pro les1 which o er important advantages in di erent application scenarios. Among them, the OWL 2 RL pro le is the most interesting one from our point of view. It enables an implementation of polynomial time reasoning algorithms in a standard rule engine. Nonetheless, a naive implementation of an OWL 2 RL reasoner is known to perform poorly with large ABoxes [3]. Additionally, description logic-based reasoners handle the TBox entailments better than the ABox ones. However, ABox reasoning can be performed more e ciently by a rule engine [7]. Nevertheless, the o cial list2 of OWL 2 reasoners supporting OWL 2 RL is limited. Moreover, combining an OWL 2 RL reasoner with a currently used forward reasoning engine can be a tricky task, because existing reasoners usually provide their own format and reasoning algorithms. Furthermore, there is a lack of native and e cient rule sets that support OWL 2 RL reasoning in many popular rule engines, especially considering ABox reasoning. This motivated us to provide a tool which supports the application of an OWL 2 RL-based knowledge base in a forward chaining rule engine. Nevertheless, we do not limit ourselves to one particular engine or implementation. Instead, we aim at providing an easy-to-use framework for performing ABox reasoning with OWL 2 RL ontologies in any forward chaining rule engine such that it can be used in many rule-based applications.</p>
      </abstract>
      <kwd-group>
        <kwd>Jaroslaw Bak</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>In this paper we provide a detailed description of the Rule-based Query
Answering and Reasoning framework (RuQAR) which overcomes the
aforementioned issues. The main goal of the tool is to support ABox reasoning as well
as query answering within the OWL 2 RL pro le. The remainder of this paper
is organized as follows. Firstly, we describe main features of RuQAR. Then, we
present its architecture as well as implementation details. Finally, we provide
conclusions along with future development plans.
2
2.1</p>
    </sec>
    <sec id="sec-2">
      <title>RuQAR Framework</title>
      <sec id="sec-2-1">
        <title>Features</title>
        <p>
          The RuQAR framework is aimed at providing easy-to-use functions that will
support reasoning and query answering with ontologies within OWL 2 RL. These
tasks should be performed by a forward reasoning rule engine. For this, an
ontology needs to be transformed into rules that are readable by a chosen engine.
According to this we have developed the following features for RuQAR:
1. The Abstract Syntax of Rules and Facts (ASRF) which is used to rise an
abstraction level providing more universal representation of rules and facts.
As a result the syntax enables easy translation into the language of any rule
engine. An implementation of mappings between ASRF and the language of
a chosen rule engine is required.
2. Transformation schema of an OWL 2 ontology into a set of rules and a set
of facts expressed in ASRF. The transformation schema is presented in
Figure 1. Firstly, an OWL 2 ontology is loaded into the HermiT3 engine. Then,
TBox reasoning is executed. We perform the following reasoning tasks:
satisability checking, concept classi cation and subsumption as well as checking
equivalence and disjointness between concepts. Finally, the resulting
ontology is transformed into two sets: one of rules and one of facts. These sets
re ect TBox and ABox separately. Both are expressed in the ASRF
notation. By loading a translated and inferred ontology, produced by HermiT,
into a rule engine we can derive more consequences during ABox reasoning
than those supported by OWL 2 RL. However, it depends on an applied
ontology (whether or not it uses constructs that are beyond OWL 2 RL).
Nevertheless, RuQAR supports only rules that are presented in Table 1.
Moreover, since we use the OWL-API [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] tool, HermiT can be exchanged
through an another compatible reasoner (e.g. Pellet4).
3. Translation of the ASRF sets into Drools5 and Jess6 languages (we
implemented appropriate mappings). As a result these sets can be used to perform
ABox reasoning with the corresponding engines.
3 http://www.hermit-reasoner.com/
4 https://github.com/complexible/pellet
5 http://www.drools.org/
6 http://jessrules.com/
OWL 2
        </p>
        <sec id="sec-2-1-1">
          <title>Ontology</title>
        </sec>
        <sec id="sec-2-1-2">
          <title>HermiT</title>
        </sec>
        <sec id="sec-2-1-3">
          <title>TBox Reasoning</title>
        </sec>
        <sec id="sec-2-1-4">
          <title>Inferred</title>
          <p>OWL 2</p>
        </sec>
        <sec id="sec-2-1-5">
          <title>Ontology</title>
        </sec>
        <sec id="sec-2-1-6">
          <title>Ontology</title>
        </sec>
        <sec id="sec-2-1-7">
          <title>Transformation</title>
        </sec>
        <sec id="sec-2-1-8">
          <title>OWL 2 Ontology</title>
        </sec>
        <sec id="sec-2-1-9">
          <title>Written in</title>
        </sec>
        <sec id="sec-2-1-10">
          <title>ASRF</title>
          <p>
            4. Support for the Semantic Web Rule Language (SWRL) [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ] with its built-ins.
          </p>
          <p>
            Additionally, RuQAR checks if a rule is safe (whether each variable from the
rule's head occurs in the rule's body).
5. Mapping method between an ontology and a relational database. Currently,
we are developing an interface which is based on the R2RML speci cation.7
6. Query answering functions that allow for querying Jess and Drools engines
with their native methods as well as our own methods. One of our method
uses a relational database to store the ABox part of an ontology. Another one
provides some optimizations regarding rules that are used while processing
the query. It is based on a previously developed extended rules approach [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ].
7. Reasoning and query answering management functions for Jess, Drools and
HermiT. Moreover, additional functions are also available. For example, we
can compare reasoning results (or query answers) computed by the engines.
          </p>
          <p>Reasoning</p>
          <p>Transformations
OWL-API
o
t
n
I
s
e
l
u
R</p>
          <p>Mapping</p>
          <p>The architecture of RuQAR is presented in Figure 2. The tool contains a set
of modules that provide di erent functionalities. If a module overlaps another
one in Figure 2 it means that they share some part of the RuQAR's Java code.
The tool contains the following modules:</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Transformations Module</title>
        <p>This module uses OWL-API to handle ontology les as well as to extract
the logical axioms from an ontology. The module creates ASRF rules and
facts and is responsible for creating mappings between a relational database
and an OWL ontology. It provides RulesInto interface which has to be
implemented in order to translate the ASRF notion into the language of a selected
reasoning engine. An implementation of this interface requires to de ne
mapping between ASRF elements and the destination language. The current
implementation provides mappings for Jess and Drools. Both engines use
di erent languages as well as di erent approaches for rule and fact
representations. Jess uses its own scripting language and represents rules and
facts as internal Java objects. However, rules in Drools are represented as
when...then... statements in which any Java class can occur (as a pattern).
Moreover, facts can be represented as pure Java objects. As a result we
developed an additional class Triple which can be applied in the body of each
rule as well as to represent facts as Triple objects. Thus, we con rmed that
the ASRF syntax can be applied in di erent rule reasoning engines.</p>
      </sec>
      <sec id="sec-2-3">
        <title>Reasoning Manager Module</title>
        <p>The module provides a set of functions to handle reasoning engines. We can
use this module to perform ABox and TBox reasoning separately using
HermiT. We can manage Drools and Jess when performing ABox reasoning or
query answering. We can save results as a new OWL ontology. Additionally,
we can obtain the pro le information about a given ontology. Whether it is
within OWL 2 RL or not. If it is not, the violations are provided (mainly
due to the OWL-API functions).</p>
      </sec>
      <sec id="sec-2-4">
        <title>Query Answering Module</title>
        <p>This module supports query answering with Drools and Jess. We can use
native methods of those engines or our (optimized) methods that include
a relational database access. Application of our method requires rules to
be modi ed. However, this module provides such a modi cation which can
be applied automatically with the ASRF rules. As a result we provide an
optimized set of rules which can be translated into Drools or Jess rules out
of the box.</p>
        <p>
          RuQAR implements our method of transforming OWL 2 ontologies into a set
of rules and a set of facts expressed in the ASRF syntax. Table 1 shows currently
supported rules by our implementation. This set comes from the speci cation of
OWL 2 [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. However, this set is smaller than the original one. We decided to use
the simplest subset of OWL 2 RL/RDF rules which is easily implementable in
any reasoning engine. Moreover, we excluded each rule which is a \constraint"
rule (e.g. cls-nothing2 from Table 6 in the OWL 2 RL pro le) and each rule
which does not have an impact on ABox reasoning (e.g. all rules from Table 9
in the OWL 2 RL pro le).
        </p>
        <p>
          In ontology-to-ASRF transformation we translate each logical ontology axiom
into its equivalent rule. As a result the transformation materializes the semantics
of a given ontology in a set of Datalog-like rules (we consider it as a non-naive
translation). Since we are focused on ABox reasoning, each rule should be
perceived as an implementation of the axioms from a given ontology. According to
this, we obtain a signi cant performance gain [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ].
        </p>
        <p>The transformation method may produce more entailments during reasoning
than those represented by OWL 2 RL/RDF rules. It is caused by the fact that
we apply TBox reasoning with a DL-based reasoner. However, it depends on the
expressivity of a given ontology. Nevertheless, the application of our method to
ontology beyond OWL 2 RL will not produce the same consequences as derived
by an appropriate DL-based reasoner (in our case the set of inferences will be
smaller). As a result, the reasoning with rules generated by our methodology is
sound but not complete.</p>
        <p>Since RuQAR generates rules and facts in the native language of a rule
engine, the tool can be easily integrated into an existing environment. For example,
assume that we have an application X which uses Drools to perform reasoning
with some data. If we create an ontology that describes the data, and then we
translate the data into RDF triples, we can employ RuQAR to generate rules
(and facts) that can be easily and directly applied with X.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Conclusions and Future Work</title>
      <p>In this paper we presented the RuQAR tool which is a framework that provides
many useful functionalities to: (i) perform ABox reasoning and query
answering with OWL 2 RL ontologies executed by forward chaining rule reasoners,
(ii) translate an OWL ontology into rules, (iii) use SWRL rules together with
ontologies, (iv) manage reasoning engines and to (v) store OWL individuals in
a relational database.</p>
      <p>
        Moreover, presented work is the rst implementation of OWL 2 RL reasoning
in Drools and Jess (except the work presented in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] that implements directly
the semantics of OWL 2 RL) which can be applied in any application
requiring e cient ABox reasoning. Transformation provided by RuQAR should be
considered as a generic one. Rules generated for di erent rule engines are the
same { they di er only in the language of a reasoning engine. The next step of
development is to provide rules that are optimized according to a chosen rule
engine.
      </p>
      <p>
        Currently, we are implementing R2RML mappings which will be useful to
measure the performance of query answering algorithms. In this case we are
going to use the NPD benchmark [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] which is speci cally designed for Ontology
Based Data Access systems (since RuQAR provides relational data access it can
be perceived as a OBDA/RBDA8-like system). We also plan to perform tests
with the latest versions of Jess and Drools, 8.0 and 6.2, respectively. It will be
useful to check if reasoning e ciency as well as query answering performance
have been increased in newer versions. As a result, in Drools case, we will be
able to compare two di erent algorithms: ReteOO (Drools 5.5) and PHREAK
(Drools 6.2).
      </p>
      <p>More information about the RuQAR framework can be found at its web
page: http://etacar.put.poznan.pl/jaroslaw.bak/RuQAR.php.
Acknowledgments. The work presented in this paper was supported by
UMO2011/03/N/ST6/01602 grant and 04/45/DSMK/0124 project.
8 http://wiki.ruleml.org/index.php/Rule-Based_Data_Access</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Jaroslaw</given-names>
            <surname>Bak</surname>
          </string-name>
          , Graz_yna Brzykcy, and
          <string-name>
            <given-names>Czeslaw</given-names>
            <surname>Jedrzejek</surname>
          </string-name>
          .
          <article-title>Extended rules in knowledge-based data access</article-title>
          .
          <source>In Proceedings of the 5th international conference on Rule-based modeling and computing on the semantic web</source>
          ,
          <source>RuleML'11</source>
          , pages
          <fpage>112</fpage>
          {
          <fpage>127</fpage>
          , Berlin, Heidelberg,
          <year>2011</year>
          . Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Jaroslaw</given-names>
            <surname>Bak</surname>
          </string-name>
          , Maciej Nowak, and Czeslaw Jedrzejek.
          <article-title>RuQAR: Reasoning framework for OWL 2 RL ontologies</article-title>
          . In Valentina Presutti, Eva Blomqvist, Raphael Troncy, Harald Sack, Ioannis Papadakis, and Anna Tordai, editors,
          <source>The Semantic Web: ESWC 2014 Satellite Events - ESWC 2014 Satellite Events</source>
          , Anissaras, Crete, Greece, May
          <volume>25</volume>
          -29,
          <year>2014</year>
          , Revised Selected Papers, volume
          <volume>8798</volume>
          of Lecture Notes in Computer Science, pages
          <volume>195</volume>
          {
          <fpage>198</fpage>
          . Springer,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Aidan</given-names>
            <surname>Hogan</surname>
          </string-name>
          and
          <string-name>
            <given-names>Stefan</given-names>
            <surname>Decker</surname>
          </string-name>
          .
          <article-title>On the ostensibly silent W in OWL 2 RL</article-title>
          . In Axel Polleres and Terrance Swift, editors,
          <source>Web Reasoning and Rule Systems</source>
          , volume
          <volume>5837</volume>
          of Lecture Notes in Computer Science, pages
          <volume>118</volume>
          {
          <fpage>134</fpage>
          . Springer Berlin Heidelberg,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Matthew</given-names>
            <surname>Horridge</surname>
          </string-name>
          and
          <string-name>
            <given-names>Sean</given-names>
            <surname>Bechhofer</surname>
          </string-name>
          .
          <article-title>The OWL API: A Java API for working with OWL 2 ontologies</article-title>
          . In OWLED,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          , Peter F.
          <article-title>Patel-schneider, Harold Boley</article-title>
          , Said Tabet, Benjamin Grosof, and
          <string-name>
            <given-names>Mike</given-names>
            <surname>Dean</surname>
          </string-name>
          .
          <article-title>SWRL: A semantic web rule language combining OWL and RuleML</article-title>
          .
          <year>2004</year>
          . Accessed:
          <volume>04</volume>
          /04/
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Davide</given-names>
            <surname>Lanti</surname>
          </string-name>
          , Martin Rezk, Guohui Xiao, and Diego Calvanese.
          <article-title>The NPD Benchmark: Reality Check for OBDA Systems</article-title>
          .
          <source>In Proc. of the 18th Int. Conf. on Extending Database Technology (EDBT</source>
          <year>2015</year>
          ),
          <year>2015</year>
          . To appear.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Georgios</given-names>
            <surname>Meditskos</surname>
          </string-name>
          and
          <string-name>
            <given-names>Nick</given-names>
            <surname>Bassiliades</surname>
          </string-name>
          .
          <article-title>Combining a DL reasoner and a rule engine for improving entailment-based OWL reasoning</article-title>
          .
          <source>In Proceedings of the 7th International Conference on The Semantic Web, ISWC '08</source>
          , pages
          <fpage>277</fpage>
          {
          <fpage>292</fpage>
          , Berlin, Heidelberg,
          <year>2008</year>
          . Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Boris</given-names>
            <surname>Motik</surname>
          </string-name>
          , Bernardo Cuenca Grau, Ian Horrocks, Zhe Wu, Achille Fokoue, and
          <article-title>Carsten Lutz. OWL 2 Web Ontology Language Pro les (Second Edition)</article-title>
          .
          <source>W3C Recommendation</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Martin J. O'Connor and Amar Das</surname>
          </string-name>
          .
          <article-title>A pair of OWL 2 RL reasoners</article-title>
          . In Pavel Klinov and Matthew Horridge, editors,
          <source>OWLED</source>
          , volume
          <volume>849</volume>
          <source>of CEUR Workshop Proceedings. CEUR-WS.org</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>