<!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>HyLAR: Hybrid Location-Agnostic Reasoning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mehdi Terdjimi</string-name>
          <email>mehdi.terdjimi@liris.cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Lionel Médini</string-name>
          <email>lionel.medini@liris.cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michael Mrissa</string-name>
          <email>michael.mrissa@liris.cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Université de Lyon, LIRIS Université Lyon 1 - CNRS UMR5205</institution>
          <addr-line>F-69622</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The question of client-side reasoning is crucial to semantic web application design as client performances drastically increase. It is an opportunity for ubiquitous devices to use semantic technologies. In this paper, we propose a lightweight, modular and adaptive architecture developed in JavaScript for hybrid client/server side reasoning. We evaluate the performance of the reasoning process with different browsers, devices and network conditions, and discuss the best strategy with respect to the envisioned reasoning tasks.</p>
      </abstract>
      <kwd-group>
        <kwd>mobile reasoning</kwd>
        <kwd>ubiquitous semantic web</kwd>
        <kwd>client-side reasoning</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>To address scalability concerns that arise with high numbers of simultaneous requests,
web application designers dispose of several tools, among which caching static data and
deferring code execution from the server to the client side. But even if in average, client
processing resources augment at a fast pace, they remain heterogeneous and in some cases,
too limited to execute heavy calculation processes. Adaptivity and flexibility depending
on the client resources is therefore necessary. This concern also arises with semantic
web technologies: solving SPARQL queries for a large number of clients can require
heavy reasoning processes and cause endpoints unavailability. Client-side reasoning is
therefore to consider while designing a semantics-enabled web application. Moreover,
mobile devices and smart appliances provide an opportunity for semantic technologies
to exploit the paradigm of ubiquitous computing and provide knowledge sharing and
reasoning facilities wrt. standards on different devices. But again, their diversity and
heterogeneity require the ability to defer reasoning tasks on a client or to perform them
on the server if the client is unable to handle them.</p>
      <p>In this paper, we propose an approach and a corresponding architecture for locating
the different steps of a reasoning process on either server or client side, and evaluate
the execution times of each of these steps depending on their locations. We overview
different approaches allowing mobile reasoning in Section 2. In Section 3, we propose
our contribution: we distinguish between the reasoning steps that can be pre-processed
and those that must be processed at request time. We then present an architecture to deploy
these steps on either server or client-side. We evaluate performances in three different
deployment situations. We discuss our results in Section 4 and give work perspectives in
Section 5.</p>
    </sec>
    <sec id="sec-2">
      <title>Mobile reasoning state of the art</title>
      <p>On the one hand, web servers are often facing breakdowns and unavailability issues when
serving semantic data as SPARQL endpoints. On the other hand, client-side semantic
processing must deal with resource limitations, especially on mobile devices. The main
motivation that conducted to the following reasoning approaches was the need to optimize
reasoning for resource-constrained devices.</p>
      <p>
        Krishnaswamy and Li [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] discuss challenges in mobile OWL reasoning. They describe
how to reduce load by configuring reasoners for precise tasks using limited description
logics. Kollia and Glimm [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] propose to rewrite costly-to-evaluate axiom templates into
smaller templates. A Triple Pattern Fragments [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] (TPF) interface is a Web API to RDF
data where clients can ask for triples matching a certain triple pattern. This approach
relies on intelligent clients that query TPF servers to address the problem of scalability
and availability of SPARQL endpoints. However, the use of a server is necessary.
      </p>
      <p>
        Current existing mobile reasoners are based on first-order logic (FOL), managing
Tbox (schema), Rbox (roles) and Abox (assertions). Sinner and Kleemann’s KRHyper [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
is a novel-tableaux based algorithm for FOL, but encounters memory exhausting problems
when the reasoning task becomes too large for the device, as pointed out in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Based
on ALCN , Mine-ME 2.0 from Ruta et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is used on Android devices. Embedded
reasoners such as the E L+ reasoner proposed by Grimm et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] are capable of reasoning
on large Tboxes due to the limitations of E L (no individuals nor concept disjointness).
But neither [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] nor [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] provide web client access. An approach to embed a reasoner in
mobile devices is to rely on web standards and run it in a web browser in Javascript. Other
works are oriented towards web-based technologies. They rely on Javascript reasoners
that can be embedded in mobile devices and ran on the device browser. EYE1 is a
NodeJS2-compatible reasoner capable of inferring on FOL rules, performing server-side
reasoning while a client widget renders a graphical interface for SPARQL querying. As
far as we know, the reasoner has not been ported onto the client side. Based on the JSW
Toolkit, OWLReasoner3 allows client-side processing of SPARQL queries on OWL 2
EL ontologies. After parsing an ontology, a “classification” step performs its deductive
closure to return its Tbox and Abox and converts them into a relational database. SPARQL
queries sent to the reasoner are rewritten into SQL queries, and processed on the database.
To the best of our knowledge, OWLReasoner is the only full-JavaScript OWL 2 EL that
can be used offline in a web client. However, its SPARQL engine is limited to basic rule
assertions.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Contribution</title>
      <p>Our contribution aims at designing reasoning processes that “bridge the gap between
