<!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>Oh, wait, reasoning was wrong! Let's replay</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Martin Kodys</string-name>
          <email>martin.kodys@ipal.cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Joaquim Bellmunt</string-name>
          <email>joaquim.bellmunt@ipal.cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mounir Mokhtari</string-name>
          <email>mounir.mokhtari@ipal.cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IPAL Image &amp; Pervasive Access Lab - UMI CNRS 2955</institution>
          ,
          <country country="SG">Singapore</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Institut Mines-T ́el ́ecom</institution>
          ,
          <addr-line>Paris</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Universit ́e Grenoble Alpes</institution>
          ,
          <addr-line>Grenoble</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Decision making by real time rule-based reasoners is prone to errors. Modern systems must implement decisions based on partial, statistical, or approximate information. If a part of the information is missing or corrupted, the reasoner might be misled into reaching wrong conclusions. Systems using monotonic static logic are less affected, as they must be more careful in their decisions by design. On the other hand, human reasoning would prompt for some conclusions even if the conclusions may be wrong, and later rectify them if a new fact was discovered. To mimic similar reasoning in order to achieve users' satisfaction, the use of non-monotonic reasoning is preferred as it allows us to easily model a situation whereby a missing piece of information completely changes the outcome of the reasoner. However, detecting reasoning incoherence is very challenging, and thus there is a need to formulate strategies to deal with reasoning defaulting. In this paper, we propose the use of a replay mode on a part of the dataset, including ground truth data. This would also address the problem of late data arrival. As a case study, this paper discusses the implementation of a decision rectification in our ontologybased tracking system that is currently deployed in real conditions.</p>
      </abstract>
      <kwd-group>
        <kwd>Ontology</kwd>
        <kwd>Rule-Based System</kwd>
        <kwd>Decision Making</kwd>
        <kwd>Reasoning</kwd>
        <kwd>Semantic Web</kwd>
        <kwd>Internet of Things</kwd>
        <kwd>Semantic Replay</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Ontology-based reasoners are a convenient way to create an executable
