<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Stream-Temporal Query Language for Ontology Based Data Access?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Özgür L. Özçep</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ralf Möller</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christian Neuenstadt</string-name>
          <email>christian.neuenstadt@tu-harburg.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute for Softwaresystems (STS) Hamburg University of Technology Hamburg</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The paper contributes to the recent efforts on temporalizing and streamifiying ontology based data access (OBDA) by discussing aspects of rewritability, i.e., compilability of the TBox into ontology-level queries, and unfoldability, i.e., transformability of ontology-level queries to queries on datasource level, for the new query-language framework STARQL. The distinguishing feature of STARQL is its general stream windowing and ABox sequencing strategy which allows it to plugin well known query languages such as unions of conjunctive queries (UCQs) in combination with TBox languages such as DL-Lite and do temporal reasoning with a sorted first order logic on top of them. The paper discusses safety aspects under which STARQL queries that embed UCQs over DL-Lite ontologies can be rewritten and unfolded to back-end relational stream query languages such as CQL. With these results, the adoption of description logic technology in industrially relevant application areas such as industrial monitoring is crucially fostered.</p>
      </abstract>
      <kwd-group>
        <kwd>streams</kwd>
        <kwd>OBDA</kwd>
        <kwd>monitoring</kwd>
        <kwd>unfolding</kwd>
        <kwd>safety</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The work described in this paper is part of recent efforts on streamifying OBDA
[
        <xref ref-type="bibr" rid="ref12 ref6 ref7">12,6,7,18</xref>
        ] and, to some extent, also temporalizing OBDA [
        <xref ref-type="bibr" rid="ref4 ref5">5,4</xref>
        ]. Streams, as
potentially infinite sequences of elements, cannot be processed as a whole. Hence
blocking operators such as the classical grouping operator and aggregation
operators cannot be applied to it. The simple but fundamental idea of circumventing
this problem is to apply on streams a (small) window the content of which is
updated as new elements from the stream arrive at the query answering system.
      </p>
      <p>Stream window operators play an important role also in the new query
language framework STARQL (Streaming and Temporal ontology Access with a
Reasoning-based Query Language, pronounced Star-Q-L, [17,16]). Its framework
character relies in the facts that 1) it can embed queries of various query
languages, 2) refer to ontologies in various DL languages, and 3) use a first order
? This work has been supported by the European Commission as part of the FP7
project Optique.
logic (FOL) fragment for temporal reasoning over ABox sequences constructed
within the query. In this paper, we focus on the latter aspect assuming for the
first two unions of conjunctive queries (UCQs) w.r.t DL-Lite ontologies.</p>
      <p>
        In STARQL, the idea of processing over windows is pushed further by
extending these with sequencing operators that set up at every time point a finite
sequence of ABoxes on which temporal reasoning can be applied. STARQL does
not assume a stream of ABoxes which hold universally but rather
modifies/exploits the given ABox streams to build its own stream of finite ABox sequences.
This sequencing strategy, among other things, distinguishes STARQL from the
approaches in [
        <xref ref-type="bibr" rid="ref12 ref6 ref7">12,6,7,18</xref>
        ]. It is a natural addition to the window operators that
sets up at every time point a context in which temporal reasoning can be applied.
      </p>
      <p>In this paper, we consider an instantiation of STARQL where Intra-ABox
reasoning within sequences is handled by answering UCQs over DL-Lite
ontologies w.r.t. the certain answer semantics. (Which logic from the DL-Lite family
to choose does not matter, as long as it allows for FOL rewriting.) Within
InterABox reasoning certain answers from the different ABoxes are related and
constrained with an outer temporal FOL formula. This is challenging if one allows
in the FOL template negation, disjunction and all quantifiers in combination
with concrete domains, as these, if not constrained, would immediately lead to
infinite sets of answers, in particular w.r.t. concrete domain values.</p>
      <p>
        STARQL uses a new adornment technique for variables to guarantee
