<!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>Traffic Management using RTEC in OWL 2 RL</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jakub Marecek IBM Research</string-name>
          <email>berngorm@ie.ibm.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dublin jakub.marecek@ie.ibm.com</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Bernard Gorman IBM Research</institution>
          ,
          <addr-line>Dublin</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Jia Yuan Yu IBM Research</institution>
          ,
          <addr-line>Dublin</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Introduction. In a number of domains, including tra c management, event processing and situational reporting are particularly demanding. This is due to the volumes and realiability of streamed spatio-temporal data involved, ranging from sensor readings, news-wire reports, police reports, to social media, as well as the complexity of the reasoning required. Human, rather than arti cial, intelligence is hence still used to an overwhelming extent. A number of specialised event-processing languages and reasoners have been proposed, extending RDF and SPARQL. These include SPARQL-ST [11], Temporal RDF [14] and TSPARQL [7], Spatio-temporal RDF and stSPARQL [9]. For even more elaborate extensions, see e.g. [12, 2, 10]. Often, these extensions rely on custom parsers for the languages and on custom Prolog-based implementations of reasoners. Yet, none of these extensions has gained a wide adoption. We argue that such speci c languages and reasoners go against the principle of a general-purpose description logics and generalpurpose reasoners [3]. We propose a rewriting of RTEC, the event processing calculus [2], from Prolog to OWL 2 RL [8], which is the only pro le of the Web Ontology Language, for which there exist very e cient reasoners.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        RTEC. Artikis et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] proposed Event Calculus for