description of a speci c universe using declarative programming [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Three components
are needed for such a system: Ontology sets the frame and describes the portion
of world we decided to model, rules complete the static description with inferred
information, and queries select useful knowledge for the targeted use-case. As
a complement, the Internet of Things (IoT) describes a world where machines
and physical objects are seamlessly integrated into the information network, and
communicate together to exchange and to process data. Together, they may yield
a number of real applications.
      </p>
      <p>
        The powerful combination of IoT and Linked Data deviates pervasive
computing away from prede ned bindings and from static communication protocols.
Semantic technologies are used to perform a context-aware service provision in
smart environments [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Indeed, we referenced four main purposes of these
technologies in our use-case: 1. a model of personalised assistance in smart spaces
including non-predictable behaviours; 2. integration of all entities of the system,
with an environment discovery and con guration mechanism, 3. collaboration
between modules of the system based on a shared model and vocabulary, 4.
reasoning to create the system's intelligence, based on the three previous points.
      </p>
      <p>Besides, systems using this architecture rely on the information coming from
outside, possibly sensor events and it is necessary to handle the uncertainty of the
environment. Many of these systems are used to make a decision in real time and
never get an opportunity to question this decision. The most common strategy
in case of any delayed or missing information is simply to discard it. Obviously,
this strategy disables a possibility of taking decisions back. As a result, it may be
preferable to use repaired decision to make future suggestions or to enhance the
uncertainty handling. We propose a methodology, design and implementation
that enables the system to\re-think" and backtrack its inferences. In terms of
validation, our approach has been implemented and tested in an IoT Ambient
Assisted Living (AAL) platform currently deployed in 23 homes.</p>
      <p>In this paper we present an implementation of a reasoning replay in an AAL
platform in order to open a discussion on its potential as a new paradigm. In
the following section, we compare our work to other projects and concepts. In
the next section, we explain our implementation, followed by another section
describing achieved results. Then, we discuss the relative signi cance of this
approach, in addition to useful cases of its application. Finally, we conclude
with the overall outcome.
2</p>
      <p>Related Work
“Reasoning replay” is a term that emerged from our platform implementation:
it is the mechanism of resubmitting the knowledge to the reasoner in order
to include facts omitted because they were unavailable at the moment when
the decision making process was performed. Some systems accomplish a similar
task without using this term { either because of its triviality (in trace based
systems) where the reasoning replay is the key component of the design and the
main functionality; or because of little or no added value in real-time systems
with critical decision process and dilemmas (e.g. in driver-less cars). Our type
of application of activity tracking ts in-between: decision repair is technically
possible, and can greatly bene t the user monitoring the activity in real time. In
the domain of activity tracking and ontology-based systems, we can nd several
technological solutions neighbouring our domain.</p>
      <p>
        Trace-driven systems provide an interesting insight into data processing. One
of the engines allowing to build such systems is kTBS, “a kernel for Trace-Based
Systems” [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. It provides a formalisation of a model of a trace, and REST API
for storing and querying the data. The data being treated as a trace introduces
several interesting concepts. A trace is viewed as a container for observed
elements. Instead of a time-stamp, it uses a broader concept of an origin that allows
reasoning over co-occurrence of elements without time-stamp. Another
interesting feature is the di erentiation between stored trace and computed trace. This
trace-centred approach seems to be compatible with our approaches and we need
to investigate the possibility of merging.
      </p>
      <p>
        Amongst applications built with kTBS, we can mention semantic wiki
interaction tracking via a browser plugin described in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Activity tracking is based
directly on computer-collected trace, and they examine the on-line behaviour of
the users.
      </p>
      <p>
        Similar concepts to ours, and their recent evolution are presented in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
The authors o er a full plug &amp; play solution for a \Smart home in a box",
although they do not mention any semantic replay, error correction, or processing
of delayed events. Another daily activity tracking application is described in
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The traces are post-processed and it does not seem to have any real-time
monitoring use case.
      </p>
      <p>
        Using a di erent perspective, eld of stream reasoning provides a solid
formalisation of reasoning over a possibly massive knowledge stream (e.g. sensor
events). The last decade displayed intensive e orts summarised in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], notably in
querying, benchmarking, and incremental reasoning. Similar to our problem, in
[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], the authors tackled the issue of updating the knowledge in a non-monotonic
reasoner.
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Implementation</title>
      <p>In order to assess the suitability of our solution, in this section, we describe our
system's context, characteristics, and relevant con guration.
3.1</p>
      <sec id="sec-2-1">
        <title>UbiSmart Platform</title>
        <p>
          The purpose of the platform is to collect quality of life indicators, using them
to detect risky situations [
          <xref ref-type="bibr" rid="ref10 ref9">9,10</xref>
          ], long-term evolution [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], and to enhance the
quality of life by an intervention. The main monitored target group is the ageing
and frail population, although caregivers can bene t as well [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>To achieve its goals, the platform UbiSmart makes use of standard
commercialised sensors producing events, a gateway UbiGate that relays the structured
event data to the main component { our server written in Node.js. Eventually,
noti cations are sent to other devices as part of service provisioning. The
reasoning is situated in the server: Incoming events are stored in a database,
translated in triples using Notation3 format, and queued to be processed within
the reasoning cycle.</p>
        <p>Reasoning cycle Whenever the server is ready to process a queued event,
reasoner (EYE4) is executed with knowledge originating from three ontological
layers (as illustrated in Figure 1 as content of knowledge base, and in Listing 1.1,
Figure 2):
4 Euler Yet another proof Engine, https://github.com/josd/eye</p>
        <sec id="sec-2-1-1">
          <title>Gateway</title>
        </sec>
        <sec id="sec-2-1-2">
          <title>Sensors</title>
        </sec>
        <sec id="sec-2-1-3">
          <title>MQTT</title>
        </sec>
        <sec id="sec-2-1-4">
          <title>Event data</title>
        </sec>
        <sec id="sec-2-1-5">
          <title>Knowledge base</title>
        </sec>
        <sec id="sec-2-1-6">
          <title>Instance model</title>
        </sec>
        <sec id="sec-2-1-7">
          <title>Event</title>
        </sec>
        <sec id="sec-2-1-8">
          <title>Database Web</title>
        </sec>
        <sec id="sec-2-1-9">
          <title>Mobile application =&gt; Activity</title>
          <p>– Abstract model : Static ontology describing the world that does not change
(sensor type associated to its abilities and characteristics, type and
description of detectable activities);
– Instance model : Instantiated ontology comprising of persisted
information that was instantiated and has current information (e. g. sensor-room
associations, durations of previously detected activity, . . . );
– Action: Injected knowledge produced by the sensors or a user interaction.
Using the described knowledge base, we apply rules that bring conclusions about
what the user's current activity is, compute new durations, update the persisted
information about this instance, and decide what noti cations are to be sent.
The conclusions are passed to software components performing decided actions.
The reasoning cycle ends and waits till next event triggering a new one.
Reasoning context In this paper, we operate with the term \reasoning
context". It is simply a set of knowledge elements that are made available from
previous reasoning cycles and carry an important message about the events.
Reasoning context is volatile because it is not persisted and theoretically can be
re-created. Keeping track of the past is useful when we want to reason over past
usage of objects. However, restarting the platform have for consequence a loss
of this data, as the data is stored only in the RAM.</p>
          <p>
            Origin of semantic components Ontology in our system has been created
manually for UbiSmart [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ], as well as the rules (example in Listing 1.2). They
represent a common sense about observations (presence detection in a space,
object manipulation) and implied conclusions based on common sense (the person
is in the kitchen, preparing some food, receiving a visitor)
Listing 1.1. Selected triples from a snapshot of knowledge base at the end of a
reasoning cycle. We can recognise the origin of the knowledge from 3 different levels of
input (mentioned in Reasoning cycle). Each section in the listing needs the knowledge
from previous one. Real-time injected knowledge is featuring the “clock event ” in the
reasoning. The part of the output labeled as “conclusions” refers to the triples that are
related to our use-case of activity tracking being the highest level that is presented to
the end user. Note: Anonymous nodes (e.g. :b1) that appear in static ontology part
are generated by inference as we are interested in properties of a state and not in an
identitifier for each state.
# OUTPUT/INPUT originating from Static ontology:
hom:house a qol:House.
hom:johndoe a qol:Resident;
          </p>
          <p>qol:residentIn hom:house.
hom:bed qol:locatedIn hom:house.
hom:nap a qol:Activity.
hom:livingroom a qol:Livingroom.
hom:SleepMatSensor rdfs:subClassOf qol:Sensor.
hom:SleepMatSensor qol:hasPossibleState _:b1.
hom:SleepMatSensor qol:hasPossibleState _:b2.
_:b2 qol:hasValue "bed_empty".
_:b1 qol:hasValue "bed_occupied".
_:b1 qol:indicateUse "true"^^xsd:boolean.
_:b2 qol:indicateUse "false"^^xsd:boolean.
# OUTPUT/INPUT originating from Persisted knowledge:
hom:sensor_sleepmac_b8 rdf:type hom:SleepMatSensor.
hom:sensor_sleepmac_b8 qol:attachedTo hom:bed.
# OUTPUT/INPUT originating from Real-time injected knowledge:
hom:clock qol:hasValue "2017-07-20T17:41:02+08:00"^^xsd:dateTime.
hom:sensor_sleepmac_b8 qol:hasCurrentState _:b1.
# OUTPUT Computed knowledge
hom:bed qol:lastUsed "2017-07-20T17:31:02+08:00"^^xsd:dateTime.
hom:sensor_sleepmac_b8 qol:lastUpdate "2017-07-20T17:41:02+08:00"^^xsd:dateTime.
hom:clock qol:lastUpdate "2017-07-20T17:41:02+08:00"^^xsd:dateTime.
hom:johndoe qol:detectedIn hom:livingroom.
hom:johndoe qol:inRoomFor "6213.0"^^xsd:decimal.
hom:livingRoom qol:motionMeasured "0"^^xsd:integer.
# OUTPUT Computed knowledge Conclusions important for the end user: activity tracking
hom:johndoe qol:believedToDo hom:nap.
hom:johndoe qol:doesActivitySince "2017-07-20T17:31:02+08:00"^^xsd:dateTime.
qol:believedToDo
hom:johndoe</p>
          <p>qol:doesActivitySince qol:locatedIn hom:bed
hom:nap
rdf:type
qol:residentIn
qol:lastUsed
rdfs:subClassOf
qol:hasPossibleState
rdf:type
qol:detectedIn
hom:house
2017-07-20T17:31:02+08:00</p>
          <p>qol:Sensor
rdf:type
qol:hasValue
qol:indicateUse qol:hasValue
qol:indicateUse
qol:Activity
qol:Resident
hom:livingroom
qol:House
bed_occupied true</p>
          <p>bed_empty false
qol:attachedTo
hom:sensor_sleepmac_b8</p>
          <p>hom:clock
qol:hasCurrentState rdf:type</p>
          <p>qol:lastUpdate
qol:lastUpdate</p>
          <p>qol:hasValue
qol:hasPossibleStatehom:SleepMatSensor 2017-07-20T17:41:02+08:00</p>
          <p>Fig. 2. Visualisation of the knowledge base in Listing 1.1.</p>
          <p>Listing 1.2. Example of activity detection rule: “nap” activity gets 4 more points if
the user is detected in a livingroom for 600 or more seconds and motion was measured
less than twice (within last 300 seconds). Generally, the rule-based scoring system (not
detailed in this paper), selects the activity having the highest score to become the
object of a Computed knowledge Conclusions triple hom:johndoe qol:believedToDo
[] If there are too many activities with a similar score, then no activity is inferred.
@prefix qol: &lt;http://www.ubismart.org/n3/qol-model#&gt;.
@prefix hom: &lt;http://www.ubismart.org/n3/home#&gt;.
@prefix math: &lt;http://www.w3.org/2000/10/swap/math#&gt;.
{?u qol:detectedIn ?r. ?r a qol:Livingroom. ?u qol:inRoomFor ?d. ?d math:notLessThan 600. ?r
qol:motionMeasured ?m. ?m math:lessThan 2} =&gt; {hom:nap :getScore 4}.
3.2</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Requirements</title>
        <p>Some assumptions are necessary in order to apply enhancements.
– Decision is an inference conclusion. The most obvious requirement is
that the decision is a subset of inferred knowledge, e.g. all objects of a triple
:Reasoner :concludes ?conclusion.
– Independent cycles of iterations. The system works in cycles, a cycle is
composed of one call or of a sequence of calls to a reasoner. The number of
iterations within a cycle is supposed to guarantee the stability of conclusions.
It depends on the complexity and the order of rules. Usually, the output of
previous iteration is used as the input of the following one.
– Time independence. The system must not depend on the processor's
clock. All time-related computation must take inputs from a virtual clock
that emulates the processing in the past. Time-related context must be
entirely provided from the input parameters.
– Full context available. Not only all of the events but also the reasoning
context must be fully available for each cycle, otherwise, only full replay is
possible. Usually, a database may contain signi cant snapshots is needed,
otherwise, replay would be needed from the beginning of the last restart.
3.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>Initial Situation</title>
        <p>In this section, we detail some aspects of our system that is necessary to
understand our implementation.</p>
        <p>No repair strategy Our system performs a decision making process to infer
the activities of a person. Inputs are events from various sources (remote sensor
events, user interaction, and open data). Figure 3 illustrates the inputs, events,
and main outputs, activities. In our real deployment, recurrent problems
impacted the output: events were blocked on the gateway and could not reach
our reasoner due to a connectivity problem, gateway malfunction, or temporary
unavailability of the server intercepting the data. The system was not able to
deal with delayed data. The information that eventually reached the server or
could be extracted from backed up local copies of the data was not included in
reasoning. The deployed strategy was to discard (ignore) delayed events.
(a)
(b)
Time-awareness and “clock event” Our reasoning needs to take into
account the time ow. To achieve it, we use the fact that events trigger a new
reasoning cycle and carry the information about the time. To take care of the
cases when the delay between the events is too long, we set a timer. If no event
arrives, we issue a special volatile “clock event”. As any other event, it resets the
timer and launches a new reasoning cycle. This way, we guarantee a minimum
time resolution for the time dependent activity detection (if the person is in a
room for more than 30 minutes and last sensor event happened 20 minutes ago,
we can infer that the person might have fallen). In addition, within the cycle,
we are able to compute durations and trigger time-related actions (e.g. noti
cations). Setting the timer delay to shorter period gives higher time resolution
but also may create a processing overhead. Unlike \real" events, “clock events”
are not persisted. A representation of a “clock event” in the knowledge base is
shown in Listing 1.3.</p>
        <p>Listing 1.3. A “clock event” representation in knowledge base
hom:clock qol:hasValue "2017-07-22T18:36:06+08:00"^^xsd:dateTime.</p>
        <p>In terms of kTBS, recorded events are stored trace and the union of recorded
events and “clock events” is computed trace of rst order. The activities inferred
are computed trace of second order.
3.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Modifications</title>
        <p>Fundamentally, requirements (Section 3.2) were respected, only time-independence
had to be implemented. Initially, system was time-dependent and every event got
evaluated at its arrival time using the server machine's system time to provide
current time. This time measure was used to compute the duration of activities,
quantity of movement of the person and other indicators.</p>
        <p>Replacing the system time by the time included in every “clock event” with
an optional delay of arbitrary one second (in order to get non-zero duration
activities) ful lled the requirement of time-independence.</p>
        <p>Automatic clock event has to be disabled during the replay. As every regular
event starts a timer for an automatic clock event, we added a replay tag on all
events prepared for replay. This property is used to discriminate and omit the
replayed events, so that they are not duplicated in the event database and they
do not trigger the automatic clock. If a new event (not a part of replay) enters
the queue, the timer for clock events will naturally resume.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>Our implementation yielded following results and observations that prove the
feasibility of the approach, and underline some issues and open problems.
Parameters For the actual replay test, we used a dataset containing 22 034 events
covering 84 days of event data. After completing the dataset with 105 138
generated clock events indicating the points in time when the evaluation should take
place, we obtained the total of 127 172 events to be replayed. The “clock events”
were generated in the same way as the system would generate them in real-time
mode: if the gap between two consequent events is more than 30 seconds, a
“clock event” is inserted every 30 seconds in-between. Scheduling of clock events
is illustrated in Listing 1.4.</p>
      <p>Listing 1.4. Example of scheduled events (in JSON format) with replay tag, showing
30-second delay of the inserted clock event.
{
"date": "2017-07-20T21:31:23.000Z",
"house": 101,
"sensor": "sleepMac_b8",
"value": "Bed_Occupied",
"id": 708409,
"createdAt": "2017-07-20T21:31:23.000Z",
"updatedAt": "2017-07-20T21:31:23.000Z",
"replay": true
},
{
"event": "clock",
"date": "2017-07-20T21:31:53.000Z",
"replay": true
}, ...</p>
      <p>This “clock event” timer parameter was chosen by tests with di erent values:
with 10 seconds, the number of events was too high and with 10 minutes (600
seconds), the resolution of resulting reasoning was too low to activate rules that
are capturing activities shorter than 10 minutes. As the event data came from
the real deployment, we already had a dataset to compare with { the real-time
inference. The parameters di erences are summed up in Table 1.
Execution The process was executed on x86 64 architecture virtual host with
2 400 MHz CPU. It took 78 hours and 58 minutes to complete (using 63 hours
and 12 minutes of processor time) in our UbiSmart platform built with Node.js.
Observations Resulting activities have been compared to a running instance
in real time. The di erences were observed and are illustrated in Figure 4. The
expected di erences that the replay displays are as follows:
1. higher activity granularity (darker colour indicates more short activities),
2. new activities previously undetected (nap between 00:00 and 03:00),
3. over owing activities (18:00 to 20:00 nap, where it was not supposed to be
detected).
5</p>
    </sec>
    <sec id="sec-4">
      <title>Discussion</title>
      <p>The results suggest several questions around the proposed approach and its
possible future.
5.1</p>
      <sec id="sec-4-1">
        <title>Shall We Replay?</title>
        <p>As it can be clearly seen in the execution details in previous section, the replay
is very resource intensive. Therefore, strategies for partial replay have to be
considered for more e ective resource use. For example, store checkpoints of
current state regularly and resume at a checkpoint to make it more e cient.
However, depending on the ontology, the decision taken in the past can have
impact deeply in the future. The question of handling such cases remains open.</p>
        <p>We can distinguish two main motivations for such a replay: enhance the
resulting dataset or enhance the decision process. For instance, in the rst
case, the priority is to provide the best results even if they come later; the second
case might consider delaying certain decisions or make them more fuzzy if a
certain type of data tends to arrive late. These two points of view are mutually
compatible, and can lead to a richer event handling and greater user satisfaction.
kitchen activity
bed activity
watch TV</p>
        <p>nap
kitchen activity
bed_activity
watch TV</p>
        <p>nap
Wed 14 Jun 18:00</p>
        <p>Wed 14 Jun 21:00</p>
        <p>Thu 15 Jun 00:00</p>
        <p>Thu 15 Jun 03:00</p>
        <p>Thu 15 Jun 06:00</p>
        <p>Thu 15 Jun 09:00</p>
        <p>Thu 15 Jun 12:00</p>
        <p>Thu 15 Jun 15:00</p>
        <p>Thu 15
Wed 14 Jun 18:00</p>
        <p>Wed 14 Jun 21:00</p>
        <p>Thu 15 Jun 00:00</p>
        <p>Thu 15 Jun 03:00</p>
        <p>Thu 15 Jun 06:00</p>
        <p>Thu 15 Jun 09:00</p>
        <p>Thu 15 Jun 12:00</p>
        <p>Thu 15 Jun 15:00</p>
        <p>Thu 15
Replay implementation also opens a question about what to do with the old
decisions. Shall we just replace them? If we keep them, how many layers of
replay?</p>
        <p>For our system, we decided to keep the older decisions in order to: keep track
of the state of the system in the past (we have to know what an observer might
have seen when looking at the system). This can also be used for a di erential
analysis. We label previous decisions as \disabled by [a reference to a new
decision]". As for our use-case, the optimal solution is to keep the oldest decisions
and the newest one. It allows us to explain why the noti cation was sent without
confusing the end user (caregiver) with too many versions of what the activity
might have been.
5.3</p>
      </sec>
      <sec id="sec-4-2">
        <title>Impact on Our Platform</title>
        <p>In our case, the replay implementation helped to point out the di erence between
an uninterrupted operation of the platform during the replay and the case when
the platform is interrupted and restarted. When the platform is restarted, we
may lose some context information. Replay allows us to test these di erences.</p>
        <p>Another observation exposes some issues with previous implementation and
brings a solution. It depended on the time when the event was e ectively
evaluated within the reasoner. In the case of processor overload, e.g. unrelated heavy
processing on the server, the events queued and were processed much later. We
were computing the duration of an activity as the time di erence between the
current machine time, and the rst in an uninterrupted series of the same event.
As a consequence, the activities appeared to have a longer duration than they
actually had. Another reason of discrepancies was the misalignment of the clocks
of event producer and consumer where we could get negative duration of an
inferred activity.</p>
        <p>Particularity of the execution was its non-uniformity in time. In the
beginning, the execution pace was quick and at around two cycles per second. In the
middle, the pace slowed down to as low as 2 minutes per cycle. At the end, the
execution resumed a quick pace at one cycle per second.
5.4</p>
      </sec>
      <sec id="sec-4-3">
        <title>Possible Development</title>
        <p>For future development, we consider these topics: \dynamic replay", when an
event arrives late, roll back the events and replay; \real resume", context
conservation during of platform restart; \progress monitoring" to show how the
replay performs as part of other user interface replay management; \augmented
visualisation" when the platform is confronted with a replayed information,
serve it to the end user (caregiver).
6</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this paper, we explained our motivations for a semantic replay. We
implemented and tested it in an existing Ambient Assisted Living platform. We
demonstrated that activity tracking is a domain where this approach has some
potential, in particular, because of the availability of unused data. We believe
that the replay paradigm can bring useful insights for other systems as well, in
the case of real time user-oriented systems, such as care-giving. Additional
motivation is driven by users' needs to understand why a false alarm was triggered
while being able to see a correction.</p>
      <p>Even if it is clear that discarding events is the simplest strategy, the bene t of
replay approach is highly case-dependent. Therefore, we believe that a discussion
about this topic can be very enriching.</p>
      <p>As any other feature, it makes sense to implement it only in certain
conditions. In our case, the recalculation cost is high but its bene ts are higher, and
we believe the process can be enhanced and be made more e cient in case of
partial replay.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Uschold</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gruninger</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Ontologies: Principles, methods and applications. The knowledge engineering review 11(2) (</article-title>
          <year>1996</year>
          )
          <fpage>93</fpage>
          -
          <lpage>136</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bellmunt</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mokhtari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdulzarak</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aloulou</surname>
          </string-name>
          , H.:
          <article-title>Agile framework for rapid deployment in ambient assisted living environments</article-title>
          .
          <source>In: Proceedings of the 18th International Conference on Information Integration and Web-based Applications and Services. iiWAS '16</source>
          , New York, NY, USA, ACM (
          <year>2016</year>
          )
          <fpage>410</fpage>
          -
          <lpage>413</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Champin</surname>
            ,
            <given-names>P.A.</given-names>
          </string-name>
          , Pri´e,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Aubert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            ,
            <surname>Conil</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Cram</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.</surname>
          </string-name>
          : kTBS:
          <article-title>Kernel for TraceBased Systems (</article-title>
          <year>2011</year>
          )
          <article-title>A reference implementation of the notion of Trace Based Management System</article-title>
          .
          <article-title>Allows to store and compute modeled traces, and access them through a RESTful interface</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Le</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , Lef`evre,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Cordier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Skaf-Molli</surname>
          </string-name>
          , H.:
          <article-title>Collecting interaction traces in distributed semantic wikis</article-title>
          . In Camacho, D.,
          <string-name>
            <surname>Akerkar</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <article-title>Rodr´ıguez-</article-title>
          <string-name>
            <surname>Moreno</surname>
          </string-name>
          , M.D., eds.
          <source>: 3rd International Conference on Web Intelligence</source>
          , Mining and Semantics, WIMS '
          <fpage>13</fpage>
          , Madrid, Spain, June 12-14,
          <year>2013</year>
          , ACM (
          <year>2013</year>
          )
          <fpage>21</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tilke</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Adams</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crandall</surname>
            ,
            <given-names>A.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cook</surname>
            ,
            <given-names>D.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmitter-Edgecombe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Smart home in a box: usability study for a large scale self-installation of smart home technologies</article-title>
          .
          <source>Journal of Reliable Intelligent Environments</source>
          <volume>2</volume>
          (
          <issue>2</issue>
          ) (
          <year>2016</year>
          )
          <fpage>93</fpage>
          -
          <lpage>106</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Cook</surname>
            ,
            <given-names>D.J.</given-names>
          </string-name>
          :
          <article-title>Learning Setting-Generalized Activity Models for Smart Spaces</article-title>
          .
          <source>IEEE intelligent systems 2010(99)</source>
          (
          <year>September 2010</year>
          )
          <fpage>1</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Dell'Aglio</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Della</given-names>
            <surname>Valle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Harmelen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Bernstein</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>Stream reasoning: A survey and outlook: A summary of ten years of research and a vision for the next decade</article-title>
          .
          <source>(07</source>
          <year>2017</year>
          )
          <fpage>1</fpage>
          -
          <lpage>24</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Beck</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dao-Tran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Answer update for rule-based stream reasoning</article-title>
          .
          <source>In: Proceedings of the 24th International Conference on Artificial Intelligence. IJCAI'15</source>
          , AAAI Press (
          <year>2015</year>
          )
          <fpage>2741</fpage>
          -
          <lpage>2747</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Bellmunt</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mokhtari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdulzarak</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aloulou</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , Kodyˇs, M.:
          <article-title>Experimental frailty model towards an adaptable service delivery for aging people</article-title>
          .
          <source>In: Engineering of Complex Computer Systems (ICECCS)</source>
          ,
          <year>2016</year>
          21st International Conference on,
          <source>IEEE</source>
          (
          <year>2016</year>
          )
          <fpage>227</fpage>
          -
          <lpage>230</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Sadek</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bellmunt</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , Kodyˇs,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Abdulrazak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Mokhtari</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Novel unobtrusive approach for sleep monitoring using fiber optics in an ambient assisted living platform (</article-title>
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Kaddachi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aloulou</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdulrazak</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bellmunt</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Endelin</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mokhtari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fraisse</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Technological approach for behavior change detection toward better adaptation of services for elderly people</article-title>
          .
          <source>In: HEALTHINF</source>
          . (
          <year>2017</year>
          )
          <fpage>96</fpage>
          -
          <lpage>105</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Mokhtari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Endelin</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aloulou</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tiberghien</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Measuring the impact of icts on the quality of life of ageing people with mild dementia</article-title>
          .
          <source>In: Smart Homes and Health Telematics</source>
          . Springer (
          <year>2015</year>
          )
          <fpage>103</fpage>
          -
          <lpage>109</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Aloulou</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mokhtari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tiberghien</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Endelin</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Biswas</surname>
          </string-name>
          , J.:
          <article-title>Uncertainty handling in semantic reasoning for accurate context understanding</article-title>
          .
          <source>KnowledgeBased Systems</source>
          <volume>77</volume>
          (
          <year>2015</year>
          )
          <fpage>16</fpage>
          -
          <lpage>28</lpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>