safeness. We demonstrate the safety mechanism which will guarantee that the FOL
template language is domain independent [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and as such can be rewritten as
SQL query. This opens the door for (rewriting and) unfolding STARQL queries
into queries of domain independent languages such as the relational stream query
language CQL [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Based on CQL, practical systems have been developed. Thus,
this paper provides the foundation for expressive ODBA stream querying.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>The STARQL framework</title>
      <p>We describe the syntax and the semantics for a fragment of STARQL (see [17]
for the full version).</p>
      <p>Our running example for illustration purposes is a measurement scenario in
which there is a (possibly virtual) stream SMsmt of ABox assertions. Its initial
part, called SM5smst here, contains timestamped ABox assertions giving the value
of a temperature sensor s0 at 6 time points starting with 0s.</p>
      <p>SM5smst = fval (s0; 90 )h0si; val (s0; 93 )h1si; val (s0; 94 )h2si</p>
      <p>val (s0; 92 )h3si; val (s0; 93 )h4si; val (s0; 95 )h5sig
Assume further, that a static ABox contains knowledge on sensors telling, e.g.,
which sensor is of which type. In particular, let BurnerT ipT empSens(s0) be in
the static ABox. Moreover, let there be a pure DL-Lite TBox with additional
information such as BurnerT ipT empSens v T empSens saying that all burner
tip temperature sensors are temperature sensors.</p>
      <p>We want to formalize the following information need: Starting with time point
0s, output every second those temperature sensors whose value grew
monotonically in the last 2 seconds. A possible STARQL representation of the information
is illustrated in the following listing.</p>
      <p>CREATE STREAM S_out AS
CREATE PULSE AS START = 0s , FREQUENCE = 1s
SELECT { ?s rdf : type MonInc }&lt; NOW &gt;
FROM S_Msmt [ NOW -2s , NOW ] - &gt;1 s
USING STATIC ABOX &lt; http :// Astatic &gt;, TBOX &lt; http :// TBox &gt;
WHERE { ?s rdf : type TempSens }
SEQUENCE BY StdSeq AS SEQ
HAVING FORALL i &lt; j IN SEQ ,?x ,? y:</p>
      <p>IF ({ ?s val ?x }&lt;i &gt; AND { ?s
val ?y }&lt;j &gt;) THEN ?x &lt;= ?y
Syntax The example demonstrates much of the syntactical possibilities within
STARQL whose grammar is sketched in Fig. 1. The rules for the HAVING clause
are not given there but are discussed in more in the following sections.</p>
      <p>
        After the create expressions for the stream and the output frequency the
queries’ main contents are captured by the select expressions. The head of the
select expression describes the output format of the stream giving a RDF basic
graph pattern (BGP) with an attached time expression, here &lt; N OW &gt;, for
the evolving time. The general motivation for this approach is similar to the
CONSTRUCT operator in the SPARQL query language. So the actual result in the
monotonicity example is a stream of ABox assertions of the form M onInc(s0)hti.
Sou5ts = fM onInc(s0)h0si; M onInc(s0)h1si; M onInc(s0)h2si; M onInc(s0)h5sig
Within the WHERE clause one can bind variables w.r.t the KBs mentioned in the
USING clause by using UCQs. We assume an underlying DL-Lite Logic for the
static ABox, the TBox and the UCQs which allows for concrete domain values,
e.g. DL-LiteA [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. In this example, instantiations of the sensors ?s are fixed w.r.t
to a static ABox and a TBox given by URIs.
      </p>
      <p>The heart of the STARQL queries is the window operator in combination with
the sequencing mechanism. In the example, the operator [NOW-2s, NOW]-&gt;1s
describes a sliding window operator, which collects the timestamped ABox
assertions in the last two seconds and then slides 1s forward in time. Every
temporal ABox produced by the window operator is converted to a sequence of (pure)
ABoxes. At every time point, one has a sequence of ABoxes on which temporal
(state-based) reasoning can be applied. This is realized in STARQL by a sorted
first order language template in which timestamped UCQs conditions (notated
here as BGP) are embedded. In the example above, the HAVING clause expresses
a monotonicity condition stating that for all values ?x that are values of sensor
?s w.r.t the ith ABox and for all values ?y that are values of the same sensor ?s
w.r.t. the jth ABox, it must be the case that ?x is less than or equal to ?y.
createExp
pulseExp
selectExp
! CREATE STREAM name AS [pulseExp] selectExp j pulseExp
! CREATE PULSE AS START = startTime; FREQUENCE = freq
! SELECT selectHead(x; y) FROM listWinStreamExp
[USING listOfRessources] WHERE whereClause(x)</p>
      <p>SEQUENCE BY seqMethod [HAVING safeHavingClause(x; y)]
selectHead (x; y)
listWinStreamExp
! sparqlTriple(x; y) &lt;time1&gt; . fselectHead (x; y) &lt;time2&gt; g
! (name j selectExp)windowExp[ , listWinStreamExp]
windowExp
listOfRessources
typedRessourceList
! [ timeExp1 ; timeExp2 ]-&gt;slideConst
! typedRessourceList [ , listOf Ressources]
! STATIC ABOX listofURIstoStaticABoxes j</p>
      <p>TEMPORAL ABOX listofURIstoTemporalABoxes j
TBOX listofURIstoTBoxes</p>
      <p>(x) (with (x) a UCQ with distinguished variables x)
whereClause(x) !
seqMethod ! StdSeq j SeqMethod ( )
Semantics STARQL queries have streams of ABox assertions as input and
output. That means that the definition of the semantics for STARQL has to
explicate how the output stream of ABox assertions is computed from the
input streams. Using the compositionality principle, the semantics definition for
SPARQL can be accomplished by defining the semantic denotations for the
substructures of the query (be it subqueries or other data structures) and then by
composing them to the denotation of the whole query. We are going to sketch the
semantics of the window operator, of the sequencing, and of the HAVING clause.</p>
      <p>A stream of ABox assertions is an infinite set of timestamped ABox
assertions of the form axhti. The timestamps stem from a flow of time (T; )
where T may even be a dense set and where is a linear order. Let S be
a stream name with its denotation JSK being such a stream of timestamped
ABox assertions. We declare the denotation of the windowed stream ws =
S winExp = S [timeExp1 ; timeExp2 ]-&gt;sl as a stream of temporal ABoxes,
where a temporal ABox is a set of timestamped assertions.</p>
      <p>Let t:g1(t) = JtimeExp1K and t:g2(t) = JtimeExp2K be the functions
corresponding to the time expressions. The pulse declaration defines a subset T 0 T
of the time domain. T 0 is the set of timestamps of the stream of temporal ABoxes
JwsK. Let T 0 be represented by the increasing sequence of timestamps (ti)i2N,
where t0 is the starting point fixed in the pulse declaration.</p>
      <p>Now, one defines for every ti the temporal ABox Ati such that (A~ti ; ti) 2
~
JwSK. If ti &lt; sl 1, then A~ti = ;. Else set first tstart = bti=slc sl and
tend = maxftstart (g2(ti) g1(ti)); 0g, and define on that basis
~
Ati = f(ass; t) j (ass; t) 2 JSK and tend
t
tstartg
So in the example above, timeExp1 = N OW 2s, timeExp2 = N OW and
sl = 1s; the example’s results for second 4s and 5s are the following.</p>
      <p>Time Temporal ABox
4s fval (s0; 94 )h2si; val (s0; 92 )h3si; val (s0; 93 )h4sig
5s fval (s0; 92 )h3si; val (s0; 93 )h4si; val (s0; 95 )h5sig
If the STARQL query refers to more than one stream, than these are joined
by timewise union of the temporal ABoxes of the windowed streams, which is
possible as the pulse declaration synchronizes all streams of temporal ABoxes.</p>
      <p>The stream of temporal ABoxes is the input for the sequencing operator
which produces for every time point of the pulse a sequence of (pure) ABoxes.
The sequencing methods used in STARQL refer to an equivalence relation to
specify which assertions go into the same ABox. The equivalence classes [x]
for x 2 T form a partition of T . We restrict the class of admissible equivalence
relations tho those that respect the time ordering, i.e., the partition of
equivalence classes should be convex intervals on the time domain.</p>
      <p>Now, we define the sequence of ABoxes generated by seqM ethod( ) on the
stream of temporal ABoxes as follows: Let (A~t; t) be the temporal ABox at t.
Let T 0 = ft1; : : : ; tlg be the time points occurring in A~t and let k the number of
equivalence classes generated by the time points in T 0. Then define the sequence
at t as (A0; : : : ; Ak) where for every i 2 f0; : : : ; kg the pure ABox Ai is</p>
      <p>Ai = faxht0i j axht0i 2 A~t and t0 in ith equivalence classg
In the example above, the equivalence is the identity (keyword StdSeq for
standard sequencing), so that the resulting sequence of ABoxes at time point 5s is
trivial as there are no more than two ABox assertions with the same timestamp:
fval (s0; 92 )gh0i; fval (s0; 93 )gh1i; fval (s0; 95 )gh2i.</p>
      <p>
        STARQL’s semantics for the HAVING clauses relies on the certain answer
semantics (see [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]) for the embedded UCQs. The idea is to view the tuples in
the certain answer sets as members of a sorted FOL structure It. Assume that
the sequence of ABoxes at some given time point t is seq = (A0; : : : ; Ak). Then
the domain of It consists of the index set f0; : : : ; kg as well as the set of all
individual constants and all value constants of the signature. Now, if the HAVING
clause contains, for example, the state tagged condition query val(s; x)hii (with
embedded UCQ val(s; x)), then we introduce for it a ternary relation symbol R
and replace val(s; x)hii by R(s; x; i) in the HAVING clause. This symbol is denoted
in It by the certain answers of the embedded query extended with the index i:
RIt = f(a; b; i) j (a; b) 2 cert(val(s; x); Ai [ Astatic [ T )g. Constants are denoted
by themselves in It. This already fixes a structure It with finite denotations of
its relation symbols. The evaluation of the HAVING clause is then nothing else as
evaluating the FOL formula (after the substitutions) on the structure It.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>A Safe Fragment for HAVING clauses</title>
      <p>
        As demonstrated with the monotonicity example, STARQL allows a sorted FOL
to reason on the ABox sequences. The semantics for the HAVING clauses rests on
the structure It whose domain It does not consist only of the individual and
value constants in the interpretations of the relations, the so called active domain
according to database terminology [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], but the whole set Dom of individual
constants, value constants and the indices produced in the sequencing. With a
safety mechanism on the HAVING clause it can be guaranteed that the evaluation
of the HAVING clause on the ABox sequence depends only on the active domain.
      </p>
      <p>Figure 2 contains the grammar for the HAVING clause language with its safety
mechanism realized by variable guards/adornments. The safe having clauses
(denoted by safeHavingClause, which is the start symbol of the grammar) contain
only those variables for individuals that have guard status +. We illustrate the
meaning of the rules with Rule (1) for the OR case and then go in more detail
w.r.t. adornments.</p>
      <p>hCl (zg1_g2 )
! hCl (zg1 ) OR hCl (zg2 )
(1)
A having clause hCl may be constructed as (produces) a disjunction of two
having clauses under some conditions on the variables occurring in them. If
during production a clause hCl (zg) with variables z and some adornment g for
them is reached, then Rule (1) justifies the production of hCl (zg1 ) OR hCl (zg2 )
if the adornment g can be represented as g = g1 _ g2, i.e., if g is the result of
applying a function _ on the adornment lists g1; g2.</p>
      <p>The adornments g = g1; : : : ; gn are lists of guard status gi (g-status for short),
where gi 2 f+; ; ; ;g. We use zg as an abbreviation for z1g1 ; : : : ; zngn where
z = z1; : : : ; zn and g = g1; : : : ; gn. We assume the ordering ; +
on the guards. This ordering is relevant for the calculation of gmax in the rule
of Fig. 2 where the clause is constructed from an arbitrary clause hCl and an
identity atom. The special case of gi = ; is a convenience notation meaning for
x; that x does not occur at all in the formula.</p>
      <p>The meanings of the functions :; _; ^; ! over vectors of g-status are fixed
by the tables in Figure 3. Combinations with the g-status ; is handled in
an extra table 3b. So for example, assume that one has produced a HAVING
clause F (x1 ; x2+; x3 ), where x1 has g-status , x2 has g-status +, and x3
has g-status . Then rule (1) and the tables allow, e.g., the production of
F1(x1 ; x2+; x3 ) OR F2(x1+; x2+; x3;). Let us verify this for the variable x1: Its
gstatus in F1 and its g-status + in F2 combines to the g-status = _+
in F—according to the entry for the pair ( ; +) in the table of _.</p>
      <p>Now, we will show how to transform HAVING clauses to the relational algebra
(SQL). In particular this will show that the HAVING clause language is domain
independent as relational algebra is domain independent. For a formula F let
SRN F (F ) be the formula in safe range normal form (SRNF) [1, S.85] resulting
from applying the following normalization rules
– Rename variables such that no variable symbol occurrence is bound by
different quantifiers and such that no variable occurs bound and free
– Rewrite IF F THEN G to NOT F OR G.
– Eliminate double negations
– Eliminate FORALL quantifiers by FORALL z ; NOT EXISTS z NOT.
stateArithAtom(ig11 ; ig22 )
stateArithAtom(ig11 ; ig22 ; ig33 )
stateAtom(x ; y )
stateAtom(x+)
term(i+) ! i</p>
      <p>term() ! max j 0 j 1
stateAtom(y+; i+) ! (x; y) &lt;i &gt;
(for a UCQ (x; y) and
x X, y V arind [ V arval n X)
! x = y (for y; x 2= X [ V arval)
! x = a j a = x</p>
      <p>(for a 2 (X \ V arind) [ Constconst, x 2 V arind n X)
vAtom(z1+) ! z1 = v j v = z1</p>
      <p>(for z1 2 V arval n X and v 2 Constval)
vAtom(z1+) ! z1 = z2 j z2 = z1</p>
      <p>(for z1 2 V arval n X, and z2 2 X \ V arval)
vAtom(z1 ; z2 ) ! z1 op z2</p>
      <p>(for op 2 f&lt;,&lt;=, &gt;, &gt;=, =g; z1; z2 2 V arval n X)
vAtom(z1 ) ! z1 op z2 (for op 2 f&lt;,&lt;=, &gt;, &gt;=g, z1 2 V arval n X,
z2 2 V alconst [ (X \ V alvar)
! term1(ig11 ) op term2(ig22 )</p>
      <p>(for op 2 f&lt;,&lt;=, =, &gt;, &gt;=g)
! plus(term1(ig11 ); term2(ig22 ); term3(ig33 ))
hCl (zg)
hCl (zg1_g2 )
hCl (zg1^g2 )
hCl (z1gmax ; z2gmax ; z3g3 )</p>
      <p>hCl (z:g)
hCl (zg1!g2 )
hCl (zg1!g2 )
hCl (zg1^g2 )
! stateAtom(zg) j vAtom(zg) j stateArithAtom(zg)
! hCl (zg1 ) OR hCl (zg2 )
! hCl (zg1 ) AND hCl (zg2 ) (both conjuncts are</p>
      <p>not of form x = y for x; y 2 V arind [ V arval)
! hCl (z1g1 ; z2g2 ; z3g3 ) AND z1h1 = z2h2</p>
      <p>(for gmax = maxfg1; g2; h1; h2g)
! NOT hCl (zg)
! IF hCl (zg1 ) THEN hCl (zg2 )
! FORALL y IF hCl (zg1 ; y+) THEN hCl (zg2 ; yg)
! EXISTS y hCl (zg1 ; y+) AND hCl (zg2 ; yg)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
g1 g2 g1 ^ g2 g1 _ g2 g1 ! g2
;
;
+ ; +
;
;
;
+
+
(a) Variables existent in both subformulas
(b) Variable missing in one subformula
Please note that these rules are applied in some order until they cannot be
applied anymore. A formula F is said to be in SRNF iff F = SRN F (F ).</p>
      <p>
        Domain independence for formulas in SRNF are handled in the literature [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
also by a guard concept. This is realized by a function rr as follows. (Note that
we use set operations on lists of variables in the canonical way.)
5. rr(F AND G) = rr(F ) [ rr(G)
6. rr(F AND (x = y)) = rrrr((FF )) [ fx; yg ieflsrer(F ) \ fx; yg 6= ;
7. rr(F OR G) = rr(F ) \ rr(G)
8. rr(NOT F ) = ;
9. rr(EXISTS xF ) =
rr(F ) n x if x
return ? else
rr(F )
The definition of rr in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] are simpler than our adornment technique used in
the grammar because of two main reasons: the authors in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] assume that the
formula is already in SRNF form, whereas we do not. Moreover, we define the
HAVING clause grammar in the context of the grammar for STARQL queries.
So, we have to take care of variables X that are already bounded by the WHERE
clause. This leads to many sub-cases in our grammar.
      </p>
      <p>A formula F in SRNF is called range restricted iff f ree(F ) = rr(F ) and
no subformula returns ?. A well known theorem states that range restricted
formulas in SRNF are exactly as expressive as relational algebra—which is known
to be domain independent. Hence it is well known that safe range formulas are
domain independent (in particular all sets of answers are finite).</p>
      <p>
        Relating our set of g-status with the set of g-status used in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] leads to the
desired theorem.
      </p>
      <p>Theorem 1. All safe HAVING clauses (considered as queries on the DB It of
certain answers within the actual ABox sequence at t) are domain independent.</p>
      <p>Let saf ehCl(u+) be a safe HAVING clause. Let saf ehClN F (u) be the
formula resulting from applying the SRNF normalization rules. The status of all
the guards are not changed by the rules. Now, we see that for all subformulas
G(x+; y ; z ) in saf ehClN F (u) we have
(*) rr(G) = x (= all variables in G with g-status +)</p>
      <p>The proof of ( ) is by structural induction on construction of the formula
saf ehcLN F (u). Let G(x+; y ; z ) be an atomic clause. Then rr(G) = x
follows from looking at the adornments of the atomic clauses G in Fig. 2 and
checking that only those with g-status + are in rr(G). Hereby, variables x 2 X,
whereX is defined in the grammar, are treated as constants in the definition of
rr( ). The case of conjunction is clear too as any + g-status combines with any
other g-status to +. Now take negation G = NOT F (x+; y ; z ). The
definition of rr for the negation case says rr(G) = ;. Actually we know that F is
an atomic formula. Looking at all variables for these formulas in the grammar
we see that no one of these as g-status , hence actually y = ; and we have
G(x ; z ), so there is no variable in G with g-status +, hence indeed we get
that rr(G) = ; = the variables in G with g-status +. The case for disjunction
is clear as a positive g-status results for a variable in a disjunction only if both
variables exists in the disjuncts and are labelled +. Now the last case is that of
the exists quantifier G = EXISTS xF (x+; y ; z ). According to induction
assumption rr(F ) = x. G may result from a transformation of an exists subformula
EXISTS xhCl(x+; : : : ) AND F 0 in hcl(u+). So the variable x is by definition in
the set x of variables in F with g-status +, hence rr(G) = rr(F )nfxg. But G does
not occur as free variable in G, hence the set of variables in G with g-status + is
actually x without x, which proves the induction claim. Now G may also result
from applying somewhere the rule FORALL NOT EXISTS NOT. But again, there
is a formula with variables that have g-status + and are bounded by the all
quantifier so that one gets again a formula of the form EXISTS xhCl(x+; : : : ) AND F 0.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Unfolding STARQL into CQL</title>
      <p>Having shown domain independence for the the HAVING clause language is the
main step towards using STARQL for OBDA in the classical sense according to
which queries on the ontology level are rewritten and unfolded into queries over
the data source. Rewriting is done locally w.r.t. every ABox in the sequence,
resulting in a new STARQL query. Hence we only discuss unfolding.</p>
      <p>
        We illustrate how to unfold STARQL queries into CQL queries; CQL [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is
one of the early relational stream query languages having served as a blue print
for many stream query languages even on the ontological level (e.g., [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ],[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ],[18]).
CQL window operators get as input a stream and produce a temporal relation,
which is a function over the time domain T giving for every t an ordinary (called
instantaneous) relation Rt. The operator RStream gets a temporal relation R
as input and produces a stream of tuples dhti such that d 2 Rt.
      </p>
      <p>Following the classical OBDA approach we assume that the streams to which
STARQL refers are produced by mappings. In our example, let be given a
CQL stream of measurements M smt with schema Msmt(MID, MtimeStamp,
SID, Mval). A mapping takes a CQL query over this stream and produces a
stream of assertions of the form val(x; y)hti.
val(x; y)hzi</p>
      <p>SELECT Rstream(f(SID) as x, Mval as y, MtimeStamp as t)
FROM Msmt[NOW]</p>
      <p>The main challenge for unfolding STARQL is the new data structure of an
ABox sequence, which is not representable in CQL. So we therefore that the
STARQL queries use the standard sequencing only, so that from every state i
in the sequence associated with tNOW one can reconstruct the timestamps of
the tuples occurring in the ABox Ai. Moreover, we assume a default
streamto-stream operator implemented into the CQL answering system and applied
directly after every window-to-stream operator, transforming dhti to (d; t)hti.</p>
      <p>The CQL query in the following listing is the unfolded pendant of the STARQL
query. The outer WHERE clause is the pendant of the monotonicity formula
expressed in the HAVING clause.</p>
      <p>CREATE VIEW windowRelation as
SELECT * FROM Msmt [ RANGE 2s Slide 1s ];
SELECT Rstream ( sensor , timestamp )
FROM windowRel , sensorRel
WHERE sensorRel . type = ’’ BurnerTipTempSens ’’ AND
NOT EXISTS (</p>
      <p>SELECT * FROM
( SELECT timestamp as i , value as x FROM windowRelation ) ,
( SELECT timestamp as j , value as y FROM windowRelation )
WHERE i &lt; j AND x &gt; y );
Experiments with our STARQL prototype (using a CQL like back end language)
show correctness and completeness for a representative set of STARQL queries.
Performance and scalability experiments are on our TODO list.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Related Work</title>
      <p>
        Much of the relevant work on stream processing has been done in the context of
data stream management systems (DSMSs), mainly with SQL-like stream query
languages such as CQL [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] or the ones used in TelegraphCQ [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], Aurora/Borealis
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], or PIPES [15]. Nevertheless, the stream community is far from having a
query standard for DSMS (see [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] for some ideas).
      </p>
      <p>
        First steps towards streamified OBDA are C-SPARQL [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], SPARQLstream
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and CQELS [18]. These approaches extend SPARQL with a window operator
whose content is a multi-set of variable bindings for the open variables in the
query. This solution is not without problems. It presupposes mixed interim states
in which the constraints/consequences of the ontologies are faded out. Moreover,
it does not adhere to the requirements of an orthogonal query language. Last
but not least, if one considers KBs that allow for the formulation of persistency
assumptions, then one has to keep track of the time points in the window.
      </p>
      <p>
        The semantical foundation of evaluating HAVING clauses is similar to that of
[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], one of the recent approaches to temporalizing OBDA. (Another one is [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]).
The difference is that [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] uses an LTL based language with embedded CQs not
a sorted FOL language. For engineering applications with information needs as
in the monotonicity example the LTL framework is not sufficient, as it does not
provide exists quantifier on top of the embedded CQs.
      </p>
      <p>
        Safety conditions are considered in the classical DB literature [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] but also
specifically for temporal DBs [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. We do not claim novelty w.r.t. safety aspects
but only w.r.t. the new adornment technique which directly operates on the FOL
formulas without transforming them to some normal form.
      </p>
      <p>
        Though not directly related to OBDA, other relevant work stems from the
field of complexed event processing. For example, EP-SPARQL/ETALIS [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] uses
also a sequencing constructor; and T-REX with the event specification language
TESLA [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] uses an FOL language for identifying patterns.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>The paper has presented a query framework lying in the intersection of
classical OBDA and stream processing. The query language (necessarily) extends the
sliding window concepts, which are known from many languages for relational
stream data management systems as well as recent systems for RDFS, with ABox
sequencing constructors. The advantage of using a sequence based methodology
over other approaches are, first, that the sequence sets up a (nearly) standard
context in which standard OBDA reasoning services can be applied, and second,
that the query language can be equipped with a neat semantics based on the
certain answer semantics for pure DL-Lite ABoxes (see [17]). Though the results
in this paper show that ABox sequencing w.r.t. the standard sequencing
strategy is syntactic sugar, it is not a redundant operator if non-standard sequencing
strategies are used. For example, in many cases one does not want to handle
(certain) answers over inconsistent ABoxes as these do not result in useful
information. Hence, a non-standard sequencing strategy would only build ABoxes
in the sequence that are consistent, so that only these are queried.</p>
      <p>STARQL’s combination of sufficient expressiveness on the conceptual level
with high expressiveness w.r.t. arithmetical, and statistical computations as well
as event specifications can be implemented in a safe manner in order to reach
domain independence. This lays the ground for a complete and correct
transformation to streaming query languages on the backend data sources.
15. Krämer, J., Seeger, B.: Semantics and implementation of continuous sliding window
queries over data streams. ACM Trans. Database Syst. 34(1), 1–49 (Apr 2009),
http://doi.acm.org/10.1145/1508857.1508861
16. Özçep, O.L., Möller, R., Neuenstadt, C.: Obda stream access combined with safe
first-order temporal reasoning. Technical report, Hamburg University of
Technology (2014)
17. Özçep, Ö.L., Möller, R., Neuenstadt, C., Zheleznyakov, D., Kharlamov, E.:
Deliverable D5.1 – a semantics for temporal and stream-based query answering in an
OBDA context. Deliverable FP7-318338, EU (October 2013)
18. Phuoc, D.L., Dao-Tran, M., Parreira, J.X., Hauswirth, M.: A native and adaptive
approach for unified processing of linked streams and linked data. In: International
Semantic Web Conference (1). pp. 370–388 (2011)</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abiteboul</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hull</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vianu</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          : Foundations of Databases. Addison-Wesley (
          <year>1995</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>Rudolph</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stojanovic</surname>
          </string-name>
          , N.:
          <article-title>Stream reasoning and complex event processing in etalis</article-title>
          .
          <source>Semantic Web</source>
          <volume>3</volume>
          (
          <issue>4</issue>
          ),
          <fpage>397</fpage>
          -
          <lpage>407</lpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Arasu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Babu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Widom</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>The CQL continuous query language: semantic foundations and query execution</article-title>
          .
          <source>The VLDB Journal 15</source>
          ,
          <fpage>121</fpage>
          -
          <lpage>142</lpage>
          (
          <year>2006</year>
          ), http: //dx.doi.org/10.1007/s00778-004-0147-z,
          <volume>10</volume>
          .1007/s00778-004-0147-z
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Artale</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kontchakov</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zakharyaschev</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Temporal description logic for ontology-based data access</article-title>
          .
          <source>In: Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence</source>
          . pp.
          <fpage>711</fpage>
          -
          <lpage>717</lpage>
          . IJCAI'13, AAAI Press (
          <year>2013</year>
          ), http://dl.acm.org/citation.cfm?id=
          <volume>2540128</volume>
          .
          <fpage>2540232</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Borgwardt</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , Lippmann,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Thost</surname>
          </string-name>
          ,
          <string-name>
            <surname>V.</surname>
          </string-name>
          :
          <article-title>Temporal query answering in the description logic dl-lite</article-title>
          . In: Fontaine,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Ringeissen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Schmidt</surname>
          </string-name>
          ,
          <string-name>
            <surname>R.A</surname>
          </string-name>
          . (eds.)
          <source>Frontiers of Combining Systems. LNCS</source>
          , vol.
          <volume>8152</volume>
          , pp.
          <fpage>165</fpage>
          -
          <lpage>180</lpage>
          . Springer Berlin Heidelberg (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gray</surname>
            ,
            <given-names>A.J.G.</given-names>
          </string-name>
          :
          <article-title>Enabling ontology-based access to streaming data sources</article-title>
          .
          <source>In: Proceedings of the 9th international semantic web conference on The semantic web - Volume Part I</source>
          . pp.
          <fpage>96</fpage>
          -
          <lpage>111</lpage>
          . ISWC'
          <volume>10</volume>
          , Springer-Verlag, Berlin, Heidelberg (
          <year>2010</year>
          ), http://dl.acm.org/citation.cfm? id=
          <volume>1940281</volume>
          .
          <fpage>1940289</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Calbimonte</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jeung</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corcho</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aberer</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Enabling query technologies for the semantic sensor web</article-title>
          .
          <source>Int. J. Semant. Web Inf. Syst</source>
          .
          <volume>8</volume>
          (
          <issue>1</issue>
          ),
          <fpage>43</fpage>
          -
          <lpage>63</lpage>
          (
          <year>Jan 2012</year>
          ), http://dx.doi.org/10.4018/jswis.2012010103
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Giacomo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lembo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Poggi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>RodríguezMuro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
          </string-name>
          , R.:
          <article-title>Ontologies and databases: The DL-Lite approach</article-title>
          . In: Tessaris,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Franconi</surname>
          </string-name>
          , E. (eds.)
          <source>Semantic Technologies for Informations Systems - 5th Int. Reasoning Web Summer School (RW</source>
          <year>2009</year>
          ),
          <source>Lecture Notes in Computer Science</source>
          , vol.
          <volume>5689</volume>
          , pp.
          <fpage>255</fpage>
          -
          <lpage>356</lpage>
          . Springer (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Chandrasekaran</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cooper</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Deshpande</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Franklin</surname>
            ,
            <given-names>M.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hellerstein</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hong</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krishnamurthy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Madden</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Raman</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reiss</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shah</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          :
          <article-title>Telegraphcq: Continuous dataflow processing for an uncertain world</article-title>
          .
          <source>In: CIDR</source>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Chomicki</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toman</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Temporal databases</article-title>
          .
          <source>In: Handbook of Temporal Reasoning in Artificial Intelligence</source>
          , vol.
          <volume>1</volume>
          , pp.
          <fpage>429</fpage>
          -
          <lpage>467</lpage>
          . Elsevier (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Cugola</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Margara</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Tesla: A formally defined event specification language</article-title>
          .
          <source>In: Proceedings of the Fourth ACM International Conference on Distributed EventBased Systems</source>
          . pp.
          <fpage>50</fpage>
          -
          <lpage>61</lpage>
          . DEBS '10,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          , New York, NY, USA (
          <year>2010</year>
          ), http: //doi.acm.
          <source>org/10</source>
          .1145/1827418.1827427
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>Della</given-names>
            <surname>Valle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Ceri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Barbieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Braga</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Campi</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>A first step towards stream reasoning</article-title>
          . In: Domingue,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Fensel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Traverso</surname>
          </string-name>
          , P. (eds.)
          <source>Future Internet - FIS 2008, Lecture Notes in Computer Science</source>
          , vol.
          <volume>5468</volume>
          , pp.
          <fpage>72</fpage>
          -
          <lpage>81</lpage>
          . Springer Berlin / Heidelberg (
          <year>2009</year>
          ), http://dx.doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -00985-
          <issue>3</issue>
          _
          <fpage>6</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Hwang</surname>
            ,
            <given-names>J.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xing</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Çetintemel</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zdonik</surname>
            ,
            <given-names>S.B.</given-names>
          </string-name>
          :
          <article-title>A cooperative, self-configuring high-availability solution for stream processing</article-title>
          .
          <source>In: ICDE</source>
          . pp.
          <fpage>176</fpage>
          -
          <lpage>185</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Jain</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mishra</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Srinivasan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gehrke</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Widom</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Balakrishnan</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Çetintemel</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cherniack</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tibbetts</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zdonik</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Towards a streaming sql standard</article-title>
          .
          <source>Proc. VLDB Endow</source>
          .
          <volume>1</volume>
          (
          <issue>2</issue>
          ),
          <fpage>1379</fpage>
          -
          <lpage>1390</lpage>
          (
          <year>Aug 2008</year>
          ), http://dl.acm.org/ citation.cfm?id=
          <volume>1454159</volume>
          .
          <fpage>1454179</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>