RunTime reasoning (RTEC) as a calculus for event
processing. Prolog-based implementations, where event processing
is triggered asynchronously and the derived events are
produced in a streaming fashion, are readily available [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. In
order to make this paper self-contained, we summarise its
principles beyond the very basics [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        Time is assumed to be discretised and space is represented
by GPS coordinates. All predicates in RTEC are de ned
by Horn clauses [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which are the implications of a head
from a body, h1; : : : ; hn b1; : : : ; bm, where 0 n 1 and
m 0. All facts are predicates with m = 0 and n = 1,
such as move(B1, L1, O7, 400), which means that a
particular bus B1 is running on a particular line L1 with a
delay of 400 seconds, as operated by operator O7. Similarly,
gps(B1, 53.31, -6.23, 0, 1) means that the bus B1 is at
the given, its direction is forwards (0) and there is
congestion (1). Based on such facts, one formulates rules, i.e. Horn
clauses with m &gt; 0 and n = 1, for the processing of
instantaneous events or non-instantaneous uents.The occurrence
of an event E, which is an inferred Horn clause with m &gt; 0
and n = 1, at a xed time T , is given by rules using
happensAt(E, T). The occurrence of a uent F is at a nite
list I of intervals, is given using holdsFor(F=V, I). Simple
uents, which hold in a single interval, are given by
initiatedAt(E, T) and terminatedAt(E, T). For an overview of
the predicates, please see Table 1.
      </p>
      <p>Notice that Horn clauses can be used to de ne complex
events, such as the sharp increase in the delay of a bus
parametrised by thresholds t, d for time and delay:
happensAt(delayIncrease(Bus, X, Y, Lon, Lat), T)
:- happensAt(move(Bus, _, _, Delay0), T0),
holdsAt(gps(Bus, X, Y, _, _)=true, T0),
happensAt(move(Bus, _, _, Delay), T),
holdsAt(gps(Bus, Lon, Lat, _, _)=true, T),
Delay - Delay0 &gt; d,
0 &lt; T - T0 &lt; t
where comma denotes conjunction, _ is the anonymous
variable, and :- denotes implication.</p>
      <p>
        The complex events can be processed in a custom
Prologbased implementation [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], or as we show later, a OWL 2
RL reasoner [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. In the Prolog-based implementation, one
rewrites the inputs as facts, and leaves the reasoning about
delayIncrease up to a Prolog interpreter. The resulting
interactions between the ontology tools, Prolog interpreter,
and rewriting among them are frail and challenging to
debug, though.
      </p>
      <p>
        RTEC in OWL 2 RL. It has long been known that Horn
clauses can be rewritten into and queried in OWL 2.
Recently, it has been shown [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] that Horn clauses can be
rewritten in OWL 2 RL, a tractable pro le of OWL. This
rewriting allows for sound and complete reasoning, c.f.
Theorem 1 of [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. Moreover, the reasoning is very e cient,
empirically.
      </p>
      <p>
        The rewriting of Zhou et al. [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] proceeds via Datalog ;_
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and Datalog [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] proper into OWL 2 RL. Instead of goals
in Prolog, which are Horn clauses with m &gt; 0 and n =
0, one uses conjunctive queries in OWL 2 RL. Formally,
Datalog ;_ has rst-order sentences of the form 8x9y s.t.
C1 ^ ^ Cm B, where B is an atom with variables
in x, which is neither ? nor an inequality. Conjunctive
query (CQ) with distinguished predicate Q(y) is 9y (x; y)
and (x; y) a conjunction of atoms without inequalities. In
the example above, the Datalog ;_ rule is:
9 T', D, D' f 9 a, b (happensAt(move(Bus, a, b, D'), T')) ^
9 c, d (holdsAt(gps(Bus, X, Y, c, d)=true, T')) ^
9 e, f (happensAt(move(Bus, e, f, D), T)) ^
9 g, h (holdsAt(gps(Bus, Lon, Lat, g, h)=true, T)) ^
D - D' &gt; d ^
0 &lt; T - T' &lt; t g
happensAt(delayIncrease(Bus, X, Y, Lon, Lat), T),
where all free variables (Bus, X, Y, Lon, Lat, T) are
universally quanti ed. Following this line of work [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], we rewrite
RTEC into OWL 2 RL.
      </p>
      <p>
        This is the rst ever translation of RTEC or any similar
spatio-temporal event-processing logic to OWL 2 RL, as far
as we know. In a companion paper co-authored with the
sta at Dublin City Council [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], we describe an extensive
tra c management system, where we employ RTEC in
trafc management.
      </p>
      <p>
        Conclusions. The value and scalability of spatio-temporal
event processing over streaming data has been demonstrated
a number of times [
        <xref ref-type="bibr" rid="ref1 ref13 ref5">13, 5, 1</xref>
        ]. Notice, however, that there
remains a considerable gap between rst prototypes speci c
to a particular city and a general-purpose methodology or
tools. General-purpose reasoners using RTEC in OWL 2
RL may lack the performance of custom-tailored reasoners,
capable of dealing with gigabytes of data at each time-step,
but o er a handy tool for customising, prototyping, and
debugging systems based on RTEC. The translation of Horn
clauses to OWL 2 RL is clearly applicable to a number of
other event-processing calculi based on Prolog [
        <xref ref-type="bibr" rid="ref11 ref14 ref7 ref9">11, 14, 7,
9</xref>
        ]. This approach may hence weill set the agenda in event
processing more broadly.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Artikis</surname>
          </string-name>
          et al.
          <article-title>Heterogeneous stream processing and crowdsourcing for urban tra c management</article-title>
          .
          <source>In EDBT</source>
          , pages
          <volume>712</volume>
          {
          <fpage>723</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Artikis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sergot</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Paliouras</surname>
          </string-name>
          .
          <article-title>Run-time composite event recognition</article-title>
          .
          <source>In Proceedings of the 6th ACM International Conference on Distributed Event-Based Systems</source>
          , pages
          <fpage>69</fpage>
          {
          <fpage>80</fpage>
          . ACM,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Baader</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Horrocks</surname>
          </string-name>
          , and
          <string-name>
            <given-names>U.</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>Description logics as ontology languages for the semantic web</article-title>
          .
          <source>In Mechanizing Mathematical Reasoning</source>
          , pages
          <volume>228</volume>
          {
          <fpage>248</fpage>
          . Springer,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cal</surname>
          </string-name>
          , G. Gottlob,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lukasiewicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Marnette</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          . Datalog+/
          <article-title>-: A family of logical knowledge representation and query languages for new applications</article-title>
          . Logic in Computer Science, Symposium on,
          <volume>0</volume>
          :
          <fpage>228</fpage>
          {
          <fpage>242</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Del Bimbo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ferracani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Pezzatini</surname>
          </string-name>
          ,
          <string-name>
            <surname>F. D'Amato</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Sereni</surname>
          </string-name>
          .
          <article-title>Livecities: Revealing the pulse of cities by location-based social networks venues and users analysis</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D. M.</given-names>
            <surname>Gabbay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. J.</given-names>
            <surname>Hogger</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Robinson</surname>
          </string-name>
          .
          <source>Handbook of Logic in Arti cial Intelligence and Logic Programming: Volume 5: Logic Programming</source>
          Volume
          <volume>5</volume>
          :
          <string-name>
            <given-names>Logic</given-names>
            <surname>Programming</surname>
          </string-name>
          . Oxford University Press,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          .
          <article-title>T-sparql: A tsql2-like temporal query language for rdf</article-title>
          .
          <source>In ADBIS (Local Proceedings)</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>B. C.</given-names>
            <surname>Grau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Horrocks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Motik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Parsia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Patel-Schneider</surname>
          </string-name>
          , and
          <string-name>
            <given-names>U.</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>Owl 2: The next step for owl</article-title>
          .
          <source>Web Semantics: Science, Services and Agents on the World Wide Web</source>
          ,
          <volume>6</volume>
          (
          <issue>4</issue>
          ):
          <volume>309</volume>
          {
          <fpage>322</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Koubarakis</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Kyzirakos</surname>
          </string-name>
          .
          <article-title>Modeling and querying metadata in the semantic sensor web: The model strdf and the query language stsparql</article-title>
          .
          <source>In The semantic web: research and applications</source>
          , pages
          <volume>425</volume>
          {
          <fpage>439</fpage>
          . Springer,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>G.</given-names>
            <surname>Meditskos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dasiopoulou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Efstathiou</surname>
          </string-name>
          ,
          <string-name>
            <surname>and I. Kompatsiaris.</surname>
          </string-name>
          <article-title>Ontology patterns for complex activity modelling</article-title>
          .
          <source>In Theory, Practice, and Applications of Rules on the Web</source>
          , pages
          <volume>144</volume>
          {
          <fpage>157</fpage>
          . Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Perry</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Jain</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. P.</given-names>
            <surname>Sheth.</surname>
          </string-name>
          Sparql-st:
          <article-title>Extending sparql to support spatiotemporal queries</article-title>
          .
          <source>In Geospatial semantics and the semantic web</source>
          , pages
          <volume>61</volume>
          {
          <fpage>86</fpage>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>M.</given-names>
            <surname>Rinne</surname>
          </string-name>
          .
          <article-title>Sparql update for complex event processing</article-title>
          .
          <source>In The Semantic Web{ISWC</source>
          <year>2012</year>
          , pages
          <fpage>453</fpage>
          {
          <fpage>456</fpage>
          . Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>S.</given-names>
            <surname>Tallevi-Diotallevi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kotoulas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Foschini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Lecue</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Corradi</surname>
          </string-name>
          .
          <article-title>Real-time urban monitoring in dublin using semantic and stream technologies</article-title>
          .
          <source>In The Semantic Web { ISWC</source>
          <year>2013</year>
          , pages
          <fpage>178</fpage>
          {
          <fpage>194</fpage>
          . Springer Berlin Heidelberg,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>J.</given-names>
            <surname>Tappolet</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Bernstein</surname>
          </string-name>
          .
          <article-title>Applied temporal rdf: E cient temporal querying of rdf data with sparql</article-title>
          .
          <source>In The Semantic Web: Research and Applications</source>
          , pages
          <volume>308</volume>
          {
          <fpage>322</fpage>
          . Springer,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. Cuenca</given-names>
            <surname>Grau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Horrocks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Wu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Banerjee</surname>
          </string-name>
          .
          <article-title>Making the most of your triple store: Query answering in owl 2 using an rl reasoner</article-title>
          .
          <source>In Proceedings of the 22nd International Conference on World Wide Web, WWW '13</source>
          , pages
          <fpage>1569</fpage>
          {
          <fpage>1580</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Nenov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. C.</given-names>
            <surname>Grau</surname>
          </string-name>
          ,
          <string-name>
            <surname>and I. Horrocks.</surname>
          </string-name>
          <article-title>Complete query answering over horn ontologies using a triple store</article-title>
          .
          <source>In International Semantic Web Conference (1)</source>
          , pages
          <fpage>720</fpage>
          {
          <fpage>736</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>