<!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>Mobile App Development for the Semantic Web of Things with Punya ?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Giuseppe Loseto</string-name>
          <email>giuseppe.loseto@poliba.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Evan W. Patton</string-name>
          <email>ewpatton@mit.edu</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Oshani Seneviratne</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>William Van Woensel</string-name>
          <email>william.van.woensel@dal.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Floriano Scioscia</string-name>
          <email>floriano.scioscia@poliba.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Lalana Kagal</string-name>
          <email>lkagal@mit.edu</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dalhousie University</institution>
          ,
          <addr-line>Halifax NS B3H 4R2</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Massachusetts Institute of Technology</institution>
          ,
          <addr-line>Cambridge MA 02143</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Polytechnic University of Bari</institution>
          ,
          <addr-line>70126 Bari BA</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Rensselaer Polytechnic Institute</institution>
          ,
          <addr-line>Troy NY 12180</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The paper presents a demo based on the Punya framework, described in the Resource Track paper titled “The Punya Platform: Building Mobile Research Apps with Linked Data and Semantic Features.” Punya components have been used to develop a mobile application monitoring different activities of elderly people. Data are consumed and produced according to the LDP-CoAP specification in order to support interactions in Semantic Web of Things scenarios. Submission Type: Demo | Link: http://punya.appinventor.mit.edu/ ?repo=LdpCoapTutorial</p>
      </abstract>
      <kwd-group>
        <kwd>Mobile App Development</kwd>
        <kwd>Research Apps</kwd>
        <kwd>LDP-CoAP</kwd>
        <kwd>Linked Data</kwd>
        <kwd>Remote monitoring</kwd>
        <kwd>Semantic Web of Things</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The United Nations estimate the worldwide prevalence of elderly people ( 65
years old) will increase from nearly 10% to 18% in the next 40 years,
corresponding to over 1:8 billion units in 2060 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Healthy, active aging has been
acknowledged as a global healthcare, policy, social and technological challenge.
A growing number of research projects focus on ambient-assisted living (AAL) to
support this goal [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. As the name suggests, in AAL automated activity
recognition and well-being monitoring rely on a coordinated array of information
and communication technologies deployed in regular life environments, including
home automation networks, camera systems, and mobile and wearable sensors.
Multiple data sources must be collected and analyzed continuously to assess the
subject’s conditions and detect events as soon as possible, in order to activate
? Copyright ©2021 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
timely assistance requests to caregivers in case of emergency, as well as to provide
biofeedback and context-aware support to facilitate the subject’s empowerment.
      </p>
      <p>
        In AAL system architectures, smartphones act as cluster heads with respect
to wearable sensors –in typical Body Area Network (BAN) configurations [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]–
and devices deployed in the room, communicating through short-range
lowthroughput wireless links, like Bluetooth Low Energy. Processing capabilities,
embedded sensors and personal information in the smartphone are exploited to
integrate and enrich collected data, as well as to run data pre-processing and
lightweight mining. Leveraging the Edge Computing paradigm, the mobile phone
doubles as a gateway towards a back-end infrastructure, where larger volumes
of information can be stored and analyzed.
      </p>
      <p>
        Research and development in the AAL sector has significant costs: custom
mobile app development integrating heterogeneous Internet of Things (IoT)
devices still requires specialized skills and non-negligible effort. Punya is a Semantic
Web friendly mobile app development framework built on top of the MIT App
Inventor [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], aiming to facilitate rapid prototyping and development of mobile
apps. The component-based user interface composer and block-based
programming approach grant a fully visual workflow, allowing even non-programmers to
create Android mobile apps quickly and easily. Punya adds advanced capabilities
to MIT App Inventor, including Linked Data (LD) reading and writing,
reasoning, and Semantic Web of Things (SWoT) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] protocols like the Linked Data
Platform over the Constrained Application Protocol (LDP-CoAP) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
Interoperability both in information representation and communication enables
developers to leverage LD resources in mobile and ubiquitous Web scenarios. The
proposed demo showcases such capabilities in a remote monitoring for healthy
aging use case.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>LDP-CoAP for remote monitoring with Punya</title>
      <p>
        Punya includes components to read data from several smartphone sensors, such