the web and the semantic web”4. The first envisioned means to tackle this problem is
to make better use of standard web mechanisms, such as HTTP caching and proxying.
1 http://reasoning.restdesc.org/
2 https://nodejs.org/
3 https://code.google.com/p/owlreasoner/
4 Phil Archer, W3C, Semweb.Pro Paris, Nov. 2014
The second one is to cope with recent advances in web applications and exploit client
resources by deferring code execution on the client. We focus on JavaScript-enabled
reasoners, so that the same parts of code can both be deployed on the client and server
sides, to provide an adaptable reasoning task. We also plan to build an architecture with
respect to W3C standards, using description logics over FOL. For these reasons, our
implementation is based on OWLReasoner.</p>
      <p>We therefore aim at separating reasoning tasks executed once and preprocessed on
server side (parsing and classification steps) and tasks executed when a query is sent to
the reasoner (SPARQL query parsing, rewriting and reasoning). These steps are depicted
in Figure 1. The following subsections characterize the most suitable architecture by
evaluating the reasoning efficiency wrt. several parameters: client resource limitation,
number of simultaneous clients requesting the SPARQL endpoint, size of the processed
ontology and network latency.
3.1 Implementation
We here introduce the Hybrid Location-Agnostic Reasoner (HyLAR)5 architecture, used
to perform our experiments. HyLAR is based on the separation of OWLReasoner JSW
modules that perform ontology classification (JSW Classifier), ontology and SPARQL
query parsing (JSW Parser) and reasoning (JSW Reasoner). These steps are packaged
as Node.js modules and AngularJS6 services. This way, they can be executed on either
the server or client. On the client side, the reasoner modules can be embedded either
in a regular angular service, or in a web worker. They are queried by an independent
angular service using an asynchronous promise pattern, so that the main service is totally
agnostic about the location of the reasoning modules.
5 https://github.com/ucbl/HyLAR (GitHub)</p>
      <p>http://dataconf.liris.cnrs.fr/owlReasoner/ (website)
6 http://www.angularjs.org
We consider four scenarios, representing all possible steps of the reasoning process: the
scenario (0) for loading client scripts; (1) for loading a raw ontology; (2) for performing
ontology parsing, classification and loading the resulting JSON object; (3) for SPARQL
query processing. We used the architecture presented above to evaluate the overall
reasoning process times in three situations: full server-side, full client-side and hybrid
(server-side parsing and classification, and client-side query processing). Figure 2 shows
(1), (2) and (3) for each situation. Additionally, for the hybrid and full client-side variants,
client-side parts are evaluated both with and without web worker. We assume that scripts
and ontologies are available on the server. All scenarios conform to a
query-processingresponse pattern. In the result tables, we noted [Q] the time for the client’s request to
reach the server; [P] the processing time and [R] the time for the server response to reach
the client. Depending on the scenario and location of the calculations, some parts of this
steps/patterns are considered immediate (e.g. querying the local reasoner to process a
query). They are noted in the result tables as not applicable. Each evaluation is tested
on two ontologies7: A (1801 class assertions and 924 object property assertions) and B
(12621 class and no object property assertions)8.</p>
      <p>
        A first evaluation shows network request and response delays for each scenario. It is
