<!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>SPARQL-Based Applications for RDF-Encoded Sensor Data</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mikko Rinne</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Seppo Torma</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Esko Nuutila</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science and Engineering, Aalto University, School of Science</institution>
          ,
          <country country="FI">Finland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Complex event processing is currently more dominated by proprietary systems and vertical products than open technologies. In the future, however, internet-connected people and things moving between smart spaces in smart cities will create a huge volume of events in a multi-actor, multi-platform environment. End-user applications would bene t from the possibility for open access to all relevant sensors and data sources. The work on semantic sensor networks concerns such open technologies to discover and access sensors on the Web, to integrate heterogeneous sensor data, and to make it meaningful to applications. In this study we address the question of how a set of applications can efciently access a shared set of sensors while avoiding redundant data acquisition that would lead to energy-e ciency problems. The Instans event processing platform, based on the Rete-algorithm, o ers continuous execution of interconnected SPARQL queries and update rules. Rete enables sharing of sensor access and caching of intermediate results in a natural and high-performance manner. Our solution suggests that with incremental query evaluation, standard-based SPARQL and RDF can handle complex event processing tasks relevant to sensor networks, and reduce the redundant access from a set of applications to shared sensors.</p>
      </abstract>
      <kwd-group>
        <kwd>Complex event processing</kwd>
        <kwd>SPARQL</kwd>
        <kwd>RDF</kwd>
        <kwd>Sensor systems</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Our future, with internet-of-things, is lled with sensors. Devices in our personal
area network communicate with each other, with the things we own and with the
services we are interested in. Connected devices form smart spaces, made to assist
us in our daily tasks. Smart spaces interact with infrastructural sensor networks,
forming smart cities. In the scale of cities the number of sensors can reach billions,
and sensor observations be extremely heterogeneous due to di erences in stimuli,
vendors, software versions, operators, administrative domains etc.</p>
      <p>
        At the same time there will be increasing numbers of applications that would
need to access sensor observations. It would be wasteful for each application
or a closed group of applications - to deploy its own set of sensors. A lot of
duplication could be avoided, and hardware and communication resources used
more e ciently, if sensors were openly exposed on the Web. Applications could
be given broader access to sensors without locking application-sensor pairs to
vertical silos. If access from applications to shared sensors is enabled, some new
problems will arise [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]: How to discover, access and search sensor data? How
to integrate the sensor data coming from heterogeneous sources? How to make
sensor data meaningful to applications?
      </p>
    </sec>
    <sec id="sec-2">
      <title>Applications</title>
    </sec>
    <sec id="sec-3">
      <title>Middle layer</title>
    </sec>
    <sec id="sec-4">
      <title>Sensors</title>
      <p>a.  Direct access to sensors</p>
      <p>b. Access mediated by a middle layer</p>
      <p>
        A set of models to address these problems has been presented: Sensor Web
