<!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>T-SPARQL: A TSQL2-Like Temporal Query Language for RDF</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Fabio Grandi</string-name>
          <email>fabio.grandi@unibo.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Alma Mater Studiorum - Universit`a di Bologna</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <fpage>21</fpage>
      <lpage>30</lpage>
      <abstract>
        <p>In this paper, we present a temporal extension of the SPARQL query language for RDF graphs. The new language is based on a temporal RDF database model employing triple timestamping with temporal elements, which best preserves the scalability property enjoyed by triple storage technologies, especially in a multi-temporal setting. The proposed SPARQL extensions are aimed at embedding several features of the TSQL2 consensual language designed for temporal relational databases.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        When an RDF graph [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], representing for instance the specification of an
ontology, is changed, some applications require the past version to be maintained
in addition to the new one. This is the case of the legal domain where ontologies
must evolve as a natural consequence of the dynamics involved in normative
systems [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Agents in such a domain may often have to deal with a past perspective,
like a Court having to judge today on a fact committed several years ago.
Moreover, several time dimensions are usually important for computer applications
in such domains [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        In the design of semantics based information systems, triple store technology
[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] based on the RDF data model is supposed to provide scalability for
querying and retrieval. Several temporal extensions of the RDF data model have been
proposed [
        <xref ref-type="bibr" rid="ref10 ref17 ref6">6, 10, 17</xref>
        ], often in conjunction with special index structures which
allow for efficient processing of temporal queries (e.g. tGRIN [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and keyTree [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]).
In order to preserve the scalability property of the triple storage approach as
much as possible also in the presence of temporal semantics, we introduced in
[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] a temporal RDF data model aimed at preventing the proliferation of
valueequivalent triples even in the presence of multiple temporal dimensions. In
particular, this has been accomplished through the adoption of temporal elements
[
        <xref ref-type="bibr" rid="ref2 ref7">2, 7</xref>
        ] as timestamps and a careful definition of the operational semantics of
modification statements.
      </p>
      <p>
        In this work, we complete the proposal in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] by introducing a temporal
extension of SPARQL [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] which can be used as query language for the temporal
data model of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The temporal extension is based on the lesson learned with
the design of the temporal query language TSQL2 [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], from which it inherits
part of the temporal expressiveness and user friendliness. The TSQL2 language
was born as a follow-up of the 1993 ARPA/NSF International Workshop on an
Infrastructure for Temporal Databases [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], after which Richard Snodgrass sent an
invitation to form a committee for the design of a consensual temporal extension
of the standard database query language SQL-92. The committee, gathering 18
people from the academic and industrial worlds, started its works in July 1993
and, after joint email discussions and voting on every aspect of the language,
produced a first draft in March 1994 [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. The final specification and language
commentaries appeared in a book published in 1995 [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] (for a more detailed
history, see http://www.cs.arizona.edu/people/rts/tsql2.html).
      </p>
      <p>The rest of paper is organized as follows. In Section 2, the main features
of the T-SPARQL query language are introduced and the TSQL2 heritage is
underlined. In Section 3, the use and functioning of the language is exemplified
through the presentation of a few temporal queries. Conclusions will be finally
found in Section 4.
2
2.1</p>
    </sec>
    <sec id="sec-2">
      <title>T-SPARQL Definition</title>
      <sec id="sec-2-1">
        <title>A multi-temporal RDF database model</title>
        <p>
          We briefly recall here the base definitions of the underlying multi-temporal RDF
database model [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], starting from an N -dimensional time domain
        </p>
        <p>
          T = T1 × T2 × · · · × TN
where Ti = [0, uc]i is the i-th time domain. Right-unlimited time intervals are
expressed as [t, uc], where uc means “Until Changed”, though such a symbol is
often used in temporal database literature [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] for transaction time only (whereas,
e.g. “forever” or ∞ is used for valid time). Such naming choice refers to the
modeling of time-varying data, which are potentially subject to change with
respect to all the underlying time dimensions.
        </p>
        <p>A multi-temporal RDF triple is defined as:</p>
        <p>
          (s, p, o | T )
where s is a subject, p is a property, o is an object and T ⊆ T is a timestamp
assigning a temporal pertinence to the RDF triple (s, p, o). We will also call the
(non-temporal) triple (s, p, o) the value or the contents of the temporal triple
(s, p, o | T ). The temporal pertinence of a triple is a subset of the
multidimensional time domain which is represented by a temporal element [
          <xref ref-type="bibr" rid="ref2 ref7">2, 7</xref>
          ], that is
a disjoint union of multidimensional temporal intervals, each one obtained as
the Cartesian product of one time interval for each of the supported temporal
dimensions:
        </p>
        <p>T =</p>
        <p>[
where the unioned N -dimensional intervals are all disjoint (i.e. Ij ∩ Ik = ∅ for
all 1 ≤ j &lt; k ≤ m).</p>
        <p>A multi-temporal RDF database is defined as a set of timestamped RDF
triples:</p>
        <p>RDF-TDB = { (s, p, o | T ) | T ⊆ T }
with the integrity constraint:</p>
        <p>∀(s, p, o | T ), (s0, p0, o0 | T 0) ∈ RDF-TDB: s = s0 ∧ p = p0 ∧ o = o0 =⇒ T = T 0
which requires that no value-equivalent distinct triples exist.</p>
        <p>
          The adoption of timestamps made-up of temporal elements instead of
(multitemporal) simple intervals avoids the duplication of triples in the presence of a
temporal pertinence with a complex shape. In fact, we store different triple
versions only once with a complex timestamp rather than storing multiple copies
of them with a simple timestamp as in [
          <xref ref-type="bibr" rid="ref10 ref17 ref6">6, 10, 17</xref>
          ]. The memory saving we obtain
grows with the dimensionality of the time domain, but it can even be appreciated
with a monodimensional time domain, when the temporal pertinence of a triple
is not a convex interval. For example, the temporal triples (s, p, o | [t1, t2]) and
(s, p, o | [t3, t4]), where t2 + 1 &lt; t3, can be merged with temporal element
timestamping into a single triple (s, p, o | [t1, t2] ∪ [t3, t4]). Whereas the same space
is basically required for globally storing the timestamps in both cases (i.e. the
space needed by four time points), the space required for storing one occurrence
of the triple contents (s, p, o) is saved in the latter case. Moreover, with element
timestamping, according to the integrity constraint introduced above, no two
temporal triples can have the same non-temporal contents and, thus, checking
of uniqueness and of functional properties constraints can be performed more
easily. As shown in [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], the semantics of modification operations can be defined
in such a way that the integrity constraints concerning temporal elements are
automatically preserved.
        </p>
        <p>
          The controlled growth of value-equivalent triples made possible by
temporal elements preserves, in a temporal setting, the scalability property of the
triple storage approach. Furthermore, since temporal elements are closed
under set union, intersection and complementation operations, they lead to query
languages that are more natural [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ].
2.2
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Time representation and manipulation</title>
        <p>
          As in the TSQL2 model, time is considered discrete, with a minimal
systemdependent representation unit called chronon [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. A mono-temporal chronon
corresponds to an elementary interval on the time axis, whereas a multi-temporal
chronon corresponds to a unit hypercube in the N -dimensional time domain
(Cartesian product of one chronon per each dimension). As for SQL-92, three
base temporal types have been defined for TSQL2 at the conceptual level:
datetime, period and interval. The first one corresponds to an instantaneous event,
without duration, which can be conventionally represented via a single chronon.
The second one correspond to a set of consecutive chronons along the time axis
and is characterized by two datetime constants which represent its boundaries.
The third corresponds to a pure duration, non anchored on the time axis, and
can be represented as a multiple of the chronon. Whereas the first and the third
temporal types correspond to the XML Schema primitive datatypes xs:dateTime
and xs:duration [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ], respectively, we assume for the second one a special data
type xs:period has been defined and a constructor function:
        </p>
        <p>fn:period($arg1 as xs:dateTime, $arg2 as xs:dateTime) as xs:period
is available to build a monodimensional time period from two xs:dateTime (or
xs:date or xs:time) values representing the period boundaries. However, for
the sake of simplicity, we will also use in the rest of the paper period literal
expressions like:</p>
        <p>"[2010-01-01,2010-01-31]"^^xs:period
as a shorthand for the use of the xs:period constructor like:</p>
        <p>fn:period("2010-01-01"^^xs:date, "2010-01-31"^^xs:date)
We further assume compatibility between the xs:period datatype and the
standard gYearMonth and gYear datatypes, which leads for example to the
equivalences:</p>
        <p>"[2010-01-01,2010-01-31]"^^xs:period = "2010-01"^^xs:gYearMonth
and:
and:</p>
        <p>"[2009-01-01,2009-12-31]"^^xs:period = "2009"^^xs:gYear
Like in TSQL2, the xs:period datatype is equipped with two built-in functions:
fn:begin($arg1 as xs:period) as xs:dateTime
fn:end($arg1 as xs:period) as xs:dateTime
to extract the left and right period boundaries, respectively. For instance:
fn:begin("[2010-01-01,2010-01-31]"^^xs:period) = "2010-01-01"^^xs:date
fn:end("2009"^^xs:gYear) = "2009-12-31"^^xs:date
Without entering into details, we assume a suitable datatype xs:temporalElement,
equipped with constructor and built-in functions, is available to manage
temporal elements. In particular, like in TSQL2, we consider the two built-in functions:
fn:first($arg1 as xs:temporalElement) as xs:period
fn:last($arg1 as xs:temporalElement) as xs:period
to have been defined to extract the first and last period from a monodimensional
temporal element, respectively. For instance:</p>
        <p>"[2008-06-01,2009-07-15]+[2009-11-01,2010-02-21]"
is a valid xs:temporalElement literal and</p>
        <p>fn:first("[2008-06-01,2009-07-15]+[2009-11-01,2010-02-21]")
yields "[2008-06-01,2009-07-15]"^^xs:period. In order to extract the first (last)
chronon of a temporal element, we assume that the fn:begin() (fn:end())
function can also be directly applied to temporal elements (e.g. if T is a temporal
element, fn:begin(T ) = fn:begin(fn:first(T ))).</p>
        <p>
          Other functions and operators defined for XQuery and XPath [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ] to
manipulate time and duration datatypes are assumed to be available. We further
assume that, as it happens for TSQL2, casting from another temporal datatype
to a duration can be used to calculate the overall duration of a time period or
element by means of, for instance, type constructor functions:
xs:duration($arg1 as xs:period) as xs:duration
xs:duration($arg1 as xs:temporalElement) as xs:duration
For example, the expression:
        </p>
        <p>xs:yearMonthDuration("[2009-02,2009-07]+[2009-11,2010-03]")
which can also be written using the explicit cast operator as:
"[2009-02,2009-07]+[2009-11,2010-03]"^^xs:temporalElement</p>
        <p>cast as xs:yearMonthDuration
yields 11 (months).</p>
        <p>The TSQL2 language, which is based on a bitemporal data model, provides
for functions to access the valid and transaction time components from a
timestamp. Likewise, we assume similar functions to be available also for T-SPARQL:
if T is a multi-dimensional time element, the expressions:</p>
        <p>VALID(T )</p>
        <p>
          TRANSACTION(T )
can thus be used to express conditions on the valid and transaction time
components of T , respectively. Similar functions can be defined for other time
dimensions in a multi-temporal setting (e.g. EFFICACY() for efficacy time [
          <xref ref-type="bibr" rid="ref3 ref5">3, 5</xref>
          ]).
Notice that such functions do not imply a projection onto the corresponding
time axis with reduction of dimensionality of the timestamp: all the conditions
expressed on different time dimensions are to be matched concurrently against
the same multi-dimensional intervals composing the temporal element. For
instance, if T = [
          <xref ref-type="bibr" rid="ref10">10, 20</xref>
          ]t × [30, 40]v ∪ [30, 40]t × [
          <xref ref-type="bibr" rid="ref10">10, 20</xref>
          ]v, then T does not qualify
for the selection condition 12 ∈ TRANSACTION(T ) ∧ 17 ∈ VALID(T ).
2.3
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>Temporal selection</title>
        <p>Temporal selection is the most qualifying feature of a temporal query language,
as it allows to select data on the basis of their temporal properties. In order
to add temporal selection capabilities to the SPARQL language, we extend the
syntax of the basic graph pattern in the WHERE clause of the SELECT statement.
As RDF triples are correspondingly augmented with the timestamp in the data
model, graph patterns to be used in the T-SPARQL WHERE clause are extended
with an optional fourth position where matching with the triple timestamps can
be specified. For instance, in the graph pattern</p>
        <p>
          :e ex:Dept "Toys" | ?t
the variable ?t binds to the timestamp of a temporal triple representing the fact
that an employee denoted by the blank node :e has been working in the Toys
department. This syntax, matching the (s, p, o | t) triple structure in the temporal
RDF data model, seems more natural than introducing a distinguished variable
type to denote timestamps (like in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]). If the fourth position (along with the ” | ”
separator) in the pattern is not used, that is a standard SPARQL three-position
pattern is used, the matching with a temporal triple is made regardless of its
timestamp.
        </p>
        <p>In the T-SPARQL FILTER clause, TSQL2 temporal (binary infix) predicates
can be used, with the same semantics, to specify constraints over timestamp
variables. For instance, the clause:</p>
        <p>FILTER ( VALID(?t) CONTAINS "2009-06-01"^^xs:date )
only matches the timestamps bound to ?t whose (valid time) value contains the
date 2009, June 1st. The available comparison operators are the following:
Operator Definition
A PRECEDES B END(A) is earlier than BEGIN(B)
A = B A and B are identical (i.e. contain the same chronons)
A OVERLAPS B the intersection of A and B is not empty
A MEETS B END(A ) immediately precedes BEGIN(B )
A CONTAINS B each chronon in B is also contained in A</p>
        <p>
          They can be used to compare (monodimensional) temporal elements, periods
and time points. Since all temporal types can be reduced to sets of chronons,
such operators can also be used to compare operands with different temporal
types [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]. For instance, if A is an element and B is a period, then the
expression “A PRECEDES B” is true if the last chronon belonging to A precedes the left
boundary of B. All the comparison operators can be implemented on the basis
of a primitive operator “Bef ore()” which defines the relation order on the time
axis. It can also be easily checked that such operators guarantee the temporal
completeness of the resulting language, as they allow users to check the
occurrence of all the possible relationships between two periods or events [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. Such
operator set has been chosen for TSQL2 also considering the user-friendliness
of the language among the design principle. This lead to a non minimal set of
comparison operators which are closer to their meaning in natural language than
the artificial definition of operators which equip other temporal languages (e.g.
based on Allen’s algebra [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]).
        </p>
        <p>The OVERLAPS and CONTAINS operators can also be defined to work on
multidimensional timestamps in a straightforward way.
2.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Temporal projection</title>
        <p>
          Temporal projection is the operation which specifies the value of the timestamps
to be assigned to the retrieved data. TSQL2 supports a VALID clause to specify
valid-time projection, as the transaction time assigned to query results is always
the current time and cannot be changed by the user. In T-SPARQL, temporal
projection is only relevant where the query result has to be a temporal RDF
graph consistent with the underlying data model. Otherwise, temporal data can
simply be mixed with other data by putting temporal variables in the target list
(e.g. see the first example in the next section). In the former case, the basic and
most important operation is the construction of a new (temporal) RDF graph as
a temporally consistent subset extracted from the multi-version RDF database,
which takes the form of a snapshot query or timeslice query [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
        </p>
        <p>Snapshot queries are used to extract a single temporal version from a
multiversion RDF graph. For instance, if the temporal RDF database encodes the
definition of a multi-version ontology, the result of a snapshot query is a
standard (non-temporal) RDF graph, which can be interpreted as a consistent single
ontology version valid at a given time point. Given a multidimensional time point
t¯ = (t1, t2, . . . , tN ) ∈ T , we can define the snapshot valid at t¯ as:
In T-SPARQL, the snapshot query above could be expressed via the following
statement:</p>
        <p>CONSTRUCT { ?s ?p ?o }
WHERE { TGRAPH &lt;http://myExample.org/tGraph&gt; { ?s ?p ?o | ?t } .</p>
        <p>FILTER ?t CONTAINS "(t1, t2, . . . , tN )" . }
where the URI http://myExample.org/tGraph denotes a multi-temporal RDF
triple store. The results make up a non temporal RDF graph.</p>
        <p>Timeslice queries are used to extract a temporally consistent set of
consecutive temporal versions from a multi-version RDF graph. If the temporal RDF
database encodes the definition of a multi-version ontology, the result of a
timeslice query is a temporal RDF graph, which can be interpreted as the collection
of all the temporally consistent ontology versions valid in a given period. Given
a multi-dimensional time period I¯ = I1 × I2 × · · · × IN ⊆ T , we can define the
timeslice valid in I¯ as:</p>
        <p>RDF-TDB(I¯) = { (s, p, o | T 0) | (s, p, o | T ) ∈ RDF-TDB ∧ T 0 = T ∩ I¯ 6= ∅}
In T-SPARQL, the snapshot query above could be expressed by means of the
statement which follows:</p>
        <p>TCONSTRUCT { ?s ?p ?o | INTERSECT( ?t, "I1 × I2 × · · · × IN " ) . }
WHERE { TGRAPH &lt;http://myExample.org/tGraph&gt; { ?s ?p ?o | ?t } }
The timestamps assigned to the triples in the result are computed as the
intersection of the timestamp of the retrieved triples with the query period I¯. If the
intersection is empty, the triple does not contribute to the results (and, thus, no
additional temporal selection conditions are required in the WHERE clause).</p>
        <p>Within the WHERE clause that can be added to such CONSTRUCT or TCONSTRUCT
statements, temporal and non-temporal selection (via graph pattern matching)
can be combined with temporal projection in a single statement.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Query Examples</title>
      <p>Due to space limitations, the syntax and semantics of the T-SPARQL language
is just illustrated by means of a few example queries shown in this section. We
assume that ex: is a prefix referencing a namespace involving the definition of
employee data:</p>
      <p>@prefix ex: &lt;http://myExample.org/employee/&gt; .</p>
      <p>The following is an example of query involving both temporal selection and
projection, although the result is not organized as a temporal RDF graph:
SELECT ?salary INTERSECT(?t,"[2007-01-01,2009-12-31]") WHERE {
?emp rdf:type ex:emp ;
ex:Name "Tom" ;
ex:Salary ?salary | ?t .</p>
      <p>FILTER ( VALID(?t) OVERLAPS "[2007-01-01,2009-12-31]"^^xs:period ) . }</p>
      <p>The (current) history of the the Tom’s salary from 2007 to 2009 is
retrieved. Following the same rule of TSQL2, a default TRANSACTION(?t) CONTAINS
fn:current- date() conjunct in the FILTER clause is implied and, thus, can always
be omitted when we are interested in current data. Indeed, an explicit condition
involving transaction time must be specified when we want to roll-back the RDF
database to a past point in time, as in the query:</p>
      <p>SELECT ?salary INTERSECT(?t,"[2007-01-01,2009-12-31]") WHERE {
?emp rdf:type ex:emp ;
ex:Name "Tom" ;
ex:Salary ?salary | ?t .</p>
      <p>FILTER ( VALID(?t) OVERLAPS "[2007-01-01,2009-12-31]"^^xs:period
&amp;&amp; TRANSACTION(?t) CONTAINS "2008-01-01"^^xs:date ) . }
which retrieves the history of the the Tom’s salary from 2007 to 2009, as of the
beginning of 2008.</p>
      <p>The query which follows, which retrieves the name of the employees who have
worked in the Toys department longer than Ann has made $20,000, performs a
sort of temporal join involving durations between two employees’ data:
SELECT ?ename WHERE {
?emp1 rdf:type ex:emp ;
ex:Name "Ann" ;
ex:Salary ?salary | ?ts .
?emp2 rdf:type ex:emp ;
ex:Name ?ename ;
ex:Dept "Toys" | ?tt .</p>
      <p>FILTER ( ?salary &gt; 20000</p>
      <p>&amp;&amp; xs:duration(VALID(?tt)) &gt; xs:duration(VALID(?ts)) ) . }</p>
      <p>
        An optional modifier PERIOD, which corresponds to the partitioning unit which
can be associated to tuple variables in the FROM clause of TSQL2 [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], can be
specified in the declaration of temporal variables. When used, the timestamp
bound to the variable is partitioned into maximal periods over which the variable
ranges, yielding triple timestamping with periods. As many queries are interested
in maximal periods, being able to partition a temporal element into such periods
is highly useful. For instance, the query:
      </p>
      <sec id="sec-3-1">
        <title>SELECT ?ename WHERE {</title>
        <p>?emp rdf:type ex:emp ;
ex:Name ?ename ;
ex:Dept "Sales" | ?t .</p>
        <p>FILTER ( xs:duration(VALID(?t)) &gt; "P2Y"^^xs:duration ) . }
which retrieves the names of the employees who worked in the Sales department
for more than two years (altogether), can be modified as follows:</p>
      </sec>
      <sec id="sec-3-2">
        <title>SELECT ?ename WHERE {</title>
        <p>?emp rdf:type ex:emp ;
ex:Name ?ename ;
ex:Dept "Sales" | ?t PERIOD .</p>
        <p>FILTER ( xs:duration(VALID(?t)) &gt; "P2Y"^^xs:duration ) . }
to retrieve the names of the employees who worked continuously in the Sales
department for a period longer than two years. Hence an employee who worked
in the Sales department from January 2006 to July 2007 and from March 2009
to April 2010 qualifies for the former query but not for the latter, since he/she
worked in Sales for 20 months altogether but at most for 17 consecutive months.
This powerful tool also allows us to reference consecutive periods within the
same data history as in the following query:</p>
      </sec>
      <sec id="sec-3-3">
        <title>SELECT ?ename ?job WHERE {</title>
        <p>?emp rdf:type ex:emp ;
ex:Name ?ename ;
ex:Job ?job | ?t1 PERIOD ;
ex:Job "Director" | ?t2 PERIOD ;
ex:Job ?job | ?t3 PERIOD .</p>
        <p>FILTER ( VALID(?t1) MEETS VALID(?t2)</p>
        <p>&amp;&amp; VALID(?t2) MEETS VALID(?t3) ) . }
which retrieves the name of the employees who returned to their previous job
(which is also retrieved) after having been directors for some time.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>
        In this paper, we presented T-SPARQL, a temporal SPARQL extension suited to
the temporal RDF database model employing triple timestamping with temporal
elements introduced in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], which best preserves in the multi-temporal setting
the scalability property enjoyed by triple storage technologies.
      </p>
      <p>
        The language T-SPARQL is equipped with the basic temporal constructs
which have been designed for the well-known TSQL2 relational query language
[
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and work with an extended set of the temporal datatypes, functions and
operators already present in the SPARQL specification [
        <xref ref-type="bibr" rid="ref16 ref18 ref19">16, 18, 19</xref>
        ]. Advanced
TSQL2 features (e.g. involving temporal aggregates, granularities,
indeterminacy) could also easily be added to the T-SPARQL specification, provided that
they can be supported by an underlying query engine.
      </p>
      <p>In future research, we will consider the design and implementation of a query
engine supporting the execution of T-SPARQL queries (possibly via the
extension of a canonical SPARQL engine) and the adoption of suitable index and
storage structures to facilitate the execution of T-SPARQL queries on temporal
RDF graphs.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J.F.</given-names>
            <surname>Allen</surname>
          </string-name>
          .
          <article-title>Maintaining Knowledge about Temporal Intervals</article-title>
          ,
          <source>Communications of the ACM</source>
          ,
          <volume>26</volume>
          (
          <issue>11</issue>
          ):
          <fpage>832</fpage>
          -
          <lpage>843</lpage>
          ,
          <year>1983</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>S.</given-names>
            <surname>Gadia</surname>
          </string-name>
          .
          <article-title>A homogeneous relational model and query language for temporal databases</article-title>
          ,
          <source>ACM Transactions on Database Systems</source>
          ,
          <volume>13</volume>
          (
          <issue>3</issue>
          ):
          <fpage>418</fpage>
          -
          <lpage>448</lpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Mandreoli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Tiberio</surname>
          </string-name>
          .
          <article-title>Temporal modelling of normative documents in XML format</article-title>
          .
          <source>Data &amp; Knowledge Engineering</source>
          ,
          <volume>54</volume>
          :
          <fpage>327</fpage>
          -
          <lpage>354</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.R.</given-names>
            <surname>Scalas</surname>
          </string-name>
          .
          <article-title>The Valid Ontology: A simple OWL temporal versioning framework</article-title>
          .
          <source>In Proc. of SEMAPRO Conf.. IEEE Computer Society</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          <article-title>. Multi-temporal RDF Ontology Versioning</article-title>
          .
          <source>In Proc. of IWOD Workshop. CEUR-WS</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C.</given-names>
            <surname>Gutierrez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Hurtado</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Vaisman</surname>
          </string-name>
          .
          <article-title>Introducing time into RDF</article-title>
          .
          <source>IEEE Transactions on Knowledge and Data Engineering</source>
          ,
          <volume>19</volume>
          (
          <issue>2</issue>
          ):
          <fpage>207</fpage>
          -
          <lpage>218</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>C.S.</given-names>
            <surname>Jensen</surname>
          </string-name>
          , C.E. Dyreson (eds.),
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>B¨ohlen</article-title>
          , J. Clifford,
          <string-name>
            <given-names>R.</given-names>
            <surname>Elmasri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.K.</given-names>
            <surname>Gadia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Hayes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Jajodia</surname>
          </string-name>
          ,
          <string-name>
            <surname>W.</surname>
          </string-name>
          <article-title>K¨afer</article-title>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Kline</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Lorentzos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Mitsopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Nonen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Peressi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Pernici</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.F.</given-names>
            <surname>Roddick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.L.</given-names>
            <surname>Sarda</surname>
          </string-name>
          ,
          <string-name>
            <surname>M R. Scalas</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Segev</surname>
            , R.T. Snodgrass,
            <given-names>M.D.</given-names>
          </string-name>
          <string-name>
            <surname>Soo</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Tansel</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Tiberio</surname>
            , and
            <given-names>G. Wiederhold.</given-names>
          </string-name>
          <article-title>The consensus glossary of temporal database concepts - February 1998 version</article-title>
          . In O. Etzion,
          <string-name>
            <given-names>S.</given-names>
            <surname>Jajodia</surname>
          </string-name>
          , and S. Sripada, editors,
          <source>Temporal Databases - Research and Practice</source>
          . Springer-Verlag,
          <year>1998</year>
          . LNCS No.
          <volume>1399</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>M.</given-names>
            <surname>Perry</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.P.</given-names>
            <surname>Sheth</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Jain.</surname>
          </string-name>
          SPARQL-ST:
          <article-title>Extending SPARQL to Support Spatiotemporal Queries</article-title>
          .
          <source>Tech.Rep. KNOESIS-TR-09-01</source>
          . Kno.e.sis Center, http: //knoesis.org/students/prateek/sparql
          <article-title>-st-www09-tr</article-title>
          .pdf
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>N.</given-names>
            <surname>Pissinou</surname>
          </string-name>
          , R.T. Snodgrass,
          <string-name>
            <given-names>R.</given-names>
            <surname>Elmasri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.S.</given-names>
            <surname>Mumick</surname>
          </string-name>
          , M.T. O¨ zsu,
          <string-name>
            <given-names>B.</given-names>
            <surname>Pernici</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Segev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Theodoulidis</surname>
          </string-name>
          and
          <string-name>
            <given-names>U.</given-names>
            <surname>Dayal</surname>
          </string-name>
          .
          <source>Towards an Infrastructure for temporal Databases: Report of an Invitational ARPA/NSF Workshop. ACM SIGMOD Record</source>
          <volume>23</volume>
          (
          <issue>1</issue>
          ):
          <fpage>35</fpage>
          -
          <lpage>51</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>A.</given-names>
            <surname>Pugliese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Udrea</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V.S.</given-names>
            <surname>Subrahmanian</surname>
          </string-name>
          .
          <article-title>Scaling RDF with Time</article-title>
          .
          <source>In Proc. of WWW Conf.. ACM Press</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <article-title>Resource description framework</article-title>
          .
          <source>W3C Consortium</source>
          , http://www.w3.org/RDF/.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>K.</given-names>
            <surname>Rohloff</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Emmons</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ryder</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Summer</surname>
          </string-name>
          .
          <article-title>An evaluation of triplestore technologies for large data stores</article-title>
          .
          <source>In Proc. of OTM Workshops. SpringerVerlag</source>
          ,
          <year>2007</year>
          . LNCS No.
          <volume>4806</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. R.T. Snodgrass, I. Ahn,
          <string-name>
            <given-names>G.</given-names>
            <surname>Ariav</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.S.</given-names>
            <surname>Batory</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Clifford</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.E.</given-names>
            <surname>Dyreson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Elmasri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.S.</given-names>
            <surname>Jensen</surname>
          </string-name>
          ,
          <string-name>
            <surname>W.</surname>
          </string-name>
          <article-title>K¨afer</article-title>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Kline</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kulkarni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.Y.C.</given-names>
            <surname>Leung</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Lorentzos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.F.</given-names>
            <surname>Roddick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Segev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.D.</given-names>
            <surname>Soo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.M.</given-names>
            <surname>Sripada. TSQL2 Language</surname>
          </string-name>
          <article-title>Specification</article-title>
          .
          <source>ACM SIGMOD Record</source>
          <volume>23</volume>
          (
          <issue>1</issue>
          ):
          <fpage>65</fpage>
          -
          <lpage>86</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. R.T. Snodgrass (ed.), I. Ahn,
          <string-name>
            <given-names>G.</given-names>
            <surname>Ariav</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Batory</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Clifford</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.E.</given-names>
            <surname>Dyreson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Elmasri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.S.</given-names>
            <surname>Jensen</surname>
          </string-name>
          ,
          <string-name>
            <surname>W.</surname>
          </string-name>
          <article-title>K¨afer</article-title>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Kline</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kulkarni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.Y.</given-names>
            <surname>Cliff Leung</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Lorentzos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Ramakrishnan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.F.</given-names>
            <surname>Roddick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Segev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.D.</given-names>
            <surname>Soo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.M.</given-names>
            <surname>Sripada</surname>
          </string-name>
          .
          <article-title>The TSQL2 Temporal Query Language</article-title>
          . Kluwer Academic Publishers,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. R.T. Snodgrass,
          <string-name>
            <given-names>C.S.</given-names>
            <surname>Jensen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Grandi</surname>
          </string-name>
          .
          <article-title>The From Clause</article-title>
          . In [14], Ch.
          <volume>12</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <article-title>SPARQL query language for RDF</article-title>
          .
          <source>W3C Consortium</source>
          , http://www.w3.org/TR/ rdf-sparql-query/.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>J. Tappolet</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Bernstein</surname>
          </string-name>
          . Applied temporal RDF:
          <article-title>Efficient temporal querying of RDF data with SPARQL</article-title>
          .
          <source>In Proc. of ESWC Conf</source>
          .. Springer-Verlag,
          <year>2009</year>
          . LNCS No.
          <volume>5554</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>XML</given-names>
            <surname>Schema</surname>
          </string-name>
          <article-title>Part 2: Datatypes</article-title>
          . W3C Consortium, http://www.w3.org/TR/ xmlschema-2/.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <article-title>XQuery 1.0 and XPath 2.0 Functions and Operators</article-title>
          .
          <source>W3C Consortium</source>
          , http: //www.w3.org/TR/xpath-functions/.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>