realized by simulating a remote server with Clumsy 0.29. [R0] is the time for the client to
load scripts and following are the respective query/response times for [Q1]/[R1] retrieving
the raw ontlogy, [Q2]/[R2] retrieving the classification result and [Q3]/[R3] sending
7 We chose ontologies of “reasonable” sizes, representing datasets that a web application can
require. For instance, ontology B has been used to perform client-side recommendation [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
8 Due to OWLReasoner query engine limitations that does not currently allow querying individuals
nor data property assertions, our evaluations are limited to class and object property assertions.
The reader will see in the discussion that even if ontology complexity changes calculation times,
it leads to the same conclusions.
9 http://jagt.github.io/clumsy/
Ontologies A / B [R0] [Q1] [R1] [Q2] [R2] [Q3] [R3]
Remote server 334 54 110 / 275 119 / 120 167 / 647 146 / 154 61 / 85
the SPARQL query and retrieving results. A second evaluation compares processing
times for [P2] classification and [P3] reasoning in three different configurations: a Dell
Inspiron (with Chrome), a Nokia Lumia 1320 (Snapdragon S4 @ 1700 MHz, with
Internet Explorer), a Samsung Galaxy Note (ARM cortex A9 Dual-Core @ 1,4 GHz,
with Firefox) and a Node.js server set up in the Inspiron.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Discussion</title>
      <p>As expected, we can see in Table 2 that the server has the best results for the classification
processing time and can use caching. Even if the raw ontology is faster to load than the
classification results, loading scripts and data on the client is much faster than performing
the same classification step on each client. Therefore, it makes no sense to defer and
duplicate heavy calculations onto clients, rather than pre-calculating them on the server
and caching results. Table 2 shows an important difference between configurations:
we keep reasonable processing time for the query answering task in good to average
configurations (e.g. Inspiron and Lumia), but the older Galaxy Note is ten times slower
than the server. For such limited resource devices, the server could therefore take over
the answering process. More generally, for M clients and N queries/client, the three
configuration calculation times can be calculated as follows10:
– server-side: P2server + M N (Q3 + P3server + R3)
– client-side: M (R0 + Q1 + R1) + P2client + N P3client
– hybrid: P2server + M (R0 + Q2 + R2) + N P3client</p>
      <p>Globally, the evaluation shows that choosing a location for the query answering
process is not as simple as for the classification step. For low client resources, ontology
usage (number of queries per client) and server load (number of clients), it can be more
efficient to perform this step on the server. But as these parameters grow, it appears
that relocating query processing on the client can be a good strategy, since queries
can be processed autonomously on each client. A more powerful server would shorten
server-side response times, resulting in shifting the strategy switching point, but higher
performance, and therefore scalability, can be achieved by deferring this step on clients.
10 Server-side classification (performed once and then cached) and client-side calculations
(performed in parallel) are only counted once.</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion and future work</title>
      <p>In this paper we propose HyLAR, an adaptable architecture for OWL reasoning, based
on OWLReasoner. The main benefit of our architecture is the possibility to switch
the different parts of the reasoning code on either client or server side. We evaluate
three implementations (full server, full client or hybrid) on different devices, using
two ontologies of different sizes. Experiments show that deductive closure should be
performed on the server side. Besides that, client-side processing has an important initial
cost and is, as always, dependent on the client resources. Therefore, as performing the
whole process makes sense for a restricted number of queries, it is worth deploying a
reasoner and loading ontologies on clients when scalability concerns come into play. Our
next move is to define a context-aware approach to automatically adapt the reasoning
process to ontology size, client and network conditions. Another perspective for our
approach is to study the impact of INSERT and UPDATE queries, as well as other reasoning
approaches. To do this, we need to improve or replace the limited reasoner embedded
in HyLAR.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Grimm</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Watzke</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hubauer</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cescolini</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Embedded EL+ reasoning on programmable logic controllers</article-title>
          .
          <source>In: The Semantic Web-ISWC</source>
          <year>2012</year>
          , pp.
          <fpage>66</fpage>
          -
          <lpage>81</lpage>
          . Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kollia</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Optimizing SPARQL query answering over OWL ontologies</article-title>
          .
          <source>arXiv preprint arXiv:1402.0576</source>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Krishnaswamy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>Y.F.</given-names>
          </string-name>
          :
          <article-title>The mobile semantic web</article-title>
          .
          <source>In: Proceedings of the companion publication of the 23rd international conference on World wide web companion</source>
          . pp.
          <fpage>197</fpage>
          -
          <lpage>198</lpage>
          . International World Wide Web Conferences Steering Committee (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Médini</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bâcle</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nguyen</surname>
          </string-name>
          , H.D.T.:
          <article-title>DataConf: Enriching conference publications with a mobile mashup application</article-title>
          (May
          <year>2013</year>
          ), http://liris.cnrs.fr/publis/?id=6032, lIME'2013 Workshop at WWW'2013 conference
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ruta</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scioscia</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Loseto</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gramegna</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ieva</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Di Sciascio</surname>
          </string-name>
          , E.:
          <article-title>Mini-me 2.0: powering the semantic web of things</article-title>
          .
          <source>In: 3rd OWL Reasoner Evaluation Workshop (ORE</source>
          <year>2014</year>
          )
          <article-title>(</article-title>
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Sinner</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kleemann</surname>
          </string-name>
          , T.:
          <article-title>KRHyper-in your pocket</article-title>
          .
          <source>In: Automated Deduction-CADE-20</source>
          , pp.
          <fpage>452</fpage>
          -
          <lpage>457</lpage>
          . Springer (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hartig</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Meester</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Haesendonck</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Vocht</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vander</surname>
            <given-names>Sande</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Cyganiak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Colpaert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Mannens</surname>
          </string-name>
          , E., Van de Walle, R.:
          <article-title>Querying datasets on the Web with high availability</article-title>
          .
          <source>In: Proceedings of the 13th International Semantic Web Conference. Lecture Notes in Computer Science</source>
          , vol.
          <volume>8796</volume>
          , pp.
          <fpage>180</fpage>
          -
          <lpage>196</lpage>
          . Springer (Oct
          <year>2014</year>
          ), http: //linkeddatafragments.org/publications/iswc2014.pdf
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>