=Paper= {{Paper |id=Vol-1383/paper20 |storemode=property |title=Traffic Management Using RTEC in OWL 2 RL |pdfUrl=https://ceur-ws.org/Vol-1383/paper20.pdf |volume=Vol-1383 |dblpUrl=https://dblp.org/rec/conf/semweb/GormanMY14 }} ==Traffic Management Using RTEC in OWL 2 RL== https://ceur-ws.org/Vol-1383/paper20.pdf
                                           Traffic Management
                                         using RTEC in OWL 2 RL

                 Bernard Gorman                            Jakub Marecek                         Jia Yuan Yu
                IBM Research, Dublin                     IBM Research, Dublin                IBM Research, Dublin
            berngorm@ie.ibm.com                     jakub.marecek@ie.ibm.com                     jy@osore.ca



Introduction. In a number of domains, including traffic                ticular bus B1 is running on a particular line L1 with a
management, event processing and situational reporting are             delay of 400 seconds, as operated by operator O7. Similarly,
particularly demanding. This is due to the volumes and re-             gps(B1, 53.31, -6.23, 0, 1) means that the bus B1 is at
aliability of streamed spatio-temporal data involved, ranging          the given, its direction is forwards (0) and there is conges-
from sensor readings, news-wire reports, police reports, to            tion (1). Based on such facts, one formulates rules, i.e. Horn
social media, as well as the complexity of the reasoning re-           clauses with m > 0 and n = 1, for the processing of instan-
quired. Human, rather than artificial, intelligence is hence           taneous events or non-instantaneous fluents.The occurrence
still used to an overwhelming extent.                                  of an event E, which is an inferred Horn clause with m > 0
                                                                       and n = 1, at a fixed time T , is given by rules using hap-
A number of specialised event-processing languages and rea-            pensAt(E, T). The occurrence of a fluent F is at a finite
soners have been proposed, extending RDF and SPARQL.                   list I of intervals, is given using holdsFor(F=V, I). Simple
These include SPARQL-ST [11], Temporal RDF [14] and T-                 fluents, which hold in a single interval, are given by initi-
SPARQL [7], Spatio-temporal RDF and stSPARQL [9]. For                  atedAt(E, T) and terminatedAt(E, T). For an overview of
even more elaborate extensions, see e.g. [12, 2, 10]. Often,           the predicates, please see Table 1.
these extensions rely on custom parsers for the languages
and on custom Prolog-based implementations of reasoners.               Notice that Horn clauses can be used to define complex
Yet, none of these extensions has gained a wide adoption.              events, such as the sharp increase in the delay of a bus
                                                                       parametrised by thresholds t, d for time and delay:
We argue that such specific languages and reasoners go against
the principle of a general-purpose description logics and general-     happensAt(delayIncrease(Bus, X, Y, Lon, Lat), T)
purpose reasoners [3]. We propose a rewriting of RTEC, the             :- happensAt(move(Bus, _, _, Delay0), T0),
event processing calculus [2], from Prolog to OWL 2 RL [8],               holdsAt(gps(Bus, X, Y, _, _)=true, T0),
which is the only profile of the Web Ontology Language, for               happensAt(move(Bus, _, _, Delay), T),
which there exist very efficient reasoners.                               holdsAt(gps(Bus, Lon, Lat, _, _)=true, T),
                                                                          Delay - Delay0 > d,
RTEC. Artikis et al. [2] proposed Event Calculus for Run-                 0 < T - T0 < t
Time reasoning (RTEC) as a calculus for event process-
ing. Prolog-based implementations, where event processing
is triggered asynchronously and the derived events are pro-            where comma denotes conjunction, _ is the anonymous vari-
duced in a streaming fashion, are readily available [1]. In            able, and :- denotes implication.
order to make this paper self-contained, we summarise its
principles beyond the very basics [6].                                 The complex events can be processed in a custom Prolog-
                                                                       based implementation [1], or as we show later, a OWL 2
Time is assumed to be discretised and space is represented             RL reasoner [16]. In the Prolog-based implementation, one
by GPS coordinates. All predicates in RTEC are defined                 rewrites the inputs as facts, and leaves the reasoning about
by Horn clauses [6], which are the implications of a head              delayIncrease up to a Prolog interpreter. The resulting
from a body, h1 , . . . , hn ← b1 , . . . , bm , where 0 ≤ n ≤ 1 and   interactions between the ontology tools, Prolog interpreter,
m ≥ 0. All facts are predicates with m = 0 and n = 1,                  and rewriting among them are frail and challenging to de-
such as move(B1, L1, O7, 400), which means that a par-                 bug, though.

                                                                       RTEC in OWL 2 RL. It has long been known that Horn
                                                                       clauses can be rewritten into and queried in OWL 2. Re-
                                                                       cently, it has been shown [15] that Horn clauses can be
                                                                       rewritten in OWL 2 RL, a tractable profile of OWL. This
                                                                       rewriting allows for sound and complete reasoning, c.f. The-
                                                                       orem 1 of [16]. Moreover, the reasoning is very efficient,
                                                                       empirically.

                                                                       The rewriting of Zhou et al. [16] proceeds via Datalog±,∨
                        Table 1: Main predicates of RTEC. Cited loosely from [1].
 Predicate                          Meaning
 happensAt(E, T)                    Event E occur s at time T
 holdsAt(F=V, T)                    The value of fluent F is V at time T
 holdsFor(F=V, I)                   The list I of intervals for which F = V holds
 initiatedAt(F=V, T)                Fluent F = V is initiated at T
 terminatedAt(F=V, T)               Fluent F = V is terminated at T
 relative_complement_all (I0, L, I) The list I of intervals is obtained by complementing i ∈ I0 within ground set L
 union_all(L, I )                   The list I of intervals is the union of those in L
 intersect_all(L, I )               The list I of intervals is the intersection of those in L


[4] and Datalog [6] proper into OWL 2 RL. Instead of goals                ontology languages for the semantic web. In Mechanizing
in Prolog, which are Horn clauses with m > 0 and n =                      Mathematical Reasoning, pages 228–248. Springer, 2005.
0, one uses conjunctive queries in OWL 2 RL. Formally,                [4] A. Calı̀, G. Gottlob, T. Lukasiewicz, B. Marnette, and
Datalog±,∨ has first-order sentences of the form ∀x∃y s.t.                A. Pieris. Datalog+/-: A family of logical knowledge
                                                                          representation and query languages for new applications.
C1 ∧ · · · ∧ Cm ← B, where B is an atom with variables                    Logic in Computer Science, Symposium on, 0:228–242,
in x, which is neither ⊥ nor an inequality. Conjunctive                   2010.
query (CQ) with distinguished predicate Q(y) is ∃yφ(x, y)             [5] A. Del Bimbo, A. Ferracani, D. Pezzatini, F. D’Amato, and
and φ(x, y) a conjunction of atoms without inequalities. In               M. Sereni. Livecities: Revealing the pulse of cities by
the example above, the Datalog±,∨ rule is:                                location-based social networks venues and users analysis.
∃ T’, D, D’ { ∃ a, b (happensAt(move(Bus, a, b, D’), T’)) ∧           [6] D. M. Gabbay, C. J. Hogger, and J. A. Robinson. Handbook
       ∃ c, d (holdsAt(gps(Bus, X, Y, c, d)=true, T’)) ∧                  of Logic in Artificial Intelligence and Logic Programming:
                                                                          Volume 5: Logic Programming Volume 5: Logic
       ∃ e, f (happensAt(move(Bus, e, f, D), T)) ∧                        Programming. Oxford University Press, 1998.
       ∃ g, h (holdsAt(gps(Bus, Lon, Lat, g, h)=true, T)) ∧           [7] F. Grandi. T-sparql: A tsql2-like temporal query language
       D - D’ > d ∧                                                       for rdf. In ADBIS (Local Proceedings), 2010.
       0 < T - T’ < t }                                               [8] B. C. Grau, I. Horrocks, B. Motik, B. Parsia,
← happensAt(delayIncrease(Bus, X, Y, Lon, Lat), T),                       P. Patel-Schneider, and U. Sattler. Owl 2: The next step
where all free variables (Bus, X, Y, Lon, Lat, T) are univer-             for owl. Web Semantics: Science, Services and Agents on
sally quantified. Following this line of work [15], we rewrite            the World Wide Web, 6(4):309–322, 2008.
RTEC into OWL 2 RL.                                                   [9] M. Koubarakis and K. Kyzirakos. Modeling and querying
                                                                          metadata in the semantic sensor web: The model strdf and
                                                                          the query language stsparql. In The semantic web: research
This is the first ever translation of RTEC or any similar                 and applications, pages 425–439. Springer, 2010.
spatio-temporal event-processing logic to OWL 2 RL, as far           [10] G. Meditskos, S. Dasiopoulou, V. Efstathiou, and
as we know. In a companion paper co-authored with the                     I. Kompatsiaris. Ontology patterns for complex activity
staff at Dublin City Council [1], we describe an extensive                modelling. In Theory, Practice, and Applications of Rules
traffic management system, where we employ RTEC in traf-                  on the Web, pages 144–157. Springer, 2013.
fic management.                                                      [11] M. Perry, P. Jain, and A. P. Sheth. Sparql-st: Extending
                                                                          sparql to support spatiotemporal queries. In Geospatial
                                                                          semantics and the semantic web, pages 61–86. Springer,
Conclusions. The value and scalability of spatio-temporal                 2011.
event processing over streaming data has been demonstrated           [12] M. Rinne. Sparql update for complex event processing. In
a number of times [13, 5, 1]. Notice, however, that there                 The Semantic Web–ISWC 2012, pages 453–456. Springer,
remains a considerable gap between first prototypes specific              2012.
to a particular city and a general-purpose methodology or            [13] S. Tallevi-Diotallevi, S. Kotoulas, L. Foschini, F. Lécué,
tools. General-purpose reasoners using RTEC in OWL 2                      and A. Corradi. Real-time urban monitoring in dublin
                                                                          using semantic and stream technologies. In The Semantic
RL may lack the performance of custom-tailored reasoners,                 Web – ISWC 2013, pages 178–194. Springer Berlin
capable of dealing with gigabytes of data at each time-step,              Heidelberg, 2013.
but offer a handy tool for customising, prototyping, and             [14] J. Tappolet and A. Bernstein. Applied temporal rdf:
debugging systems based on RTEC. The translation of Horn                  Efficient temporal querying of rdf data with sparql. In The
clauses to OWL 2 RL is clearly applicable to a number of                  Semantic Web: Research and Applications, pages 308–322.
other event-processing calculi based on Prolog [11, 14, 7,                Springer, 2009.
9]. This approach may hence weill set the agenda in event            [15] Y. Zhou, B. Cuenca Grau, I. Horrocks, Z. Wu, and
                                                                          J. Banerjee. Making the most of your triple store: Query
processing more broadly.                                                  answering in owl 2 using an rl reasoner. In Proceedings of
                                                                          the 22nd International Conference on World Wide Web,
1.   REFERENCES                                                           WWW ’13, pages 1569–1580, 2013.
 [1] A. Artikis et al. Heterogeneous stream processing and           [16] Y. Zhou, Y. Nenov, B. C. Grau, and I. Horrocks. Complete
     crowdsourcing for urban traffic management. In EDBT,                 query answering over horn ontologies using a triple store. In
     pages 712–723, 2014.                                                 International Semantic Web Conference (1), pages
 [2] A. Artikis, M. Sergot, and G. Paliouras. Run-time                    720–736, 2013.
     composite event recognition. In Proceedings of the 6th
     ACM International Conference on Distributed Event-Based
     Systems, pages 69–80. ACM, 2012.
 [3] F. Baader, I. Horrocks, and U. Sattler. Description logics as