<!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>MobileWave: Publishing RDF Streams From SmartPhones</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yehia Abo Sedira</string-name>
          <email>yehiamohamed.abosedera@mail.polimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Riccardo Tommasini</string-name>
          <email>riccardo.tommasini@polimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emanuele Della Valle</string-name>
          <email>emanuele.dellavalle@polimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Politecnico di Milano, DEIB</institution>
          ,
          <addr-line>Milan</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The number of applications leveraging data from sensors on smart-phones is growing. However, they tend to focus on single Apps for personal sensing rather than trying to achieve a greater good (social sensing) by addressing challenges as App interoperability and geographical distribution of devices. In this paper, we present MobileWave a framework that allows creating, composing and publishing RDF streams from smart-phones. MobileWave extends TripleWave with a publish/subscribe middleware that collects a uent RDF Streams, composes them into a swollen RDF stream and publishes it on the Web.</p>
      </abstract>
      <kwd-group>
        <kwd>RDF Stream</kwd>
        <kwd>Ontology Based Data Access</kwd>
        <kwd>Mobile Phones</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Smart-phones may not have started the Web-of-Things revolution, but are now
active part of it. We all became sensor when we started posting on social media,
but many applications are now turning the phones into actual platform able to
measure all the aspect of our life [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Thanks to frameworks like HealthKit1 or
GoogleFit2 the number of applications leveraging on phones sensor capabilities
is growing. However, most of them are limited to personal sensing [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], i.e. their
scope is the phone user, e.g. location tracking and sleep monitoring. Only few
apps, like Waze3, widen their scope to pursuit social sensing [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which envisions
giant groups of people with a common interest exchanging data to get more
value.
      </p>
      <p>
        Can the Semantic Web actively contribute to this change of paradigm? Few
years ago, the Stream Reasoning (SR) community proposed a framework,
TripleWave, to publish RDF streams on the Web [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. TripleWave works e ectively when
it has to transform data from a single web source, e.g. Wikipedia changes, and
when it has to replay historical RDF Streams [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. More recently, the Linked Data
community proposed a way to exchange noti cation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. However, to foster social
sensing, we need to consume data from millions of sources.
      </p>
      <sec id="sec-1-1">
        <title>1 https://developer.apple.com/healthkit/</title>
        <p>2 https://www.google.com/fit/
3 Waze { https://www.waze.com/en-GB/ that combines GPS and social data from
millions of users provide better tra c analyses.</p>
        <p>In this paper, we propose MobileWave, a framework that allows accessing,
gathering and collectively publishing RDF streams from Smart-Phone sensors.
MobileWave: (i) exploits Ontology Based Data Access (OBDA) techniques on
smart-phones; (ii) de nes a protocol between phones and a publish-subscribe
middleware; (iii) creates a composed RDF stream and publishes it through an
enhanced version of TripleWave.
2</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>MobileWave</title>
      <p>As in the social sensing vision, we aim at gathering data from millions of
smartphone users. This practically implies two problems:
1. a data integration problem, since di erent phones have di erent speci
cations, hardware and licensing; and
2. a scalability problem, since we cannot rely neither in high computational
power nor in long battery durations.</p>
      <p>Unfortunately, usual techniques to solve these tasks would drain the phones'
battery. Phone does have enough space, memory or power to integrate data
and stream directly to all the interested consumers. In the following sections we
explain how MobileWave solves them using Figure 1 to visualize the work ow.
2.1</p>
      <p>Virtual RDF Streams on the Phones
In order to solve the data integration problem (1), we ported on mobile OBDA
techniques. We developed an Integrate Conceptual Model (ICM), MobileWaveOnto4</p>
      <sec id="sec-2-1">
        <title>4 https://goo.gl/8ZIC2Q</title>
        <p>
          owards Distributed RDF Stream Publication
using Semantic Sensor Networks (SSN) ontology [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] and we used Ontop5 to
dene R2RML6 mappings between that ontology and the phone data. Figure 1.(a)
shows the process of mapping de nition using the aforementioned technologies.
        </p>
        <p>In MobileWaveOnto, we modeled both static information about the device,
i.e. the capabilities of the deployed sensors, and sensor observations. While the
former represent quasi-static information, the latter are highly dynamic.
Therefore, two kinds of mappings are possible, i.e. (a) mappings describing the device
and; (b) mappings representing a sensor observation as time-varying graph.
Listings 1 and 2 respectively exemplify these mappings.</p>
        <p>Figure 1.(b) shows the deployment of the R2RML mappings on the phone.
MobileWave applies the mapping by means of Apache Cordova7, which o ers a
generic view over phones hardware. R2RML mappings are translated in a
JSONLD based syntax which is more convenient for Apache Cordova to combine with
phone data, but it still preserves the semantic value of R2RML. Each translation
includes: (1) a Context that maps terms to IRIs, and; (2) a Pattern list that
contains the actual mappings from Apache Cordova's JSON to RDF graphs.
2.2</p>
        <p>From A</p>
        <p>uents to Swollen RDF Streams
In order to solve the scalability problem (2), MobileWave comprises a
publish/subscribe middleware that exposes REST methods for device to register and
then composes and publishes an RDF stream to be consumed. We name this
stream Swollen RDF stream and a uent s RDF streams those stream that
participate. To be added as an a uent, a device must identify itself by sharing a
descriptions le. We call it description Graph (dGraph) and we build it by means
of the (a)-type mappings described in Section 2.1 and exempli ed in Listing 1.
MobileWave middleware stores the dGraph and replies to the device with the
URL where the sensor observations should be pushed.</p>
        <p>"dGraph": [f
"subject": "#GPSSensor ffuuidgg",
"sources": ["device", "position "],
"properties": [f
"predicate": "rdf:type",
"object": "GPSSensor",
" isLiteral ": false
g, f
"predicate": "ssn:onPlatform",
"object": "SmartPhone ffuuidgg",
" isLiteral ": false
g]g]
"iGraph": [f
"subject": "GPSObservation fftimegg",
"sources": ["device", "position "],
"properties": [f
"predicate": "rdf:type",
"object": "GPSObservation",
" isLiteral ": false
g, f
"predicate": "ssn:observedBy",
"object": "GPSSensor ffuuidgg",
" isLiteral ": false
g]g]
Listing 1: dGraph mapping example</p>
        <p>Listing 2: iGraph mapping example</p>
        <p>In order to publish the Swollen RDF Stream we rely on two TripleWave's
abstractions: the sGraph, a named graph that describes the stream itself and;
the iGraph, i.e. a named graph that represents one element of the stream. We
5 https://github.com/ontop/ontop
6 W3C Recommendation: https://www.w3.org/TR/r2rml/
7 https://cordova.apache.org/
can represent both the a uent RDF streams and the Swollen RDF using these
abstractions.</p>
        <p>MobileWave middleware is aware of all the a uent RDF streams
descriptions (dGraphs) and it can select and compose them to de ne the Swollen RDF
stream's sGraph accordingly to a given user need. For instance,it can select only
the streams that come from beacons in mobile phones located in Milan.</p>
        <p>MobileWave middleware controls the destination of the observations each
a uent sends. Therefore, an iGraph in an a uent RDF stream directly
corresponds to an iGraph in the Swollen RDF stream.</p>
        <p>Figure 1.(c) and (d) show respectively the creation and publication processes.
As we anticipated in Section 1 we developed a custom version of TripleWave
that supports this kind of stream composition. Indeed, once the sGraph of the
Swollen RDF stream is de ned the publication phase, which is illustrated in
Figure 1.(d), follows the same process of publishing a plain RDF Stream. From
a stream consumer perspective the Swollen RDF stream looks like any other
RDF stream on the Web.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>In this paper, we presented MobileWave, a framework that enables creating,
composing and collectively publishing RDF stream from mobile phones.</p>
      <p>MobileWave uses OBDA technologies to access smart-phones sensors data
and a publish/subscribe version of TripleWave that gathers data from several
devices and publishes Swollen RDF stream on the Web.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Campbell</surname>
            ,
            <given-names>A.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eisenman</surname>
            ,
            <given-names>S.B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lane</surname>
            ,
            <given-names>N.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Miluzzo</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peterson</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lu</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zheng</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Musolesi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahn</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>The rise of people-centric sensing</article-title>
          .
          <source>IEEE Internet Computing</source>
          <volume>12</volume>
          (
          <issue>4</issue>
          ),
          <volume>12</volume>
          {
          <fpage>21</fpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Capadisli</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lange</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Auer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sambra</surname>
            ,
            <given-names>A.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Linked data noti cations: A resource-centric communication protocol</article-title>
          .
          <source>In: The Semantic Web - 14th International Conference</source>
          , Portoroz, Slovenia, May 28 - June 1,
          <year>2017</year>
          , Proceedings, Part I. pp.
          <volume>537</volume>
          {
          <issue>553</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Compton</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barnaghi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bermudez</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garc</surname>
            <given-names>A</given-names>
          </string-name>
          -Castro,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Corcho</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            ,
            <surname>Cox</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Graybeal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Hauswirth</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Henson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Herzog</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          , et al.:
          <article-title>The ssn ontology of the w3c semantic sensor network incubator group</article-title>
          .
          <source>Web semantics: science, services and agents on the World Wide Web</source>
          <volume>17</volume>
          ,
          <issue>25</issue>
          {
          <fpage>32</fpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Lane</surname>
            ,
            <given-names>N.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Miluzzo</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lu</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peebles</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Choudhury</surname>
          </string-name>
          , T.,
          <string-name>
            <surname>Campbell</surname>
          </string-name>
          , A.T.:
          <article-title>A survey of mobile phone sensing</article-title>
          .
          <source>IEEE Communications Magazine</source>
          <volume>48</volume>
          (
          <issue>9</issue>
          ),
          <volume>140</volume>
          {
          <fpage>150</fpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Mauri</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>DellAglio</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Balduini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brambilla</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Della</given-names>
            <surname>Valle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Aberer</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.</surname>
          </string-name>
          :
          <article-title>Triplewave: Spreading rdf streams on the web</article-title>
          . In: International Semantic Web Conference. pp.
          <volume>140</volume>
          {
          <fpage>149</fpage>
          . Springer (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>