<!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 Framework for Semantic Discovery on the Web of Things?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Victor Charpenay</string-name>
          <email>victor.charpenay@siemens.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sebastian Käbisch</string-name>
          <email>sebastian.kaebisch@siemens.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Harald Kosch</string-name>
          <email>harald.kosch@uni-passau.de</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Siemens AG - Corporate Technology</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universität Passau - Fakultät für Informatik und Mathematik</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper addresses the problem of discovering Web of Things (WoT) agents, also known as servients, that can interact in a mediated or peer-to-peer fashion to form compound systems. We develop a framework that relies on the W3C Thing Description (TD) and Semantic Sensor Network (SSN) ontologies, which provide semantics for the physical world entities WoT servients are associated with. We formulate the problem of WoT discovery as an abductive reasoning problem over knowledge bases expressed in terms of TD and SSN concepts, where new semantic relationships between existing systems lead to the creation of other, larger systems. We then address the specific case of EL++ knowledge bases, a fragment of Description Logic, for which we leverage the mathematical framework of Abductive Logic Programming to provide a concrete algorithm for abduction that terminates in polynomial time. We illustrate the feasability of our approach on an experimental industrial workstation, equipped with micro-controllers capable of storing and exchanging RDF data in binary format ( RDF store with EXI4JSON serialization).</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        One of the promises of the Web of Things (WoT) is to bring more autonomy in