as accelerometer, gyroscope, orientation, temperature, pressure, and light level
sensors, if appropriate hardware is embedded in the phone. The platform also
supports LDP-CoAP for lightweight, LD-based resource dissemination and
discovery in SWoT dynamic ad-hoc contexts. LDP-CoAP is grounded on the LDP
World Web Consortium Recommendation [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] for managing collections of Linked
Data resources on the Web. However, LDP only defines resource management
primitives for HTTP, leaving out Web of Things (WoT) scenarios where more
lightweight application protocols are required. CoAP [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is an IETF (Internet
Engineering Task Force) application-level protocol for machine-to-machine
communications, based on a loosely coupled stateless client/server model.
LDPCoAP [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] defines an adaptation of the LDP specification to CoAP, which allows
publishing Linked Data on the WoT while preserving all LDP features. Using
the LdpCoapClient Punya component, a mobile app can expose data, collected
via embedded sensors or peripheral devices, as RDF resources to other parties
through an LDP-CoAP server.
      </p>
      <p>
        As a reference example, a Punya AAL app has been developed for publishing
timestamped records of Alice’s activity level as LDP resources expressed using
the SAREF for eHealth Ageing Well domain ontology [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Figure 1 shows the
application interface: the main visible component is a text box showing the latest
activity level value measured by the non-visible ActivityProbeSensor component.
The latter uses a simple algorithm for activity estimation based on the variance
of accelerometer data. The Linked Data panel of Punya interface is filled to
specify the ontology property (hasValue) and datatype (xsd:string) the text
in the textbox will be automatically associated with. The textbox is nested inside
a LinkedDataForm Punya component, which specifies the class the object inside
the form belongs to (Measurement) and the property (relatesToMeasurement)
used to link it to its parent LinkedDataForm, which represent the whole instance
constructed by the app and belongs to the Motion class. Overall, for a “medium”
activity level the generated RDF model looks like:
@prefix saref: &lt;https://saref.etsi.org/core/&gt; .
@prefix ex: &lt;http://example.com/&gt; .
ex:activity_timestamp rdf:type saref:Motion ;
      </p>
      <p>saref:relatesToMeasurement ex:measurement_123 .
ex:measurement_123 rdf:type s4ehaw:Measurement ;</p>
      <p>saref:hasValue "medium"^^xsd:string .</p>
      <p>The application logic is in Figure 2. At screen initialization time, the base URI
is set for the LDP-CoAP server collecting data. When a measurement event is
triggered by the ActivityProbeSensor, the value is extracted as a string from
the textbox. Then the non-visible LdpCoapClient Punya component performs a
POST request to the server to add the new RDF Resource into the alice LDP
Basic Container. The content type of the body of the request is set to Turtle, and
the body itself is taken from the most external LinkedDataForm above. Finally,
the unique title of the new resource consists in a keyword and a timestamp. The
app can check the outcome of the request by means of methods provided by the
LdpCoapClient component to get the response code, status and other fields.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>This paper demonstrates how mobile applications for data dissemination in
Semantic Web of Things scenarios can be easily implemented in Punya exploiting
the LDP-CoAP component. Further features in Punya, such as the LDP-CoAP
resource discovery and the reasoning components, can be used to implement
full-fledged applications for AAL, remote monitoring and many other domains.</p>
      <p>Punya includes comprehensive documentation, sample apps and built-in
tutorials for getting started on rapid app development with LD and Semantic Web
technologies. Punya apps can be valuable both as research tools for domain
experts and for end user assinstance, like in the reference healthy aging scenario.
While the demo focuses on SWoT features appealing to the former target group,
Punya supports graphical interface customization and task automation, enabling
to improve app acceptability and user experience.</p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgements</title>
      <p>This work is partially supported by Italian Ministry of Economic Development
R&amp;D project BARIUM5G (Blockchain and ARtificial Intelligence for Ubiquitous
coMputing via 5G).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bormann</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Castellani</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shelby</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>CoAP: An Application Protocol for Billions of Tiny Internet Nodes</article-title>
          .
          <source>IEEE Internet Computing</source>
          <volume>16</volume>
          (
          <issue>2</issue>
          ),
          <fpage>62</fpage>
          -
          <lpage>67</lpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Girod-Genet</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>SAREF4EHAW: an extension of SAREF for eHealth Ageing Well domain</article-title>
          .
          <source>Tech. rep.</source>
          ,
          <source>ETSI</source>
          (
          <year>2020</year>
          ), https://saref.etsi.
          <source>org/saref4ehaw/v1.1</source>
          .1/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Hasan</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Biswas</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahmed</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nafi</surname>
            ,
            <given-names>N.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Islam</surname>
            ,
            <given-names>M.S.:</given-names>
          </string-name>
          <article-title>A comprehensive review of wireless body area network</article-title>
          .
          <source>J. Netw. and Comput. Appl</source>
          .
          <volume>143</volume>
          ,
          <fpage>178</fpage>
          -
          <lpage>198</lpage>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Loseto</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ieva</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gramegna</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <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>Di Sciascio</surname>
          </string-name>
          , E.:
          <article-title>Linked Data (in low-resource) Platforms: a mapping for Constrained Application Protocol</article-title>
          . In: International Semantic Web Conference. pp.
          <fpage>131</fpage>
          -
          <lpage>139</lpage>
          . Springer (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Nilsson</surname>
            ,
            <given-names>M.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Andersson</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Magnusson</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hanson</surname>
          </string-name>
          , E.:
          <article-title>Ambient assisted living technology-mediated interventions for older people and their informal carers in the context of healthy ageing: A scoping review</article-title>
          .
          <source>Health science reports</source>
          <volume>4</volume>
          (
          <issue>1</issue>
          ) (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <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>Di Sciascio</surname>
          </string-name>
          , E.:
          <article-title>Enabling the Semantic Web of Things: framework and architecture</article-title>
          .
          <source>In: 2012 IEEE Sixth International Conference on Semantic Computing</source>
          . pp.
          <fpage>345</fpage>
          -
          <lpage>347</lpage>
          . IEEE (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Steve</given-names>
            <surname>Speicher</surname>
          </string-name>
          and
          <source>John Arwe and Ashok Malhotra: Linked Data Platform</source>
          <volume>1</volume>
          .0, https://www.w3.org/TR/ldp
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. United Nations Department of Economic and Social Affairs:
          <source>World Population Prospects</source>
          <year>2019</year>
          , https://population.un.org/wpp/
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Wolber</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abelson</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Friedman</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Democratizing computing with app inventor</article-title>
          .
          <source>GetMobile: Mobile Computing and Communications</source>
          <volume>18</volume>
          (
          <issue>4</issue>
          ),
          <fpage>53</fpage>
          -
          <lpage>58</lpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>