<!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>Developing a Distributed Reasoner for the Semantic Web</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Raghava Mutharaju</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Prabhaker Mateti</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pascal Hitzler</string-name>
          <email>pascal.hitzlerg@wright.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Wright State University</institution>
          ,
          <addr-line>OH</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2014</year>
      </pub-date>
      <fpage>108</fpage>
      <lpage>112</lpage>
      <abstract>
        <p>OWL 2 EL is one of the tractable pro les of the Web Ontology Language (OWL) which has been standardized by the W3C. OWL 2 EL provides su cient expressivity to model large biomedical ontologies as well streaming tra c data. Automated generation of ontologies from streaming data and text can lead to very large ontologies. There is a need to develop scalable reasoning approaches which scale with the size of the ontologies. We brie y describe our distributed reasoner, DistEL along with our experience and lessons learned during its development.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>nodes as well. The Java process on all the nodes work co-operatively to achieve
the common goal of reasoning over the axioms which are distributed over the
cluster.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Software Usage</title>
      <p>DistEL can be used to classify any EL+ ontology, but is e ective on very large
ontologies where the number of axioms are in the millions and more. Detailed
instructions are given at https://github.com/raghavam/DistEL. Linux shell
scripts are provided and can be used to run the steps described brie y here.
1. Enable passwordless ssh to all the machines in the cluster.
2. Specify the cluster information in the con guration le.
3. Normalize the ontology if not already normalized and load the axioms into
the database present on each node of the cluster.
4. Classify the loaded ontology. Depending on the ontology, it takes several
iterations to classify it. Final results are collected in the node speci ed in
the con guration le.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Highlights</title>
      <p>Some of the highlights during the development of DistEL in terms of features,
technologies, optimizations and the implementation e ort required are described
here.
3.1</p>
      <sec id="sec-3-1">
        <title>Database</title>
        <p>Classi cation algorithm consists of applying a set of rules to the axioms