automation systems by the automatic mash-up of Web agents [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. These agents,
mostly embedded devices, are capable of sensing and/or acting on specific aspects
of the physical world and provide a Web interface to them. In this context,
Semantic Web technologies should be used to represent physical world entities
and provide a consistent view on cyber-physical systems [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ].
      </p>
      <p>
        These semantically described WoT systems may be seen as intelligent
systems, as autonomy is regarded as an important characteristic of intelligence [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ].
But more importantly, WoT systems are multi-agent systems (MAS), as are other
ubiquitous and pervasive systems [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. A WoT system is first described by the
interactions that take place between WoT agents, acting either as clients or as
servers. In most cases, interactions take place either between one client and
several servers, or between devices that alternatively act as client and server [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
‘Servient’ is a generic term that designates either clients, servers, or devices that
can be both. In the MAS terminology, one speaks of mediated interaction (the
client playing the role of a mediator) and peer-to-peer interaction.
      </p>
      <p>The problem we address in this paper is that of automatically discovering
WoT agents (servients) for which a potential interaction in a MAS exists. That
is, we aim at building a ‘graph of interactions’ between servients, potentially at
Web scale. For instance, in a mediated scenario, a WoT client could execute the
following procedure to empty a water tank by opening a valve when the tank is
full:
1. send GET coap://{IP1}/watertank/overflow
2. if returned value is true,</p>
      <p>(a) then send PUT coap://{IP2}/valve/status ‘true’
3. sleep for 1s and go to step 1.</p>
      <p>Here, semantic discovery consists in finding the pair of servients (IP1, IP2)—
an edge in the graph of interactions—, such that one exposes a boolean value
representing the detection of overflow in a water tank and the other exposes a
writable boolean value to control a valve in a water circulation circuit.</p>
      <p>In this paper, we address the problem of WoT discovery by relying on
Semantic Web technologies. More precisely, we express possible servient interactions
in terms of the relations between the physical world entities they are associated
with. In the remainder of the paper, we speak of ‘semantic discovery’. The paper
is organized as follows: we first introduce the semantic models one can use to
associate servients with physical world entities, most importantly the Semantic
Sensor Network (SSN) ontology; then, we formulate the problem of semantic
discovery as an abductive reasoning task on the SSN class of System; we then
present an algorithm for E L++ ontologies by leveraging the mathematical
framework of Abductive Logic Programming; we finally present experimentations on
an prototype workstation equipped with micro-controllers, and conclude on the
provided results.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        Several discovery mechanisms can coexist in the Web of Things [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. However,
the most common one so far has been directory-based discovery. That is, WoT
servients register themselves on a central directory by providing meta-data about
their capabilities and the Web resources they expose. Different proposals have
been made for a standardized interface to such a directory. Examples include
Hypercat3 or the IETF Resource Directory specification4. Hypercat specifies a
      </p>
      <sec id="sec-2-1">
        <title>3 http://hypercat.io/</title>
      </sec>
      <sec id="sec-2-2">
        <title>4 https://datatracker.ietf.org/doc/draft-ietf-core-resource-directory/</title>
        <p>hypermedia catalogue, on which plain Web resources can be registered and
annotated with RDF-like statements. Annotations can either be used to connect
resources with each others or to connect them with semantic resources from an
external knwoledge base, e.g. an RDF store. The IETF Resource Directory
provides similar functionalities but it relies on the IETF CoRE Link format for
resource annotations, which targets constrained environments by providing concise
serializations5. Both proposals provide simple query functionalities (key/value
filtering).</p>
        <p>
          The Eclipse Thingweb project, that implements W3C standards for the Web
of Things, includes an implementation of a ‘Thing Directory’6, inspired by the
IETF specification but allowing arbitrary RDF annotations, like Hypercat. WoT
servients can register so-called ‘Thing Descriptions’ (TDs) on a Thing Directory.
A TD is an RDF document that links physical world entities (instances of the
concept of Thing) to Web resources [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]. In the TD model, a distinction is made
between ‘semantic resources’ and other Web resources [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. Semantic resources,
in that context, are resources that act as proxies for physical world entities: they
provide a representation of these entities in a formal language. This distinction
helps identifying independently a thing itself and the Web resource that provides
data about this thing. For example, if coap://example.org/valve provides
JSON data about the valve, the valve itself, as a physical asset, is proxified
by another (semantic) resource, identified e.g. by a blank node or the arbitrary
UUID urn:uuid:17b4b33d-91a9-362a-b3f6-087d57fcdc47.
        </p>
        <p>This problem of identity of physical world entities is well-known in the
Semantic Web community and best practices have emerged to distinguish
semantic resources from other Web resources: one should exclusively use hash URIs
or HTTP 303 redirection to identify them7. However, in the context of WoT,
uniquely identifying all physical world entities involved in a system is a
challenge. Even in very simple cases, there is no obvious way to identify inanimate
objects (like the water tank in our introductory example). A convention for
manufactured products could be to use their serial number. Another convention
could be to use arbitrary identifiers encoded in RFID tags. However, even if one
assumes there exists a widely agreed upon addressing mechanism to
unambiguously give an IRI to any physical world entity, this kind of approach requires the
deployment of a vast and heterogeneous network to combine near-field
communication (to expose a product serial number) with wired local connectivity and
other wireless technologies. This high human integration effort hinders, to some
extent, the vision of WoT as a network of autonomous systems.</p>
        <p>An alternative to this approach is to leverage the model theoretical semantics
of the TD model and Semantic Web technologies. By means of reasoning, the
existence of certain physical world entities can be inferred from statements
contained in TD documents. Indeed, TDs can contain arbitrary statements about
Things, along with the links between these Things and Web resources, by using</p>
      </sec>
      <sec id="sec-2-3">
        <title>5 https://tools.ietf.org/html/rfc6690</title>
      </sec>
      <sec id="sec-2-4">
        <title>6 https://projects.eclipse.org/projects/iot.thingweb</title>
      </sec>
      <sec id="sec-2-5">
        <title>7 https://www.w3.org/TR/cooluris/#semweb</title>
        <p>
          any RDF vocabulary. Numerous already existent vocabularies can be used, all
of them being grounded in Descirfpation Logic (DL). The most important one is
the SSN ontology [
          <xref ref-type="bibr" rid="ref11 ref12 ref13">11,13,12</xref>
          ]. SSN extends the lightweight Sensor, Observation,
Sample and Actuator (SOSA) ontology, defined in the same W3C standard; it
is itself extended by the Smart Energy Aware SystemsLaisse (SEAS) set of
ontologies8 [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]. Another important vocabulary for WoT is the Smart Appliance
Reference (SAREF) ontology, standardized by ETSI [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. Formal alignments
between SSN, SEAS and SAREF have been recently proposed by the Semantic
Web community [
          <xref ref-type="bibr" rid="ref19 ref20">19,20</xref>
          ].
        </p>
        <p>WoT servients exposing TDs annotated with SSN, SEAS and SAREF form
a promising basis for semantic discovery. A typical TD would expose a Thing as
an SSN System or a SOSA FeatureOfInterest, whose Properties are exposed
via Web resources. Interacting with the servient corresponds to either a SOSA
Observation or a SOSA Actuation. SAREF defines more specific concepts like
TemperatureSensor and Temperature (specializations of System and Property,
respectively). Semantic discovery would then consist in performing automated
reasoning on the statements from various TDs registered on a Thing Directory.</p>
        <p>DL concepts for industrial equipment would be required for fine-grain
discovery in cyber-physical systems. In our introductory example, concepts for water
tanks and valves can be found in the industrial standard eCl@ss9: 27309210
(reservoir/tank for hydraulics), 27292200 (pneumatic valve), 27292300
(proportional valve). It is also possible to combine SSN with ontologies for physical
quantities and units like QUDT10 or OM11.</p>
        <p>In the following, we formalize the problem of semantic discovery in the Web
of Things in terms of DL reasoning.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Problem Statement</title>
      <p>Every WoT servient i exposes in the form of a TD a set of logical assertions Ai
(called an ABox) with respect to a shared set of axioms C (called a CBox). We
denote A the ABox Si Ai and KB the knowledge base defined as A [ C.</p>
      <p>We denote NI the set of individuals (i.e. Web resources) in A. As argued in</p>
      <p>A
Sec. 2, we do not assume that there exists a global adressing mechanism to give
an IRI to any physical world entity. As a consequence, a 2 NIAi and b 2 NIAj
(i 6= j) may designate the same entity, i.e. the unique name assumption does
not generally apply to WoT knowledge bases. But it also means that entities
potentially useful for discovery may not be represented in the knowledge base at
all. In this context, deductive reasoning would not be sound if potential servient
interactions involve entities whose existence can neither be asserted nor inferred.
However, in many cases, their existence can reasonably be simply assumed, so
that deduction leads to the expected conclusions. We formalize the problem of</p>
      <sec id="sec-3-1">
        <title>8 https://w3id.org/seas/</title>
      </sec>
      <sec id="sec-3-2">
        <title>9 http://www.heppnetz.de/projects/eclassowl/ 10 http://qudt.org/ 11 http://www.wurvoc.org/vocabularies/om-1.8/</title>
        <p>semantic discovery in the Web of Things as an abduction problem, to compute
such assumptions.</p>
        <p>
          Definition 1. [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ] Abduction consists in finding a knowledge base KB0, such
that, for a knowledge base KB and an axiom , it holds that KB [ KB0 j= and
KB 6j= .
        </p>
        <p>In our case, we aim at discovering new possible systems by making various
WoT servients interact. Semantic discovery can therefore be formulated as the
abduction of role assertions between individuals of two or more distinct ABoxes
and possibly fresh individuals, such that new instances of System are created in
the overall knowledge base.</p>
        <p>Definition 2. WoT semantic discovery on a knowledge base KB = Si Ai [ C
is the abductive reasoning task where = System(a) and KB0 is a set of role
assertions for which there exists i; j, such that NIKB0 \NIAi 6= ; and NIKB0 \NIAj 6=
;.</p>
        <p>We do not consider class assertions in KB0 to avoid trivial solutions like
KB0 = fSystem(a)g, where a is a fresh individual. In practice, one can exploit
the mereologic relation hasSubSystem to create a new system as the combination
of two or more sub-systems.</p>
        <p>Example 1. Let us define a knowledge base for our introductory example, as
would be available on a Thing Directory:</p>
        <p>A1 = f27292200(valve);
A2 = f27273201(sensor);
href(valve; coap://192.168.0.1/valve/status)g
href(sensor; coap://192.168.0.1/tank/overflow);
27273201(tank);
isHostedBy(sensor; tank)g
C = fValveControlSystem v System;</p>
        <sec id="sec-3-2-1">
          <title>9hasSubSystem:27292200 u 9hasSubSystem:(27273201 u 9isHostedBy:27273201) v ValveControlSystemg</title>
          <p>Here, 27292200, 27273201 and 27273201 are the eCl@ss concepts for
pneumatic valve, level sensor, and water tank (respectively). We define here the role
href as a direct link from a Thing instance to a Web resource, which is a
simplification of the original TD model.</p>
          <p>The following axioms are a solution to semantic discovery on the above
knowledge base:</p>
          <p>KB0 = fhasSubSystem(a; valve); hasSubSystem(a; sensor)g</p>
          <p>In the case where interaction between servients is mediated, the mediator
can simply access the Thing Directory’s knowledge base after it is added KB0.
However, in a peer-to-peer setup, local ABoxes (i.e. TDs stored on the servient
themselves) must be updated with the results of semantic discovery, in order for
all servients involved in a new system to have sufficient knowledge about it. This
relates to the notion of explanation.</p>
          <p>
            Definition 3. [
            <xref ref-type="bibr" rid="ref22">22</xref>
            ] An explanation for an axiom is a knowledge base E
such that E j= but for every subset E 0 E , E 0 6j= .
          </p>
          <p>KB</p>
          <p>Any servient involved in a newly discovered system should be updated with
a set of statements that would allow it to infer from its ABox alone the class
assertion axiom used for discovery.</p>
          <p>A0i = E n Ai.</p>
          <p>Definition 4. Let E be an explanation over KB [ KB0 for an axiom of the form
System(a). The update ABox of a WoT semantic discovery in a peer-to-peer
system is the ABox A0 = Si A0i, such that for all Ai where NIAi \ NIE 6= ;,</p>
          <p>Given Definition 4, it then holds that (Ai [ A0i) [ C j= System(a). One can
further note that update ABoxes can be computed incrementally. That is, if Ai
0
is the update ABox resulting from a first discovery on servient with ABox Ai,
when discovery is performed a second time, the new update ABox A0i0 can be
computed against Ai [A0i, such that Ai \A0i0 = ;. It is indeed likely that servients
0
enter the network at different times over the lifecycle of an industrial system.
Example 2. The update ABox for Example 1 is the following:</p>
          <p>A01 = fhasSubSystem(a; sensorg</p>
          <p>A02 = fhasSubSystem(a; valveg</p>
          <p>One can note in Example 2 that the performed update is of little value as
long as the valve has no knowledge of the Web resource to access the level sensor
value (or as long as the sensor has no knowledge of the valve status update Web
resource). To include them in their respective update ABox, one can modify C by
adding restrictions on href to sub-concepts of System. In general, the value of
semantic discovery depends on the axioms present in C. We give more examples
of axioms used for discovery in Sec. 5 (Example 3).
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>A Logic Programming Approach</title>
      <p>
        In this paper, we focus on semantic discovery with E L++ knowledge bases, the
only tractable fragment of DL. There exists other works addressing ABox
abduction on other DL fragments [
        <xref ref-type="bibr" rid="ref17 ref7">17,7</xref>
        ] but we limited ourselves to E L++ for
several reasons. First, tractability, and therefore predictability, is often a strict
requirement in the industry domain. Moreover, most axioms that are relevant in
WoT knowledge bases are existential restrictions (the ones covered by E L++),
as opposed to universal restrictions and cardinality constraints, which are often
redundant with other forms of data validation like data schemas. Although the
state-of-the-art includes a tractable algorithm for so-called first-order rewritable
knowledge bases, some E L++ do not fulfil this requirement. In addition, E L++
reasoning remains tractable even in the case servients provide different CBoxes
(which can happen in case e.g. of firmware update or device recommissioning).
      </p>
      <p>
        Classification of E L++ knowledge bases can be computed in polynomial time,
as first introduced by Baader et al [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. In the following, we formalize Baader
et al.’s algorithm in terms of logic programming, in order to formalize WoT
semantic discovery (Definition 2) as an abductive logic programming (ALC)
problem.
4.1
      </p>
      <p>EL++ Classification
For an extensive documentation of the original classification algorithm and the
semantics of E L++, we refer to Baader et al.’s technical report.
oDfetfihneiftoiormn 5f. g[2(]aL2et NBIC)Canbed tRhe set of concept names and nominal concepts
a C C be the set of role names in C. Let C1; C2 2
BCC [ f&gt;g, D 2 BCC [ f&gt;; ?g and r; s; r1; r2 2 RC.</p>
      <p>C is an E L++ normal form if any axiom in C is one of:</p>
      <p>C1 v D
C1 u C2 v D</p>
      <p>C1 v 9r:C2
9r:C1 v C2</p>
      <p>r v s
r1 r2 v s</p>
      <p>Any E L++ knowledge base can be emulated by a CBox C in normal form.
Class assertions C(a) are rewritten fag v C and role assertions r(a; b) are
rewritten fag v 9r:fbg. In the following, we assume all knowledge bases are in normal
form.</p>
      <p>Baader et al.’s algorithm consists in applying eleven completion rules to a
normalized knowledge base C, to construct a mapping S, such that for C 2 BCC,
S(C) BCC [f&gt;; ?g and a mapping R, such that for r 2 RC, R(r) BCC BCC.
Deciding whether C entails a given class inclusion can then be decided by a single
look-up of S or R. Briefly:
– if D 2 S(C), it implies that C j= C v D
– if (C; D) 2 R(r), it implies that C j= C v 9r:D</p>
      <p>
        In the present paper, we reformulate Baader et al.’s algorithm in terms of logic
programming [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. A logic program is a set of clauses of the form head body
where head, body are first-order logic (FOL) formulas with variables. We first
define a mapping from E L++ constructs to FOL formulas.
Definition 6. The mapping
recursively, as follows:
      </p>
      <p>from DL constructs to FOL formulas is defined
(C); (r); (a) map to variables</p>
      <p>(D 2 S(C)) = s( (C); (D))
((C; D) 2 R(r)) = r( (r); (C); (D))
(C v D 2 C) = subClassOf( (C); (D)))</p>
      <p>(fag) = objectOneOf( (a))
(C u D) = objectIntersectionOf( (C); (D))</p>
      <p>(9r:D) = objectSomeValuesFrom( (r); (D))
(r v s 2 C) = subObjectPropertyOf( (r); (s))</p>
      <p>(r1 r2) = objectPropertyChain( (r1); (r2))</p>
      <p>
        One may note that our definition of associates DL axioms to plain formulas.
This differs from classical logic programming embeddings of DL, which turn
axioms into rules (e.g. with Datalog [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]). Given Definition 6, we can now define
the original completion rules12 as a logic program.
      </p>
      <p>Definition 7. The logic program P for E L++ classification is defined as follows:
true
(D 2 S(C))
(D 2 S(C))
((C; D) 2 R(r))
(E 2 S(C))
(? 2 S(C))
(S(D)</p>
      <p>S(C))
((C; D) 2 R(s))
(C 2 S(C))
(C0 2 S(C)) ^
(C0 v D 2 C)
(C1 2 S(C)) ^
(C2 2 S(C)) ^
(C1 u C2 v D 2 C)
(C0 2 S(C)) ^
(C0 v 9r:D 2 C)
((C; D) 2 R(r)) ^
(D0 2 S(D)) ^
(9r:D0 v E 2 C)
((C; D) 2 R(r)) ^
(? 2 S(D))
(fag 2 S(C) \ S(D)) ^
(C ; D)
((C; D) 2 R(r)) ^
(r v s 2 C)
(CR1)
(CR2)
(CR3)
(CR4)
(CR5)
(CR6)
(CR10)
12 In the present work, we discard rules 7-9, as they relate to the out-of-scope notion
of concrete domains. Moreover, rule 6 includes the ; notation which, although it is
also embeddable in FOL, we do not develop here.
((C; E) 2 R(r3))
(CR11)
((C; D) 2 R(r1)) ^
((D; E) 2 R(r2)) ^
(r1 r2 v r3 2 C)</p>
      <p>
        Deciding whether D 2 S(C) can then be reduced to derivation on the
predicate s. That is, given a set of clauses P 0 stating class and role inclusions, it is
equivalent to proving P [ P 0 ` s( (C); (D)), for which standard resolution can
be applied (forward or backward chaining).
On this basis, it is possible to define abduction on E L++ knowledge bases as
an Abductive Logic Programming (ALP) problem. ALP extends standard logic
program resolution with hypothesis generation from abducible predicates and
integrity constraint checking [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. ALP can be used to provide explanations to
deductive reasoning tasks or for knowledge assimilation. Here, we use ALP to
compute an explanation E for WoT discovery (Definition 4) with the introduction
of fresh individuals under certain constraints. The set of generated axioms KB0
(Definition 2) then corresponds to the set of axioms in E with fresh individuals.
Proposition 1. A set of axioms E is an explanation to the problem of WoT
semantic discovery on an E L++ knowledge base C if and only if it is a solution
(after -application) to the problem of proving (s(fag; System)) using the ALP
program hP; A; Ci, where P is a logic program, A a set of abducible predicates
and C a set of integrity constraints, such that:
– P includes CR1-CR11 (Definition 7) as well as:
      </p>
      <p>(fag v C 2 C)
(fag v 9r:fbg 2 C)
classAssertion( (C); (a))
objectPropertyAssertion( (r); (a); (b))
– A = fclassAssertion; objectPropertyAssertiong and
– C includes the following constraints:
f alse
classAssertion( (C); (a)) ^
(IC1)
fresh( (a))</p>
      <p>true
(a) = (c)
(b) = (d)
objectPropertyAssertion( (r); (a); (b)) ^
objectPropertyAssertion( (r); (a0); (b0)) ^
((:fresh( (a)) ^ :fresh( (b0))) _
(:fresh( (a)) ^ :fresh( (a0)) ^ (b) 6= (b0)) _
(:fresh( (b)) ^ :fresh( (b0)) ^ (a) 6= (a0)))
objectPropertyAssertion( (r); (a); (b)) ^
objectPropertyAssertion( (r); (a0); (b)) ^
fresh( (a)) ^ :bound( (a0))
objectPropertyAssertion( (r); (a); (b)) ^
objectPropertyAssertion( (r); (a); (b0)) ^
fresh( (b)) ^ :bound( (b0))
(IC2)
(IC3)
(IC4)</p>
      <p>
        Hypotheses generated during abduction are either class and role assertions
from C (ground formulas) or formulas whose unbound variables are substituted
with randomly generated terms. We assume the existence of a unary built-in
predicate we denote fresh, whose term unifies with randomly generated UUID
URIs [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ].
      </p>
      <p>Definition 2 includes two restrictions compared to the general problem of
abduction. First, hypotheses should be of the form of role assertions. In Proposition
1, this restriction translates into the integrity constraint IC1. Second, at least
two individuals in the resulting role assertions should not be fresh individuals,
which we expressed as IC2.</p>
      <p>Constraints IC3 and IC4 guarantee that abduction terminates, by limiting the
number of fresh individuals that can be introduced. The number of possible role
assertions that meet these constraints is polynomial with respect to the size of
the original ABox. It follows that the overall discovery terminates in polynomial
time, given that E L++ classification also terminates in polynomial time.</p>
      <p>It is straightforward to prove that any solution produced by the ALP program
of Proposition 1 is also a solution to the problem of WoT semantic discovery (up
to the renaming of fresh individuals). However, to prove the converse, one should
first observe that for any two CBoxes C; C0, such that individuals of C0 can be
substituted to obtain C, it holds that if C0 6j= , then C 6j= . We do not develop
a formal proof in this paper, left as future work.
5
5.1</p>
    </sec>
    <sec id="sec-5">
      <title>Experiments</title>
      <p>
        Experimental Setup
We applied the discovery framework presented in this paper on an experimental
industrial workstation. This workstation includes water tanks and circulation
pipes, equipped with various automation devices like valves, water level sensors,
a flow meter, a temperature sensor, a pump, and a heater; it had initally been
designed as a water management plant model for educational purposes. The
original model has been added six micro-controllers, wired to the automation
devices and acting as WoT servients with IP connectivity (over Wi-Fi). An
overview of the workstation is provided in Fig. 1.
These micro-controllers are ESP8266 (64kB RAM, 80 MHz), they all
embed a lightweight RDF store designed for constrained devices ( RDF store [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]),
and they can exchange RDF data encoded in binary JSON over CoAP, the
Constrained Application Protocol. We recently showed that a combination of
a JSON-LD compacted representation of RDF triples and EXI4JSON
encoding performs better than the state-of-the-art for small datasets like TDs. RDF
triples are first processed using JSON-LD compaction with a context document
designed for conciseness and then encoded in the EXI4JSON format [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The
JSON-LD context we generated for this experiment includes all terms from the
SOSA, SSN and TD ontologies, as well as a subset of eCl@ss concepts. Every
ESP8266 servient stores a TD in its RDF store. It can serve its TD and receive
updates after discovery via CoAP GET, PUT and DELETE operations.
      </p>
      <p>
        We implemented the ALP program of Definition 1 in Prolog, using the
HYPROLOG framework [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Our program runs on a non-constrained machine,
which acts as a Thing Directory used for discovery. It imports TD documents
and knowledge bases with the thea2 Prolog module [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]. Knowledge bases are
turned into normal form as described by Baader et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and TDs are also
normalized—in the sense of RDF graph normalization—prior to Prolog import,
with the Java tool blabel13. By convention, semantic resources in TDs are
represented as RDF blank nodes, which are then replaced by canonical URIs after
RDF normalization.
5.2
      </p>
      <p>Discovery Task
Our experiment consists in building a graph of interaction for the six TDs
exposed on the workstation. These TDs are defined against SOSA, SSN, TD and
eCl@ss. The CBox we perform reasoning on includes the axioms of these four
ontologies, as well as the definition of five systems that can be discovered by
combining servient capabilities. These systems, whose definitions we manually
provide, are the following:
Valve Control An open/close or proportional valve is coupled to a water level
sensor to avoid overflow. When water level in a tank goes above a certain
threshold, the valve opens.</p>
      <p>Pump Control A water pump is coupled to a water level sensor to refill a tank
when necessary. When water level in a tank goes below a certain threshold,
the pump starts.</p>
      <p>Heater Control A temperature sensor is coupled to a heater to maintain water
at a stable temperature by turning on and off heating (thermostat).
Circuit Anomaly Detection A flow meter and a valve are synchronously
monitored to detect potential anomaly in a circuit, e.g. when the measured
flow is not null but the valve is closed.</p>
      <p>Water Circulation A pump and a valve are synchronously activated to keep
water flowing in a closed loop, e.g. for cleaning purposes.</p>
      <p>All these systems are rather simple and were designed to study the
feasibility of our approach only. We do not address performance and scalability issues.
Each system is meant to be the combination of two sub-systems, hosted by one
or more servients. One can note that these systems themselves can be combined
to perform more elaborate (and more realistic) tasks. Our semantic discovery
approach would still cover these cases. As mentioned at the end of Sec. 3, the
result of semantic discovery depends on the axioms we define. For our experiments,
we defined axioms on systems such that all systems that can be discovered are
associated to Web resources, as in the following example.
13 http://blabel.github.io/
Example 3. In our experiments, the full axiom defining ValveControlSystem is
as follows (note the use of the existential construct 9href:WebResource):</p>
      <sec id="sec-5-1">
        <title>9hasSubSystem:(27292200 u</title>
      </sec>
      <sec id="sec-5-2">
        <title>9madeActuation:(9usedProcedure:(9href:WebResource)) u</title>
      </sec>
      <sec id="sec-5-3">
        <title>9hasSubSystem:(27273201 u</title>
        <p>9isHostedBy:27273201 u
v ValveControlSystem</p>
      </sec>
      <sec id="sec-5-4">
        <title>9madeObservation:(9usedProcedure:(9href:WebResource))</title>
        <p>After applying our Prolog program on the six TDs (ABox) and the CBox
described above, we obtain height edges in the graph of interactions
(computation time below 1s). All five compound systems can be instantiated and ‘Water
Circulation’ has two solutions, while ‘Valve Control’ has three solutions. The
whole graph of interaction is showed in Fig. 2. In practice, this graph can be
used for various purposes, such as the identification of critical points in the
network (nodes with a high degree). Here, one of the nodes has a degree of seven,
for a maximum degree of sixteen. If the servient is decommissioned and removed
from the network, half of the discovered systems would stop functioning.</p>
        <p>In addition, we looked at the exchange that takes place between the Thing
Directory and servients. In a mediated scenario, the only exchange required for
discovery is the registration of each TD on the directory. Registration can either
happen by POST requests sent by individual servients to the Thing Directory or
by a GET request broadcast by the Thing Directory to all RDF store instances
on the network. In the former case, TDs are put in the request payload while in
(a) Thing Descriptions
(b) Results
Fig. 3: Size of knowledge bases exchanged between servients and Thing Directory,
encoded in EXI4JSON (servients are identified by their IP address)
the latter case, they are in the response payload. In Fig. 3a, we show the size of
the payload each servient sends.</p>
        <p>In a peer-to-peer scenario, in addition to gathering servients’ TDs, the Thing
Directory must update them, as per Definition 4. Updates are performed as PUT
requests sent by the Thing Directory to each RDF store, with statements to add
in the request payload. Payload sizes for updates are shown in Fig. 3b. One can
note that in most cases, the update size is comparable to the size of the original
TD. Both TDs and updates, except one, fit in a single CoAP block (of max. size
1024 bytes), which represents no technical challenge for micro-controllers like
the ESP8266.</p>
        <p>All RDF files and results shown in this paper are available online14.
6</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>The problem we addressed in this paper is that of semantic discovery in WoT.
We formalized it as an abductive reasoning problem over knowledge bases that
use standard ontologies, among others the SOSA/SSN and TD ontologies. The
former provides semantics for systems and features of interest, which are, in a
generic fashion, referred to as ‘things’ in WoT.</p>
      <p>Our logic programming approach and its implementation over a water
management workstation with six servients show that constrained devices like
microcontrollers can carry enough knowledge in the form of TD documents, such that
meaningful reasoning can be performed to make spontaneous systems form in
an autonomous fashion. Moreover, even though discovery is centralized, having
14 https://github.com/vcharpenay/urdf-store-exp
peer-to-peer systems, robust to changes, is still possible if the knowledge base
carried by individual servients can be updated with the results of discovery.</p>
      <p>In other words, the framework we present in this paper supports the vision of
WoT as a large scale multi-agent system as presented in introduction, where
devices can be quickly deployed and autonomously perform various tasks. To fully
realize it, large scale experiments addressing performance, scalability and
practicability issues are yet to be made. One condition to be fulfilled before large scale
tests are even possible is to make extensive expert-reviewed system descriptions
available on the Semantic Web. As we modeled them, sytem descriptions can
be shared with existing Semantic Web technologies as regular Web ontologies.
However, scaling up the engineering of such ontologies remains a challenge.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. SmartM2M;
          <article-title>smart appliances reference ontology and</article-title>
          oneM2M mapping,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Franz</given-names>
            <surname>Baader</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Brandt</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Carsten</given-names>
            <surname>Lutz</surname>
          </string-name>
          .
          <article-title>Pushing the EL envelope</article-title>
          .
          <source>In Proceedings of the 19th International Joint Conference on Artificial Intelligence (IJCAI</source>
          <year>2005</year>
          ), volume
          <volume>5</volume>
          , pages
          <fpage>364</fpage>
          -
          <lpage>369</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Victor</given-names>
            <surname>Charpenay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Kaebisch</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Harald</given-names>
            <surname>Kosch</surname>
          </string-name>
          .
          <article-title>Introducing thing descriptions and interactions: An ontology for the web of things</article-title>
          .
          <source>In Joint Proceedings of the 3rd Stream Reasoning (SR</source>
          <year>2016</year>
          )
          <article-title>and the 1st Semantic Web Technologies for the Internet of Things (SWIT 2016) workshops</article-title>
          .
          <source>CEUR-WS.org</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Victor</given-names>
            <surname>Charpenay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Kaebisch</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Harald</given-names>
            <surname>Kosch</surname>
          </string-name>
          .
          <article-title>RDF store: Towards extending the semantic web to embedded devices</article-title>
          . In Eva Blomqvist, Katja Hose, Heiko Paulheim, Agnieszka Lawrynowicz, Fabio Ciravegna, and Olaf Hartig, editors,
          <source>The Semantic Web: ESWC 2017 Satellite Events</source>
          , volume
          <volume>10577</volume>
          , pages
          <fpage>76</fpage>
          -
          <lpage>80</lpage>
          . Springer International Publishing,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Victor</given-names>
            <surname>Charpenay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Kaebisch</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Harald</given-names>
            <surname>Kosch</surname>
          </string-name>
          .
          <article-title>Towards a binary object notation for RDF</article-title>
          .
          <source>In Proceedings of the 15th Extended Semantic Web Conference (ESWC)</source>
          . Springer,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Henning</given-names>
            <surname>Christiansen</surname>
          </string-name>
          and
          <string-name>
            <given-names>Veronica</given-names>
            <surname>Dahl</surname>
          </string-name>
          .
          <article-title>HYPROLOG: A new logic programming language with assumptions and abduction</article-title>
          . In Maurizio Gabbrielli and Gopal Gupta, editors,
          <source>Logic Programming</source>
          , pages
          <fpage>159</fpage>
          -
          <lpage>173</lpage>
          . Springer Berlin Heidelberg,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Jianfeng</given-names>
            <surname>Du</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Kewen</given-names>
            <surname>Wang</surname>
          </string-name>
          , and
          <string-name>
            <surname>Yi-Dong Shen</surname>
          </string-name>
          .
          <article-title>A tractable approach to ABox abduction over description logic ontologies</article-title>
          .
          <source>In AAAI</source>
          , pages
          <fpage>1034</fpage>
          -
          <lpage>1040</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Dov</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Gabbay</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Hogger</surname>
            , and
            <given-names>J. A.</given-names>
          </string-name>
          <string-name>
            <surname>Robinson</surname>
          </string-name>
          .
          <source>Handbook of logic in artificial intelligence and logic programming</source>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Marco</given-names>
            <surname>Gavanelli</surname>
          </string-name>
          , Evelina Lamma, Fabrizio Riguzzi, Elena Bellodi, Riccardo Zese, and
          <string-name>
            <given-names>Giuseppe</given-names>
            <surname>Cota</surname>
          </string-name>
          .
          <article-title>Reasoning on datalog ontologies with abductive logic programming</article-title>
          .
          <source>Fundamenta Informaticae</source>
          ,
          <volume>159</volume>
          (
          <issue>1-2</issue>
          ):
          <fpage>65</fpage>
          -
          <lpage>93</lpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Dominique</given-names>
            <surname>Guinard and Vlad M Trifa.</surname>
          </string-name>
          <article-title>Towards the web of things: Web mashups for embedded devices</article-title>
          .
          <source>In Proceedings of WWW (International World Wide Web Conferences)</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Armin</surname>
            <given-names>Haller</given-names>
          </string-name>
          , Krzysztof Janowicz,
          <string-name>
            <surname>Simon J D Cox</surname>
          </string-name>
          , Danh Le Phuoc, Kerry Taylor, and Maxime Lefrançois.
          <article-title>Semantic Sensor Network Ontology. W3C and OGC Recommendation, W3C</article-title>
          &amp; OGC,
          <string-name>
            <surname>October</surname>
            <given-names>19</given-names>
          </string-name>
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Armin</surname>
            <given-names>Haller</given-names>
          </string-name>
          , Krzysztof Janowicz,
          <string-name>
            <surname>Simon J.D. Cox</surname>
            , Maxime Lefrançois, Kerry Taylor, Danh Le Phuoc, Josh Lieberman, Raúl García-Castro,
            <given-names>Rob</given-names>
          </string-name>
          <string-name>
            <surname>Atkinson</surname>
            , and
            <given-names>Claus</given-names>
          </string-name>
          <string-name>
            <surname>Stadler</surname>
          </string-name>
          .
          <article-title>The modular SSN ontology: A joint W3C and OGC standard specifying the semantics of sensors, observations, sampling, and actuation</article-title>
          .
          <source>Semantic Web Journal</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Krzysztof</surname>
            <given-names>Janowicz</given-names>
          </string-name>
          , Armin Haller,
          <string-name>
            <surname>Simon J.D. Cox</surname>
            , Danh Le Phuoc, and
            <given-names>Maxime</given-names>
          </string-name>
          <string-name>
            <surname>Lefrançois</surname>
          </string-name>
          .
          <article-title>SOSA: A lightweight ontology for sensors, observations, samples, and actuators</article-title>
          .
          <source>Journal of Web Semantics</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Kaebisch</surname>
          </string-name>
          and
          <string-name>
            <given-names>Takuki</given-names>
            <surname>Kamiya</surname>
          </string-name>
          .
          <article-title>Web of things (WoT) thing description</article-title>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>A. C. Kakas</surname>
            ,
            <given-names>R. A.</given-names>
          </string-name>
          <string-name>
            <surname>Kowalski</surname>
            , and
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Toni</surname>
          </string-name>
          .
          <article-title>Abductive logic programming</article-title>
          .
          <volume>2</volume>
          :
          <fpage>719</fpage>
          -
          <lpage>770</lpage>
          ,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Kajimoto</surname>
            <given-names>Kazuo</given-names>
          </string-name>
          , Matthias Kovatsch, and
          <string-name>
            <given-names>Uday</given-names>
            <surname>Davuluru</surname>
          </string-name>
          .
          <article-title>Web of things (WoT) architecture</article-title>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Szymon</surname>
            <given-names>Klarman</given-names>
          </string-name>
          , Ulle Endriss, and Stefan Schlobach.
          <article-title>ABox abduction in the description logic ALC</article-title>
          .
          <volume>46</volume>
          :
          <fpage>43</fpage>
          -
          <lpage>80</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>P.</given-names>
            <surname>Leach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mealling</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Salz</surname>
          </string-name>
          .
          <article-title>A universally unique IDentifier (UUID) URN namespace</article-title>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>Maxime</given-names>
            <surname>Lefrancois</surname>
          </string-name>
          .
          <article-title>Planned ETSI SAREF extensions based on the W3C&amp;OGC SOSA/SSN-compatible SEAS ontology patterns</article-title>
          .
          <source>CEUR-WS.org</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>João</surname>
            <given-names>Moreira</given-names>
          </string-name>
          , Laura Daniele, Luis Ferreira Pires, Marten van Sinderen,
          <string-name>
            <surname>Katarzyna Wasielewska</surname>
            , Pawel Szmeja, Wieslaw Pawlowski, Maria Ganzha, and
            <given-names>Marcin</given-names>
          </string-name>
          <string-name>
            <surname>Paprzycki</surname>
          </string-name>
          .
          <article-title>Towards IoT platforms integration: Semantic translations between W3C SSN and ETSI SAREF</article-title>
          .
          <article-title>CEUR-WS</article-title>
          .org,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Stefan</given-names>
            <surname>Poslad</surname>
          </string-name>
          . Ubiquitous Computing:
          <article-title>Smart Devices, Environments and Interactions</article-title>
          . John Wiley &amp; Sons, Inc.,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Rudolph</surname>
          </string-name>
          .
          <article-title>Foundations of description logics</article-title>
          .
          <source>In Axel Polleres, Claudia d'Amato</source>
          , Marcelo Arenas, Siegfried Handschuh, Paula Kroner, Sascha Ossowski, and
          <string-name>
            <surname>Peter</surname>
          </string-name>
          Patel-Schneider, editors,
          <source>Reasoning Web. Semantic Technologies for the Web of Data</source>
          , pages
          <fpage>76</fpage>
          -
          <lpage>136</lpage>
          . Springer Berlin Heidelberg,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Stuart</surname>
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Russell</surname>
          </string-name>
          .
          <article-title>Artificial intelligence: a modern approach</article-title>
          .
          <source>Prentice Hall series in artificial intelligence</source>
          .
          <source>Prentice Hall, 3rd ed edition</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Ioan</surname>
            <given-names>Toma</given-names>
          </string-name>
          , Elena Simperl, and
          <string-name>
            <given-names>Graham</given-names>
            <surname>Hench</surname>
          </string-name>
          .
          <article-title>A joint roadmap for semantic technologies and the internet of things</article-title>
          .
          <source>In Proceedings of the Third STI Roadmapping Workshop</source>
          , Crete, Greece, volume
          <volume>1</volume>
          , pages
          <fpage>140</fpage>
          -
          <lpage>53</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Vangelis</surname>
            <given-names>Vassiliadis</given-names>
          </string-name>
          , Jan Wielemaker, and
          <string-name>
            <given-names>Chris</given-names>
            <surname>Mungall</surname>
          </string-name>
          .
          <article-title>Processing OWL2 ontologies using thea: An application of logic programming</article-title>
          .
          <source>In Proceedings of the 6th International Workshop on OWL: Experiences and Directions (OWLED</source>
          <year>2009</year>
          ).
          <article-title>CEUR-WS</article-title>
          .org,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>