Enablement (SWE) by OGC1 [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], the model of Semantic Sensor Networks
Incubator Group (SSN-XG) of W3C [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], the architecture of sensor Web applications
in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and the Cloud, Edge, and Beneath model (CEB) by Xu et al [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. They
are all three-layer models where access from applications to sensors is mediated
by a middle layer, as shown in Figure 1. In open sensor systems there are several
needs for the middleware:
{ Abstraction: The information from sensors needs to be layered to reasonable
levels of abstraction, already for programmers but even more so for human
end-users, who should only be noti ed or alerted with information signi cant
to their personal contexts.
{ Interoperability : These sensors, which can be mobile phones, thermometers,
weather cameras or train positioning systems, are manufactured, owned and
operated by various companies, public authorities and private persons. They
1 Open Geospatial Consortium, http://www.opengeospatial.org/
will not operate under the same standard or service. There is a need for
exible representations for semantic relations of data from di erent origins.
{ Energy e ciency : Many sensors will be depending on limited local power
sources, and in the long run the applications, in total, can consume signi cant
amounts of energy. Access to sensors should be managed in order to minimize
unnecessary and wasteful work, in particular redundant data acquisition [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
Redundancy can be minimized by sharing the work across applications to
access the sensors, by caching intermediate results, and by suppression of
irrelevant sensor input.
      </p>
      <p>
        In this study we work on the basis of the event as an abstraction of a
meaningful change in sensor readings. It is assumed that the primary operation of the
system is based on sensors that report events in push-mode. This corresponds to
the approach of Sensor Event Service (SES) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] of the Sensor Web Enablement,
although for the speci cation of complex events we rely on incremental
evaluation of standard SPARQL queries and update rules [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] instead of the Event
Pattern Markup Language (EML) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] used in SES.
      </p>
      <p>
        According to [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] a complex event is \an event that summarizes, represents,
or denotes a set of other events". With this de nition, \complex event
processing" becomes de ned by the layering of events, rather than the complexity of
the underlying event processing problem, or the method used to solve it. This
layering gives us the abstraction we need to hide the millions of events and come
up with human-tangible conclusions like \the bus is late", \take this route to
the o ce instead of your usual one" or \your house is probably on re". So
whereas 'simple event' is a production-oriented concept closer to sensor
observations, 'complex event' is a consumption oriented concept: a speci cation of an
event that an application or a user is interested in.
      </p>
      <p>Interoperability is the central promise of semantic web technologies. They
make it possible to establish relations both between ontologies and between
instance data originating from di erent domains and sources. The expressive
representation and query capabilities allow the exible use of these technologies
across domains. Event information can be enriched with linked data in the web,
and the availability of inference tools enable the reasoning about event content.</p>
      <p>If a set of applications were to access a shared set of sensors independently,
there would be a lot of redundant acquisition, communication, and processing
of sensor data. In this study we address the question of how a set of
applications can e ciently access a shared set of sensors while avoiding unnecessary
redundancy2. Our solution can be implemented using the Rete-algorithm that
turns out to be a good t for the task: it avoids the duplicate processing of
events, it enables the sharing of sensor access and intermediate processing steps
between applications, and it caches the intermediate results for e cient access
later on. The big advantage of Rete is the high performance that manifests in
short noti cation delays when the last piece of information that satis es a query</p>
      <sec id="sec-4-1">
        <title>2 Some amount of controlled redundancy can be desirable for failure detection purposes</title>
        <p>
          [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]
is received. The natural place for Rete network is on the middle layer between
sensors and applications but we discuss also its use on other layers.
        </p>
        <p>
          The Instans event processing platform is based on continuous execution of
interconnected SPARQL queries and update rules. We have presented how
Retebased incremental query evaluation enables e cient complex event processing
with standard SPARQL and RDF [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ]. This paper suggests that Rete is also
suitable for reducing redundant access from applications to shared sensors.
        </p>
        <p>The structure for the rest of this paper is the following: The principle of
using collaborating SPARQL queries for event processing is introduced in
Section 2. Our Instans platform is explained in Section 3. Section 4 explains the
general approach of using Rete at di erent layers. Section 5 reviews some
examples of potential application scenarios. Section 6 brie y reviews related work.
Conclusions and future plans are presented in Section 7.
2</p>
        <sec id="sec-4-1-1">
          <title>Event Processing Based on SPARQL</title>
          <p>
            SPARQL is an expressive query language on RDF graphs. It can be used in a
straightforward manner to lter events, construct new derived events, and specify
complex patterns concerning the properties of multiple events. However, a single
SPARQL query is not su cient for many complex event processing applications
[
            <xref ref-type="bibr" rid="ref18">18</xref>
            ]. SPARQL 1.1 Update3 adds a critically important new feature: the capability
to INSERT data into a triple store. When operated in an environment capable
of continuous execution of multiple parallel SPARQL queries, the output of one
query can be the input of other queries, as described in more detail in [
            <xref ref-type="bibr" rid="ref18">18</xref>
            ]. This
way queries can store intermediate information for later use and pass information
between each other, creating an entire event processing application out of a
collaborative network of queries in standard SPARQL.
          </p>
          <p>
            Compared to repeated execution of queries over time-based windows (as used
in e.g. [
            <xref ref-type="bibr" rid="ref13 ref3">3, 13</xref>
            ]), continuous processing of SPARQL queries has clear bene ts [
            <xref ref-type="bibr" rid="ref18">18</xref>
            ]:
1. Instant availability of results. For a memory-resident event processing
application results are typically available in a few milliseconds. In most
applications it would not be practical to re-run queries over event windows
repeatedly with such rates.
2. No duplicate detections due to overlapping windows. With overlapping event
windows same events can be processed more than once, resulting in duplicate
noti cations of exactly the same event instances.
3. No missing detections on window borders. If event windows do not overlap,
event patterns crossing window borders will not be detected. To reduce the
number of misses, the window length could be made longer but that would
again increase the noti cation delays.
4. No repeated processing over the same data. The SPARQL queries and update
rules can rely on the fact that each event is processed only once.
          </p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>3 http://www.w3.org/TR/sparql11-update/</title>
        <p>The chaining and possibility to store intermediate results allows SPARQL queries
to collaborate, forming an event processing application.</p>
        <p>
          In window-based approaches to data stream processing such as [
          <xref ref-type="bibr" rid="ref13 ref3">3, 13</xref>
          ], the
window lengths are typically based on either time duration or a number of triples.
This approach is usually coupled with the assumption that each single RDF triple
marks a standalone event. The input from sensors, however, could well contain
any number of triples. There can be di erent sensor types providing partially
overlapping information, di erent vendors and even di erent software versions
of the same sensor. To be able to use all applicable sensors, we need to be able
to support heterogeneous event formats. An example is illustrated in Figure 5,
where the sensor sending location updates may or may not include altitude
information. In open environments the existing event processing application should
not be broken by additions of new event formats.
3
        </p>
        <sec id="sec-4-2-1">
          <title>INSTANS Event Processing Platform</title>
          <p>
            To address the requirement of near-real-time processing of complex, layered,
heterogeneous events, we have created Instans4 [
            <xref ref-type="bibr" rid="ref1 ref18">1, 18</xref>
            ]. Based on the
Retealgorithm [
            <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
            ], Instans does continuous evaluation of incoming RDF5 data
against multiple SPARQL6 queries. Intermediate results are stored into a -node
network. When all the conditions of a query are matched, the result is instantly
available.
          </p>
          <p>
            Again following the conventions of [
            <xref ref-type="bibr" rid="ref15">15</xref>
            ], an event processing network (EPN,
Figure 2) consists of event processing agents (EPA, 1., 3., 4.) connected with
event channels (2.). An output-only EPA is an event producer (1.), an
inputonly EPA is an event consumer (4.). In practice the same EPA can assume
di erent roles in di erent contexts: The event consumer of one EPN can be the
event producer of another one. In a sensor network context sensors are
typical event producers and applications are typical event consumers. Instans can
appear in any of the three EPA roles. Using RDF both for input and output
means that di erent instances of Instans can be connected together. SPARQL
queries can talk to each other both in micro-scale within one Instans-EPA and
between di erent instances of Instans, o ering very exible possibilities to build
a distributed system. For example:
{ The computation of a single Rete can be distributed between parallel
processors and / or processor cores
{ When using multiple instances of Rete, the output of one EPA can be used
to set the parameters of another EPA, e.g. the reporting trigger parameters
of a sensor platform.
          </p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>4 Incremental eNgine for STANding Sparql, http://cse.aalto. /instans/</title>
      </sec>
      <sec id="sec-4-4">
        <title>5 http://www.w3.org/RDF/</title>
      </sec>
      <sec id="sec-4-5">
        <title>6 http://www.w3.org/standards/techs/sparql#w3c all</title>
        <p>Event Processing Network
3.  Event  
Processing  </p>
        <p>Agent  
(INSTANS)  
1.  Event  </p>
        <p>Producer  
(e.g.  INSTANS)  
2.  Event  
Channel  
(RDF)  
2.  Event  
Channel  
(RDF)  
4.  Event  </p>
        <p>Consumer  
(e.g.  INSTANS)  
The rst version of Instans was coded on the Scala language7. Even though
Scala has a lot of exibility, it isn't built to support runtime generation of code.
To exploit more dynamic programming techniques, we are working on a Rete
implementation in Common Lisp. In Lisp, the Rete-net is compiled in setup-phase
through macro expansion to executable Lisp code. The rst results are highly
encouraging: The close friends example, introduced in Section 5, produces the same
results but runs 100-200 times faster than our original Scala implementation.</p>
        <p>Instans processes each incoming triple immediately for every matching
condition and saves intermediate results into its beta-node structure, as illustrated
in Figure 3 using a query example from the application discussed in Section 5.2
involving the approach for timed events presented in Section 3.1. This example
starts a timer to track the committed pickup time of a delivery task, when the
task is assigned to a bidding driver.</p>
        <p>
          The main drawbacks of the Rete-algorithm are perceived to be memory
consumption due to the saving of intermediate results within the structure and the
slow processing of deletions [
          <xref ref-type="bibr" rid="ref16 ref17">17, 16</xref>
          ]. The memory consumption can be decreased
by recognizing recurring patterns in queries and combining the corresponding
nodes. Deletion can be made signi cantly faster by better indexing of the nodes.
3.1
        </p>
        <p>Timed Events
The asynchronous nature of Instans means that all input is processed when
it arrives. To support synthetic events at speci c points in time like the
detection of a missing event or the compilation of a report, the concept of timed
events is needed. Timed events are built into Instans with the help of a special
\timergraph" and a set of special predicates:
{ timer sec / min / hour: object (integer) speci es time-until-trigger in
seconds / minutes / hours
{ timer date: triggers after the speci ed number of days at midnight
{ timer month: triggers after the speci ed number of months on the rst day
of the month at midnight</p>
      </sec>
      <sec id="sec-4-6">
        <title>7 http://www.scala-lang.org/</title>
        <p>Fig. 3: Example of SPARQL query processing in a Rete-net
{ timer year: triggers after the speci ed number of years on the rst day of
the year at midnight
{ timer abs: object (dateTime) speci es the absolute time for trigger
When inserted into the special timer queue, the objects are converted to absolute
date-time values according to current system time and all predicates are set to
&lt;tp:waiting&gt; status. Actors are used to schedule wakeup, at which time the
predicate of triggered timers is changed to &lt;tp:triggered&gt;. Using the following
query:
INSERT f GRAPH &lt;http://example.org/timergraph&gt; f</p>
        <p>?event &lt;tp:timer_sec&gt; ?timevalue g g
WHERE f ?event &lt;:seconds&gt; ?timevalue g
A ve-second timer would start, when receiving:
&lt;:5sec_pulse&gt; &lt;:seconds&gt; "5"^^&lt;xsd:integer&gt;
A SPARQL query tuned to monitor a certain timer triple can react to the change
in predicate and carry out the necessary actions. One possibility is to set a new
timer, creating a pulse generator:
WITH &lt;http://example.org/timergraph&gt;
INSERT f &lt;:5sec_pulse&gt; &lt;tp:timer_sec&gt; 5 g
WHERE f &lt;:5sec_pulse&gt; &lt;tp:triggered&gt; ?triggertime g
4</p>
        <sec id="sec-4-6-1">
          <title>Use of Instans in Sensor Applications</title>
          <p>Instans can be utilized on all three layers of Figure 1. Naturally, each of the
applications on the uppermost layer could use Instans separately to process any
kind of incoming events { simple or complex. This is especially pertinent to those
processing needs that are speci c to that particular application. Instans will
still yield performance advantages when compared to complex event processing
solutions based on repeated queries on stream windows.</p>
          <p>At the middle layer signi cant e ciency improvements can be achieved in
those event processing tasks { ltering, aggregation, enrichment, and pattern
detection { that can be shared among multiple applications. When deployed at
the middle layer, Instans would accept subscriptions from applications in the
form of complex event patterns presented as SPARQL queries and update rules.
The subscriptions of all applications are compiled into a common Rete network
in which similar query structures are shared among di erent applications. As
Instans receives events from the sensor layer, they are immediately processed
though the Rete network triple by triple. Each triple is propagated as far as it
can proceed through the network. It may be ltered away, or the propagation
may stop in a join node in which no matching data from the other branch can
be found. The data content of the triple remains in a beta memory waiting for
potential future matches.</p>
          <p>The e ciency bene ts at the middle layer are a direct result of the well-known
properties of the Rete algorithm. Each event is evaluated only once against
similar query structure, the state of partially completed propagation is memorized,
and the noti cations of matches are produced immediately when a pattern
becomes satis ed.</p>
          <p>At the lowest layer, Instans can be used in sensor platforms that have enough
processing power and memory to run the Rete network. The main role of Instans
would be to construct meaningful events out of the mass of observations. The
overall goal is to reduce the amount of communication { which is usually the
most signi cant component in the energy consumption of sensor platforms { by
some additional computation in event processing. As a result, a large volume of
sensory observations may turn out to produce only few meaningful events that
need to be communicated upwards.</p>
          <p>A meaningful event is one that is relevant in the sense that it can match
some query structures, and signi cant in the sense that it can a ect the result
of a query. In Rete only changes in observed values are signi cant. This can even
be generalized: only deviations from expectations are signi cant. It means, for
instance, that only those observed values that deviate from an expected trend
should be reported. The upper layers are responsible to communicate to lower
layers what kinds of events are relevant and signi cant. The recon guration
can be done by executing SPARQL Update commands to lower layers with
appropriate con guration data. The basic ow is illustrated in Figure 4.</p>
          <p>First (1.) the application has a new reporting requirement such as an updated
temperature threshold. This triggers a query in an instance of Instans (2.),
emitting an RDF-format update request (3.):
&lt;:outdoor_sensor1&gt; &lt;:min_reporting_temperature&gt; "22"^^&lt;xsd:integer&gt;
Another instance of Instans in the sensor platform receives the con guration
information and replaces the earlier local parameter with the new con guration
(4.):
INSERT f GRAPH &lt;http://sensorplatform.org/local_configuration&gt; f</p>
          <p>&lt;:outdoor_sensor1&gt; ?parameter ?newvalue g g
WHERE f &lt;:outdoor_sensor1&gt; ?parameter ?newvalue g
After the new con guration is set, only temperature readings higher than 22 get
reported (5.):
INSERT f GRAPH &lt;http://sensorplatform.org/sensor_output&gt; f</p>
          <p>&lt;:outdoor_sensor1&gt; &lt;:temp&gt; ?reading g g
WHERE f</p>
          <p>GRAPH &lt;http://sensorplatform.org/sensor_input&gt; f</p>
          <p>&lt;:outdoor_sensor1&gt; &lt;:temp&gt; ?reading g
GRAPH &lt;http://sensorplatform.org/local_configuration&gt; f</p>
          <p>&lt;:outdoor_sensor1&gt; &lt;:min_reporting_temperature&gt; ?reading g</p>
          <p>FILTER (?reading &gt; ?min_temperature)
g
Beyond this bare bone example, a more elaborate SPARQL-query would take
into account other parameters and trigger the report either periodically using
timed events, or only send the event once when the temperature rises above the
threshold, depending on application requirements.</p>
          <p>2.  SPARQL  query  triggered  </p>
          <p>in  INSTANS-­‐1  
3.  RDF  configura*on  event  </p>
          <p>4.  SPARQL  query  in  </p>
          <p>INSTANS-­‐2  triggered  by  
configura*on  event  adjusts  
repor*ng  parameters  
1.  New  repor*ng  </p>
          <p>requirement  
Application</p>
          <p>5.  RDF  sensor  
repor*ng  events  
with  adjusted  
parameters  
Sensor platform</p>
          <p>In the wider context of a sensor network this approach could be used to
manage the reporting from di erent sensors based on application requirements.
Instead of each application going to an middle layer or all the way to the sensor
to request (overlapping) measurements, service management in the application
layer should compile all requests towards a sensor into a reporting scheme, which
would satisfy the requirements from all applications with minimum access to the
sensor.
5</p>
        </sec>
        <sec id="sec-4-6-2">
          <title>Examples Scenarios</title>
          <p>Below are two example scenarios used as test cases for Instans.
5.1</p>
          <p>
            Close Friends [
            <xref ref-type="bibr" rid="ref18">18</xref>
            ]
Subscribers in the \Close Friends" scenario form a social network de ned by
foaf:knows properties. They report their locations with events like the one shown
in Figure 5. When two friends are nearby, the system recognizes the situation
and reports a \nearby" status. It is able to avoid repeated detections as long as
the condition persists and build hysteresis into detecting, when the same persons
are far enough to reset the \nearby" status.
          </p>
          <p>Each subscriber would be running a Close Friends application in his or her
mobile device. The sensor layer is formed by the location sensors of the same
devices. The middle layer receives runs Instans: it receives location updates
from mobile devices and sends nearby events to applications.</p>
          <p>:p3  
tl:  
Instant  
event:
agent
rdf:
type
event:  
Event  
:f pe
rd ty
:e1  
:
t
ne e
ve it</p>
          <p>m
: t
lt a
event:
place
geo:
alt</p>
          <p>To generate input data, an event simulator has been created. The simulator
can use map data from Open Street Map8 and place a number of persons to
move within the map area, generating location events. It is possible to output
both to a le and to generate input data for Instans over a live TCP connection,
slowing the simulator down to real-time operation. A screen capture of the event
simulator is shown in Figure 6.</p>
          <p>The detection of a \nearby" condition requires location update events from
two separate persons. This setting works very well in the asynchronous
environment of Instans: We only need to compare the two latest location events from
two friends, checking that neither event is expired and we can get a match. In
a system based on repeated execution of queries over time-based windows the
requirements would contradict: To save power and network resources, location
reporting frequency should preferably adapt to the movement of the person, but
in a window-based system the achievable noti cation delay is limited by the</p>
        </sec>
      </sec>
      <sec id="sec-4-7">
        <title>8 http://www.openstreetmap.org/</title>
        <p>repetition rate of the window. If the window is very long compared to
repetition rate, the same nearby-condition is detected multiple times. If the repetition
rate is slow, detection delay increases. And if the window is short, the reporting
frequency from terminals needs to be arti cially increased to make sure that
all users report within the window. In Instans none of these compromises are
needed; reporting rate can be adjusted based on detected location changes and
noti cations are available only a few ms after reporting, much faster than would
be feasible as a window repetition rate.</p>
        <p>Support of heterogeneous event formats is also easier, when there are no
windows de ned by time or number of triples, which could break events consisting
of multiple triples. Whether altitude is included in the example of Figure 5 or
not, \close friends" operates the same way. As long as there is a way to link all
the triples of an event together (e.g. a common subject), each application can
use the triples they need and copying or deleting of the entire event can be done
by matching the linking information. In \close friends" event identi er :e1 can
be used to copy or delete all triples of the event without explicit knowledge of
what parameters are included.</p>
        <p>
          With the rst-generation Instans programmed on Scala the noti cation
delay from the creation of the second qualifying event to the reporting of the
\nearby" detection was about 12 ms on a 2.26 GHz Core 2 Duo Mac running
OS X 10.6.
The \Fast Flowers Delivery" (FFD) event processing application, a typical
logistics management task including reporting, is detailed in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. Flower stores
request delivery service for ower orders, independent drivers bidding for the
assignment based on availability, location and driver ranking. Demo
implementations9 on six di erent platforms are available at the book website, but none of
them are coded in SPARQL.
        </p>
        <p>Timed events are in heavy use in FFD. Each phase of the ower delivery needs
to be monitored for time: Driver response to bid request, assignment of driver,
pickup and delivery of owers. Additionally the reports and driver ranking need
to be processed at designated times.</p>
        <p>When using a single heterogeneous event to describe a delivery task, taken
through multiple phases, new IRIs need to be generated to keep the timers
unique. SPARQL o ers good tools for this: the subject IRI of a request can be
bound together with a status string or another IRI to generate a new IRI, which
can be used as a unique identi er.
6</p>
        <sec id="sec-4-7-1">
          <title>Related Work</title>
          <p>So far we have not been able to nd another system in the research community,
which would enable continuous processing of SPARQL 1.1 queries, including the</p>
        </sec>
      </sec>
      <sec id="sec-4-8">
        <title>9 http://www.ep-ts.com/content/view/79/</title>
        <p>
          SPARQL Update methods of communication between queries. Sparkweave10 [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]
applies SPARQL queries to RDF data using an extended Rete-algorithm, but
focusing on inference and fast data stream processing of individual triples instead
of heterogeneous events. Sparkweave v. 1.1 also doesn't support SPARQL 1.1
features such as SPARQL Update.
        </p>
        <p>
          Data stream processing focusing on fast ltering of individual triples, not
events consisting of multiple triples, and time- or triple-based repetition of
queries on windows have been the most popular approaches used by
SPARQLbased stream processing systems such as C-SPARQL11 [3{5] and CQELS12 [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>Jena13 and Sesame14, both popular platforms in the research community,
have support for SPARQL Update, but not for multiple simultaneous queries.</p>
        <p>
          The eld of complex event processing is even more diverse. Popular tools
include but are not limited to TIBCO BusinessEvents15, StreamBase16, Esper17,
Aleri18, Apama19 and ETALIS20, which has a SPARQL pre-compiler called
EPSPARQL [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] supporting a subset of ETALIS features. The summary of CEP
market at 201121 compiled by Paul Vincent of TIBCO includes 23 di erent
systems. We haven't looked at all of them, but so far we have not come across
any system based on the use of collaboration of standard-compliant SPARQL v.
1.1 in the way we have described.
7
        </p>
        <sec id="sec-4-8-1">
          <title>Conclusions and Future Plans</title>
          <p>Semantic web standards RDF and SPARQL are well suited for complex event
processing due to their inherent strengths in managing multi-vendor
multiplatform environments. In addition to simple conversions between vocabularies,
inference capabilities and access to all linked open data they are also likely to
be useful in developing semantic reasoning and enriching of event data.</p>
          <p>Based on initial testing of the event processing tasks described in Section 5,
the central paradigm of Instans { continuous incremental matching of multiple
standard-based SPARQL queries supporting inter-query communication { seems
to be managing well. When complemented with support for timed events we have
10 https://github.com/skomazec/Sparkweave
11 http://streamreasoning.org/download
12 http://code.google.com/p/cqels/
13 http://incubator.apache.org/jena/
14 http://www.openrdf.org/
15 http://www.tibco.com/
16 http://www.streambase.com/
17 http://esper.codehaus.org/
18 http://www.sybase.com/products/
nancialservicessolutions/complex-eventprocessing
19 http://www.progress.com/en/Product-Capabilities/complex-event-processing.html
20 http://code.google.com/p/etalis/
21
http://www.thetibcoblog.com/wp-content/uploads/2011/12/cep-marketdec2011.png
found no show stopper problems, which would render the approach unusable for
any complex event processing task.</p>
          <p>Compared to systems based on repeated execution of windows the approach
used in Instans has multiple bene ts. Noti cation delays in the order of
milliseconds cannot be practically competed with by re-running queries at similar
rates. While other systems re-run queries at xed time intervals or after a xed
number of triples, Instans combines similar parts of the queries, processes each
input triple as soon as it becomes available and memorizes intermediate results,
resulting in signi cantly smaller amount of duplicate computation.</p>
          <p>In the context of a sensor network, Instans could be deployed as a
programmable and recon gurable platform both close to the sensors and as a
central agent. It is distributable on various levels. Con guration and operation are
fully based on semantic web standards without any mandatory extensions, with
SPARQL used as the programming language to create event-based applications
and RDF used for communication. Due to the compatible approach of using
RDF both for input and output, even large event processing tasks can be split
into manageable sizes and layered abstractions.</p>
          <p>After nalizing the transition to the Lisp-based platform, we are planning to
attempt a more complete solution of the Fast Flowers Delivery application to
verify that everything can be properly supported. To prepare for true big data
usage, longer runs of the platform should be combined with testing of di erent
kinds of garbage handling approaches. Support for querying external SPARQL
endpoints as well as support for a selected set of inference rules are being planned.</p>
        </sec>
        <sec id="sec-4-8-2">
          <title>Acknowledgments</title>
          <p>This work was partially supported by Tekes22 through the funding to
RYMPRE23 (Built Environment Process Re-Engineering) projects, and by European
Commission through the SSRA (Smart Space Research and Applications)
activity of EIT ICT Labs24.
22 http://www.tekes. /en
23 http://www.rym. /en
24 http://eit.ictlabs.eu/ict-labs/thematic-action-lines/smart-spaces/</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abdullah</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rinne</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , Torma,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Nuutila</surname>
          </string-name>
          , E.:
          <article-title>E cient matching of SPARQL subscriptions using Rete</article-title>
          .
          <source>In: Proceedings of the 27th Symposium On Applied Computing. Riva del Garda</source>
          ,
          <source>Italy (Mar</source>
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Anicic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rudolph</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stojanovic</surname>
          </string-name>
          , N.:
          <article-title>EP-SPARQL: a uni ed language for event processing and stream reasoning</article-title>
          .
          <source>In: Proceedings of the 20th international conference on World wide web (WWW'11)</source>
          . pp.
          <volume>635</volume>
          {
          <fpage>644</fpage>
          . WWW '11,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          , Hyderabad, India (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Barbieri</surname>
            ,
            <given-names>D.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Braga</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ceri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grossniklaus</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>An execution environment for C-SPARQL queries</article-title>
          .
          <source>In: Proceedings of the 13th International Conference on Extending Database Technology - EDBT '10</source>
          . p.
          <fpage>441</fpage>
          .
          <string-name>
            <surname>Lausanne</surname>
          </string-name>
          ,
          <string-name>
            <surname>Switzerland</surname>
          </string-name>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Barbieri</surname>
            ,
            <given-names>D.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Braga</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ceri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valle</surname>
            ,
            <given-names>E.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grossniklaus</surname>
          </string-name>
          , M.:
          <string-name>
            <surname>C-SPARQL</surname>
          </string-name>
          :
          <article-title>A Continuous query language for RDF data streams</article-title>
          .
          <source>International Journal of Semantic Computing</source>
          <volume>04</volume>
          ,
          <issue>3</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Barbieri</surname>
            ,
            <given-names>D.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Braga</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ceri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valle</surname>
            ,
            <given-names>E.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grossniklaus</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Querying RDF streams with C-SPARQL</article-title>
          .
          <source>ACM SIGMOD Record</source>
          <volume>39</volume>
          ,
          <issue>20</issue>
          (Sep
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Broring,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Echterho</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Jirka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Simonis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            ,
            <surname>Everding</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Stasch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Liang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Lemmens</surname>
          </string-name>
          , R.:
          <article-title>New generation sensor web enablement</article-title>
          .
          <source>Sensors</source>
          <volume>11</volume>
          (
          <issue>3</issue>
          ),
          <volume>2652</volume>
          {
          <fpage>2699</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garc</surname>
            a-Castro,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Five challenges for the semantic sensor web</article-title>
          .
          <source>Semantic Web</source>
          <volume>1</volume>
          (
          <issue>1</issue>
          ),
          <volume>121</volume>
          {
          <fpage>125</fpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Etzion</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Niblett</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luckham</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          : Event Processing in Action.
          <source>Manning Publications (Jul</source>
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Everding</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Echterho</surname>
            ,
            <given-names>J.: Event</given-names>
          </string-name>
          <string-name>
            <surname>Pattern Markup Language (EML). Discussion</surname>
            <given-names>paper</given-names>
          </string-name>
          , Open Geospatial Consortium (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Forgy</surname>
            ,
            <given-names>C.L.</given-names>
          </string-name>
          :
          <article-title>Rete: A fast algorithm for the many pattern/many object pattern match problem</article-title>
          .
          <source>Arti cial Intelligence</source>
          <volume>19</volume>
          (
          <issue>1</issue>
          ),
          <volume>17</volume>
          {37 (Sep
          <year>1982</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Forgy</surname>
            ,
            <given-names>C.L.</given-names>
          </string-name>
          :
          <article-title>On the e cient implementation of production systems</article-title>
          .
          <source>Ph.D. thesis</source>
          , Carnegie Mellon University, Pittsburgh, PA, USA (
          <year>1979</year>
          ),
          <fpage>aAI7919143</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Komazec</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cerri</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Towards E cient Schema-Enhanced Pattern Matching over RDF Data Streams</article-title>
          .
          <source>In: 10th ISWC</source>
          . Springer, Bonn, Germany (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Le-Phuoc</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dao-Tran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parreira</surname>
            ,
            <given-names>J.X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hauswirth</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>A native and adaptive approach for uni ed processing of linked streams and linked data</article-title>
          .
          <source>In: ISWC'11</source>
          . pp.
          <volume>370</volume>
          {
          <fpage>388</fpage>
          . Springer-Verlag Berlin (Oct
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Lefort</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Henson</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Taylor</surname>
          </string-name>
          , K.:
          <string-name>
            <surname>Semantic Sensor Network XG Final Report</surname>
          </string-name>
          (
          <year>2011</year>
          ), http://www.w3.org/2005/Incubator/ssn/XGR-ssn-
          <volume>20110628</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Luckham</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schulte</surname>
          </string-name>
          , R.:
          <source>Event processing glossary { version 2.0 (Jul</source>
          <year>2011</year>
          ), http://www.complexevents.com/
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Miranker</surname>
            ,
            <given-names>D.P.:</given-names>
          </string-name>
          <article-title>TREAT: a new and e cient match algorithm for AI production systems</article-title>
          .
          <source>Ph.D. thesis</source>
          , University of Texas at Austin, New York, NY, USA (
          <year>1987</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Miranker</surname>
            ,
            <given-names>D.P.:</given-names>
          </string-name>
          <article-title>TREAT: A better match algorithm for AI production systems</article-title>
          .
          <source>Tech. rep.</source>
          , University of Texas at Austin, Austin, TX, USA (
          <year>1987</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Rinne</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdullah</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , Torma,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Nuutila</surname>
          </string-name>
          , E.:
          <article-title>Processing Heterogeneous RDF Events with Standing SPARQL Update Rules</article-title>
          . In: Meersman,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Dillon</surname>
          </string-name>
          , T. (eds.)
          <article-title>OTM 2012 Conferences, Part II</article-title>
          . pp.
          <volume>793</volume>
          {
          <fpage>802</fpage>
          . Springer-Verlag (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Silberstein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Puggioni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gelfand</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Munagala</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Suppression and failures in sensor networks: A bayesian approach</article-title>
          .
          <source>In: Proceedings of the 33rd international conference on Very large data bases</source>
          . pp.
          <volume>842</volume>
          {
          <fpage>853</fpage>
          .
          <string-name>
            <given-names>VLDB</given-names>
            <surname>Endowment</surname>
          </string-name>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Xu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Helal</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thai</surname>
            ,
            <given-names>M.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmalz</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Optimizing Push / Pull Envelopes for Energy-E cient Cloud-Sensor Systems</article-title>
          . In:
          <article-title>MSWiM 2011 - 14th ACM international conference on Modeling, analysis and simulation of wireless and mobile systems</article-title>
          .
          <source>Miami</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>