iteratively until no new inferences can be computed. Rules almost exclusively involve
set operations. Based on this and the distributed nature of the implementation,
following were the requirements from the database.</p>
        <p>{ Very good read and write speed. It is not the case here that there are very
less number of reads compared to writes or vice-versa. So, both read and
write speeds are important.
{ Built-in set operations. If there is no built-in support, then client (Java
reasoning process) should fetch the required data, perform the set operations
and write it back. This is ine cient especially if the data has to be fetched
from a non-local database.
{ Transaction support. In a distributed setup, there is a possibility that several
requests can be sent to the same database by di erent processes. Atomicity
of some operations is also required.
{ Random reads
{ Server-side scripting. Operations on large data is e cient if done at the
server-side rather than fetching the data to the client side.
{ Batch processing. Network round-trip time on each message/request can be
avoided if several operations can be batched together.
{ Scalability. As the data grows, the reads and writes should scale accordingly.
{ Good documentation and community support.
{ Support for Java. Since rest of the application is in Java, a good Java interface
to the database is needed.</p>
        <p>An in-memory key-value store provides excellent read/write speed. Among
the options available, Redis has support for all the mentioned requirements. It
is a single thread server that supports set operations, sharding and Lua2 scripts
for server-side scripting.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Barrier Synchronization</title>
        <p>
          Computing classi cation is an iterative process and at the end of each iteration,
a check is made to determine whether any new inferences have been derived
in this iteration. If there are no new additions, process is terminated. But in
a distributed setup, checking for termination condition is not straightforward
because reasoning process on each node of the cluster needs to know whether
any of the reasoning processes on other nodes have derived any new inference.
If a new inference has been derived, only in that case will a reasoning process
go to the next iteration. Note that, this requires each process to wait for all
the other processes to complete their current iteration. This is achieved through
barrier synchronization [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] where a software barrier is placed at a certain point.
A process that reached this barrier stops and cannot proceed until all the other
processes reach the barrier.
        </p>
        <p>Barrier synchronization in DistEL is implemented using a combination of
status message broadcast by each reasoning process to all others and the blocking
wait feature of Redis. A status message is a simple UPDATE/NO-UPDATE
indicating whether a new inference has been derived or not by a speci c process.
Each process can be made to block until it receives status messages from the
reasoning process on all the other nodes.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Work Stealing</title>
        <p>
          When a process reaches the barrier, instead of waiting, it can help other busy
processes. The idle process steals a xed set of axioms from the busy process
[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. This leads to better (dynamic) load balancing and utilization of resources.
Axioms on each node are divided into xed number of pieces called chunks.
The reasoning process on each node works on one chunk at a time. The idle
processes steal one chunk from the most busy process and works on it. After a
chunk has been processed, it looks for another chunk that can be stolen from a
busy process.
        </p>
        <p>To the best of our knowledge, there is no freely usable distributed work
stealing Java library. So we implemented work stealing in DistEL using Lua</p>
        <sec id="sec-3-3-1">
          <title>2 http://www.lua.org</title>
          <p>scripting and Java. The idle process runs a script against the database of the
busy process. The script rst checks if there are any chunks available for stealing,
and if they are, it adjusts the chunk counter on the busy process and retrieves
the chunk for local processing. Note that this script should be run atomically
and Redis ensures the atomicity of Lua scripts. After the idle process gets the
chunk, it should temporarily implement the same functionality as that of the
busy process since the data obtained corresponds to the busy process. After
processing this chunk, the idle process looks for another chunk and steals it.
This continues until no chunks are available on any of the database processes.
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Lessons Learned</title>
      <p>We brie y describe our experience and lessons learned during the development
of DistEL.</p>
      <p>
        { In a distributed system, debugging synchronization and timing issues (race
conditions) is hard since it makes the results non-deterministic. Each run
would give a di erent result. While debugging, it is best to consider the
smallest available dataset as input. This should be small enough to hand
trace the output and possible steps taken during execution. In this case,
timing issues can be traced since we already know the order.
{ We could not nd any unit testing frameworks that can simulate a
distributed setup involving a key-value store. Due to this, more time was spent
on debugging than on coding. Reasoning related errors can be debugged
using the explanation (justi cation) feature [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] of reasoners such as Pellet3.
When the expected subsumption relation is given to Pellet and asked for an
explanation, it retrieves a set of axioms from the given ontology using which
the expected subsumption relation can be inferred. These axioms would be
very small in number compared to the total axioms in the ontology. An
ontology can be made out of these axioms and should be given as input to
our reasoner implementation. This is the smallest sample that produces the
reasoning error.
{ Standard development practices such as commenting the code, using an IDE
(Eclipse), version control system (Github), logging and a build tool (Ant)
are extremely useful.
{ Java is verbose. Lot of biolerplate code needs to be written to implement even
a small functionality. Excluding comments and blank lines, our codebase on
Github currently has 11,312 lines of code.
{ Tools such as pssh4 are very useful to run jobs in a distributed environment.
      </p>
      <p>It not only deploys the job on each node but also collects the output from
each node.</p>
      <sec id="sec-4-1">
        <title>3 http://clarkparsia.com/pellet 4 https://code.google.com/p/parallel-ssh</title>
        <p>Acknowledgements: This work was supported by the National Science
Foundation under award 1017225 \III: Small: TROn - Tractable Reasoning with
Ontologies." Any opinions, ndings, and conclusions or recommendations expressed
in this material are those of the author(s) and do not necessarily re ect the views
of the National Science Foundation.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Andrews</surname>
            ,
            <given-names>G.R.</given-names>
          </string-name>
          :
          <article-title>Concurrent programming: Principles and Practice</article-title>
          . Benjamin/Cummings Publishing Company (
          <year>1991</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Cimiano</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Ontology Learning and Population from Text: Algorithms, Evaluation and Applications</article-title>
          . Springer-Verlag New York, Inc., Secaucus, NJ, USA (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Laconic and Precise Justi cations in OWL</article-title>
          . In: 7th International Semantic Web Conference,
          <string-name>
            <surname>ISWC</surname>
          </string-name>
          <year>2008</year>
          , Karlsruhe, Germany. pp.
          <volume>323</volume>
          {
          <fpage>338</fpage>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Lecue</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tucker</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bicer</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tommasi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tallevi-Diotallevi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sbodio</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          :
          <article-title>Predicting Severity of Road Tra c Congestion using Semantic Web Technologies</article-title>
          .
          <source>In: Proceedings of the 11th Extended Semantic Web Conference (ESWC2014)</source>
          , Anissaras, Crete, Greece, May 25{May 29,
          <year>2014</year>
          . Springer (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Li</surname>
            <given-names>ander</given-names>
          </string-name>
          , J.,
          <string-name>
            <surname>Krishnamoorthy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kale</surname>
            ,
            <given-names>L.V.</given-names>
          </string-name>
          :
          <article-title>Work Stealing and Persistence-based Load Balancers for Iterative Overdecomposed Applications</article-title>
          .
          <source>In: Proceedings of the 21st International Symposium on High-Performance Parallel and Distributed Computing</source>
          , HPDC'12,
          <string-name>
            <surname>Delft</surname>
          </string-name>
          , Netherlands. pp.
          <volume>137</volume>
          {
          <fpage>148</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grau</surname>
            ,
            <given-names>B.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fokoue</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lutz</surname>
          </string-name>
          , C. (eds.):
          <article-title>OWL 2 Web Ontology Language Pro les</article-title>
          .
          <source>W3C Recommendation (11 December</source>
          <year>2012</year>
          ), available at http://www.w3.org/TR/owl2-profiles/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Mutharaju</surname>
          </string-name>
          , R.:
          <article-title>Very Large Scale OWL Reasoning through Distributed Computation</article-title>
          .
          <source>In: International Semantic Web Conference (2). Lecture Notes in Computer Science</source>
          , vol.
          <volume>7650</volume>
          , pp.
          <volume>407</volume>
          {
          <fpage>414</fpage>
          . Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Mutharaju</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hitzler</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mateti</surname>
            ,
            <given-names>P.:</given-names>
          </string-name>
          <article-title>DistEL: A Distributed EL+ Ontology Classi er</article-title>
          . In: Liebig,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Fokoue</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of the 9th International Workshop on Scalable Semantic Web Knowledge Base Systems, Sydney, Australia. CEUR Workshop Proceedings</source>
          , vol.
          <volume>1046</volume>
          , pp.
          <volume>17</volume>
          {
          <fpage>32</fpage>
          .
          <string-name>
            <surname>CEUR-WS.org</surname>
          </string-name>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>