<!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>A Power Consumption Benchmark Framework for Ontology Reasoning on Android Devices</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Edgaras Valincius</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hai H. Nguyen</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Je Z. Pan</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Aberdeen</institution>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Ontology reasoning, in particular query answering with Description Logics-based ontologies, is a power-consuming task, especially in mobile settings where such a resource is limited and shared by other processes. To be able to determine whether a reasoning task will be consuming signi cant amount of power, a benchmark framework will be needed for ontology designers and reasoner developers. In this paper, we report our work on a power consumption benchmark framework that can be used to evaluate and compare the level of battery consumption of di erent Description Logics reasoners on Android devices. To calculate the power consumption of the reasoners, we measured the current ow and the voltage of the integrated battery. We focus on Android-based devices and evaluate the framework using 3 popular DL reasoners.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The international Telecommunication Union revealed the ubiquity of mobiles,
especially Android-based smartphones which takes around 77% of worldwide
smartphone operating system market share [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. To enable semantics data
integration, some reasoning processes for Description Logics(DL)-based ontologies
need to be performed. Although such reasoning tasks can be done on the cloud,
with results being downloaded onto mobile devices afterwards, it has been
indicated that local reasoning might produce results timely and they are robust to
Internet connection unreliability [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], not to mention the ability to avoid privacy
and security issues while uploading personal data to the cloud. Due to limited
resources of mobile devices, the performance of reasoning tasks across di erent
hardware platforms can vary and there has been not much research on how such
reasoning tasks would a ect the battery of mobile devices.
      </p>
      <p>
        The closest work to ours is from Patton and McGuinness [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which uses
external power supply with xed voltage instead of battery. The proposed framework
system in this paper, however, is capable of measuring the power consumption
of ontology reasoners from the operating system of the mobile devices,
taking varying voltage of the battery into account. Our solution will thus make it
easier for ontology designers and reasoner developer to test and evaluate their
ontologies/reasoners in terms of power consumption e ciency, without having
to connect mobile devices to external power. It is particularly important for
smartphones with a built-in battery that cannot be taken out of the devices.
      </p>
      <p>
        In our study, we used three ontology reasoners in this experiment: HermiT [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
Pellet [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], and AndroJena. In this work we investigate on how power is consumed
on mobile-version of the above-mentioned reasoners on classi cation, instance
retrieval (with and without inference) and query answering tasks. HermiT and
Pellet can not be directly supported by Dalvik due to unsupportive Java classes.
Yus et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] provided the android-ported versions for them. AndroJena is an
Android-ported version of the Jena reasoner that compatible with Dalvik. It
should be noted that some other ontology reasoners can work on Android as
well, such as ELK [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and TrOWL [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. A more comprehensive study will be part
of our future work.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Our Approach</title>
      <p>To calculate the overall power consumption, electrical energy over some time
have to be measured. Our approach involves measuring the current ow (in
Ampere) and the voltage of the battery (in Volt). Given these values change
over time we can compute the amount of power consumption that has been used
for a speci c task. Note that we do not use existing android apps available on
a market today to measure power consumption for two reasons: 1) With these
apps, we would not be able to programmatically start and stop measuring the
capacity of the battery when needed. 2) the accuracy of mentioned approach can
be a ected by the age of the battery due to the use of total capacity instead of
the actual capacity.</p>
      <p>To measure and calculate the battery information in mobile phones, hardware
manufacturers have developed a range of chips, namely \fuel gauge chips". Most
fuel gauges integrated into mobile phones are used for monitoring and just a
few ones use their own sophisticated gauging algorithm to calculate the battery
State-Of-Charge (SOC), available capacity, and other useful information such as
current ow or voltage. In this experiment, we are not using gauging algorithms
to calculate the battery SOC as this would depend on the types of fuel gauges
used by phone manufactures. The calculation of power consumption is performed
using the following equation:</p>
      <p>P ower Consumption = Current V oltage ErrorRate=T ime
where Current and V oltage are retrieved using the properties in Android's
BatteryManager class, BATTERY PROPERTY CURRENT NOW and EXTRA VOLTAGE,
respectively. Note that since the value of V oltage can be varied, it is necessary
to update the changes by implementing a BroadcastReceiver which is triggered
by a change of battery status. All values for this experiment had to be retrieved
periodically to make sure the results are accurate and the power consumption
can be calculated. To do so, a timer was set up to check and store the values
necessary to calculate the power consumption for every second.</p>
      <p>To determine the error rate of this or similar experiments, the actual capacity
of the battery had to be compared with the total capacity of the battery. Total
capacity was calculated by dividing the factory-determined mili-amphere-hours
(mAh) from the percentage (100) of the battery. Then the actual capacity per 1%
of the battery was measured using the current sensor and both values compared.</p>
      <p>Before Android Lollipop (starting with the Android API level 21), it was
almost impossible for mobile-apps developer to access accurate information
regarding battery usage from the \fuel gauge sensors" using a software approach.
Since Android API level 21, information such as the State-of-charge (SOC),
voltage, instantaneous battery current, and others provided by the fuel gauge sensors
can be accessible for developers by a range of new properties and methods in
BatteryManager class. Note that di erent smartphones will use di erent
hardware, in particular di erent fuel gauge sensors, and hence Android API Level 21
has enabled a generic interface for apps developers to access battery information
in an abstract and standardised way.</p>
      <p>Although the power measuring techniques using integrated battery's current
sensor was suggested around 5 years ago, they have been facing many
compatibility issues. The main issue is that di erent manufacturers provide their devices
with di erent type of current sensors. As a result, it has been lack of a standard
way for Android-based apps developers to access battery information to
calculate power consumption accurately. We believe our approach is future-proof, in
that it is targeted for phones with Android API Level 21 and above while later
generations of Android-based phones will need to support at least Android API
Level 21. Given current rapid changes in the smartphone markets, it is
reasonable to develop an approach that is compatible to current and later version of
Android smartphones.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Evaluation</title>
      <p>3.1</p>
      <sec id="sec-3-1">
        <title>Experiment Setup</title>
        <p>
          The experiment was done using a OnePlus One device, with 2.5GHz
processor, 3GB RAM and 3100mAh battery. We used the datasets generated by the
LUBM benchmark generator [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. Four datasets of di erent sizes (in terms of the
number of departments, ranging from 1, 5, 10 to 15) were generated. We chose
to perform four di erent reasoning tasks for each reasoner: simple instance
retrieval, complex query answering with the inference, which is the act or process
of deriving logical conclusions from premises known or assumed to be true, just
inference, and TBox classi cation. The last two tasks were to see if reasoning
tasks with less or no involvement of individuals can a ect the power consumption
of di erent reasoners.
        </p>
        <p>For each reasoner, there were 16 simulation tests performed in total (4
reasoning tasks and 4 datasets of di erent sizes). To prevent bias caused by the
order of running the reasoners, we ran the 3 reasoners in all possible orders, e.g.,
6 runs for 3 reasoners per test and got the average timing. In addition, the
conditions of the experiment are kept the same for all the runs/reasoners, including
current temperature and the level of the battery at the beginning of every test.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Results</title>
        <p>
          After executing the test queries on the mobile reasoners, we compared the
results returned by 3 reasoners to verify correctness. It was found that all reasoners
produce the same answers to given queries except one case with the AndroJena
reasoner. For classi cation reasoning tasks, AndroJena produced incomplete
result. According to Jena's documentation [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], relationships between classes, when
using Jena's OntModel, will be reported if they were asserted explicitly by the
document. Otherwise reasoner ags plausible relationships by blank nodes. The
class subsumptions, produced by other two reasoners, can be re ected in the
output. This explains why the output of the SPARQL queries produced by Jena
reasoner di ers from ones produced by Pellet and Hermit.
        </p>
        <p>
          Figure 1 (for dataset with 1 department) and Figure 2 (for dataset with 15
departments) both show that di erent reasoners perform di erently with each
reasoning task. Firstly, instance retrieval task is the suggestion of LUBM project
and was also evaluated in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. The results that from our experiments and ones
reported in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] both suggested that HermiT reasoner consumes much higher
power than its competitors. AndroJena and Pellet reasoners, on the other hand,
were using power consumption similarly. Although, it was recorded the slightly
higher power drain from the Pellet reasoner.
        </p>
        <p>
          The second task, Inference and Instance Retrieval, was using Query 10 from
LUBM's set of test query and di ers from Query 6, 7, 8 and 9, which were used
in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], in that it only requires the (implicit) subClassOf relationship between
GraduateStudent and Student.
        </p>
        <p>
          Our Query 3 (for inference only) and Query 4 (for T-Box classi cation task)
were to inspect the power consumption for reasoning services with less or no
involvement of individuals. These were not evaluated by the work [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Interestingly,
HermiT outperformed the other reasoners in these tasks.
        </p>
        <p>
          In [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], the largest dataset that authors used contained only 4 departments.
This paper, however, aims to test reasoner's scalability and hence the
experiments were performed against a wide range of datasets, from ones with 1
department to ones with 15 departments. AndroJena cannot cope with large datasets
so it had to be aborted while performing two reasoning tasks including
logical inference, due to the boundaries that were set. Nevertheless, the rest of the
reasoners performed well and produced the results.
        </p>
        <p>It was found out that voltage is reducing when the state of charge is
decreasing. Moreover, some tests took up to 51 minutes to complete their task.
During these tests the phone battery drained about 21% of the capacity and the
voltage decreased by 220mV. This happened because the permutation launches
3 reasoners, one after another a multiple times. Hence the results produced at
the beginning of the simulation test were slightly di erent than the ones received
later on during the same test, due to the decrease of voltage.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Discussion</title>
        <p>This experiment proved that reasoners can be successfully compiled on the
android mobile device. The results revealed that voltage is a ecting the outcome
of the reasoning task. It was calculated that during the most time consuming
test, used in this experiment, voltage can di er by about 220mV. It also caused
the power consumption values calculated using varying voltage di er.</p>
        <p>The results also suggested that the e ect of di erent reasoning tasks and the
size of dataset to reasoners are important. AndroJena reasoner, for example, was
found to require much more hardware resources than other reasoners when
performing reasoning tasks involving inference and running on datasets containing
more than 21 thousand triples. Therefore, the reasoner had to be manually
suspended from occupying all the memory and getting into the outOfMemory error.
HermiT revealed its advantages over other reasoners when performing complex
tasks. However, simple tasks such as instance retrieval were causing HermiT
to take longer time and drain much more power. Pellet, on the other hand, was
showing stable results during the whole experiment. It was in average the fastest
and the least power consuming reasoner. Moreover, Pellet was also capable to use
either OWL or Jena APIs, so it has higher compatibility over other reasoners,
because it can support, for example, both SPARQL and SPARQL-DL queries.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Related Work</title>
      <p>
        The most relevant work to this paper is Paton and McGuiness's work [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which
uses external power supply with xed voltage instead of battery. Our setting
is closer to the real world set up. Furthermore, their approach only works for
smartphones with replaceable batteries but not for ones with built-in battery,
which is in fact the case for current generation of smartphones. Note that our
approach does not only work for Google Nexus devices but for any Android 5.0
and later devices (with Android API level 21 and later).
      </p>
      <p>
        William Van Woensel et al. in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] conducted the performance analysis
(instead of power consumption) of mobile reasoners. The Benchmark data and
rule-sets in their work were selected from [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The experiment was conducted
on Android platform but the framework was claimed as a cross-platform
solution.This is an advantage compared to our approach which depends on the use
of Android API 21 to measure current ows and voltage. Given the dominance
of Android-based smartphones in the market, we believe that our approach is a
simpler yet e cient solution. Besides, unlike [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] our approach does not require
the datasets to be converted into another format before running the benchmark.
      </p>
      <p>
        The main idea in paper [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] is to use battery built-in voltage sensor, measure
time period and the state of discharge (SOD), i.e., the percentage of the rated
battery energy that has been discharged. To calculate power consumption using
those values the variation of SOD based on voltage needs to be determined
within the period of testing time. An issue with this approach is that the formula
P (t1 t2) = E (SOD(V1) SOD(V2)) calculating the power consumption
is using the total capacity of battery (E) that is decreasing due to ageing.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>We have presented an approach to measuring power consumption for
Androidbased DL reasoners in a software level instead of the hardware levels as in
previous works. By using new features provided in Android API Level 21, it is now
possible to access battery information such as voltage, current ows in order to
calculate the accurate power consumption of reasoning tasks. To evaluate the
approach, we have conducted some initial experiments to compare the power
consumption of di erent reasoners w.r.t. di erent reasoning tasks against datasets
of di erent scales. Reasoners were compared in term of power consumption while
running on mobile device and using the smart battery's sensors instead of
external equipments.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>International</given-names>
            <surname>Data Corporation</surname>
          </string-name>
          .
          <article-title>Smartphone os market share</article-title>
          ,
          <year>q4 2014</year>
          . http://www.idc.com/prodserv/smartphone-os
          <article-title>-market-share</article-title>
          .jsp,
          <source>2014. Accessed 29 March</source>
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Yuanbo</given-names>
            <surname>Guo</surname>
          </string-name>
          , Zhengxiang Pan, and
          <article-title>Je He in. Lubm: A benchmark for owl knowledge base systems</article-title>
          .
          <source>Web Semantics: Science, Services and Agents on the World Wide Web</source>
          ,
          <volume>3</volume>
          (
          <issue>2-3</issue>
          ),
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>IMPACT-AF</surname>
          </string-name>
          .
          <article-title>Integrated management program advancing community treatment of atrial brillation</article-title>
          . http://impact-af.ca/.
          <source>Accessed 29 March</source>
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <article-title>[4] jena</article-title>
          .apache.org. Ontmodel. https://jena.apache.org/documentation/javadoc/jena/com /hp/hpl/jena/ontology/OntModel.html.
          <source>Accessed 29 March</source>
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Yevgeny</given-names>
            <surname>Kazakov</surname>
          </string-name>
          and
          <string-name>
            <given-names>Pavel</given-names>
            <surname>Klinov</surname>
          </string-name>
          .
          <article-title>Experimenting with elk reasoner on android</article-title>
          .
          <source>In ORE2013</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Evan</surname>
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Patton</surname>
          </string-name>
          and
          <string-name>
            <surname>Deborah L. McGuinness</surname>
          </string-name>
          .
          <article-title>A Power Consumption Benchmark for Reasoners on Mobile Devices</article-title>
          . In ISWC2014,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Rob</given-names>
            <surname>Shearer</surname>
          </string-name>
          , Boris Motik, and
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          .
          <article-title>Hermit: A highly-e cient owl reasoner</article-title>
          .
          <source>In OWLED</source>
          , volume
          <volume>432</volume>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Evren</given-names>
            <surname>Sirin</surname>
          </string-name>
          , Bijan Parsia, Bernardo Cuenca Grau, Aditya Kalyanpur, and
          <string-name>
            <given-names>Yarden</given-names>
            <surname>Katz</surname>
          </string-name>
          .
          <article-title>Pellet: A practical owl-dl reasoner</article-title>
          .
          <source>Web Semantics: Science, Services and Agents on the World Wide Web</source>
          ,
          <volume>5</volume>
          (
          <issue>2</issue>
          ):
          <volume>51</volume>
          {
          <fpage>53</fpage>
          ,
          <year>2007</year>
          .
          <article-title>Software Engineering and the Semantic Web</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Edward</given-names>
            <surname>Thomas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Je Z.</given-names>
            <surname>Pan</surname>
          </string-name>
          , and Yuan Ren.
          <article-title>TrOWL: Tractable OWL 2 Reasoning Infrastructure</article-title>
          . In
          <source>the Proc. of the Extended Semantic Web Conference (ESWC2010)</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>William</given-names>
            <surname>Van Woensel</surname>
          </string-name>
          , Newres Al Haider,
          <article-title>Ahmad Ahmad, and Syed Sibte Raza Abidi. A cross-platform benchmark framework for mobile semantic web reasoning engines</article-title>
          .
          <source>In ISWC2014</source>
          , pages
          <fpage>389</fpage>
          {
          <fpage>408</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Roberto</surname>
            <given-names>Yus</given-names>
          </string-name>
          , Carlos Bobed, Guillermo Esteban, Fernando Bobillo, and
          <string-name>
            <given-names>Eduardo</given-names>
            <surname>Mena</surname>
          </string-name>
          .
          <article-title>Android goes semantic: Dl reasoners on smartphones</article-title>
          .
          <source>Citeseer.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Lide</surname>
            <given-names>Zhang</given-names>
          </string-name>
          , Birjodh Tiwana, Zhiyun Qian, Zhaoguang Wang, Robert P Dick, Zhuoqing Morley Mao, and
          <string-name>
            <given-names>Lei</given-names>
            <surname>Yang</surname>
          </string-name>
          .
          <article-title>Accurate online power estimation and automatic battery behavior based power model generation for smartphones</article-title>
          .
          <source>In Proceedings of the eighth IEEE/ACM/IFIP international conference on Hardware/software codesign and system synthesis</source>
          , pages
          <volume>105</volume>
          {
          <fpage>114</fpage>
          . ACM,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>