Abstract
Now-relative temporal data play an important role in most temporal applications, and their management has been proved to impact in a crucial way the efficiency of temporal databases. Though several temporal relational approaches have been developed to deal with now-relative data, none of them has provided a whole temporal algebra to query them. In this paper we overcome such a limitation, by proposing a general algebra which is parametrically adapted to cope with the relational approaches to now-relative data in the literature, i.e., MIN, MAX, NULL and POINT approaches. Besides being general enough to provide a query language for several approaches in the literature, our algebra has been designed in such a way to satisfy several theoretical and practical desiderata: closure with respect to representation languages, correctness with respect to the “consensus” BCDM semantics, reducibility to the standard non-temporal algebra (which involves interoperability with non-temporal relational databases), implementability and efficiency. Indeed, the experimental evaluation we have drawn on our implementation has shown that only a slight overhead is added by our treatment of now-relative data (with respect to an approach in which such data are not present).
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10844-013-0245-8/MediaObjects/10844_2013_245_Fig1_HTML.gif)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10844-013-0245-8/MediaObjects/10844_2013_245_Fig2_HTML.gif)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10844-013-0245-8/MediaObjects/10844_2013_245_Fig3_HTML.gif)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10844-013-0245-8/MediaObjects/10844_2013_245_Fig4_HTML.gif)
Similar content being viewed by others
References
Agesen, M., Bohlen, M., Poulsen, L., Torp, K. (2001). A split operator for now-relative bitemporal databases. In Proceedings of the 17th international conference on data engineering, 2001 (pp. 41–50).
Bohlen, M.H., Snodgrass, R.T., Soo, M.D. (1996). Coalescing in Temporal Databases. In Proceedings of the 22nd VLDB conf (pp. 180–190).
Clifford, J., Dyreson, C., Isakowitz, T., Jensen, C.S., Snodgrass, R.T. (1997). On the semantics of “Now” in databases. ACM Transactions on Database Systems (TODS), 22(2), 171–214.
Codd, E.F. (1972). Relational completeness of data base sublanguages. In R. Rustin (Ed.), Database systems (pp. 65–98). San Jose: Prentice Hall and IBM Research Report RJ 987.
Creem, K.N. (2005). A comparison of approaches to modeling now in bitemporal databases. In Proceedings of the 21st computer science seminar. Hartford, USA.
Dyreson, C.E. (2003). Temporal coalescing with now granularity, and incomplete information. In Proceedings of the 2003 ACM SIGMOD international conference on management of data, SIGMOD ’03 (pp. 169–180). New York: ACM.
Dyreson, C.E., Jensen, C.S., Snodgrass, R.T. (2009). Now in temporal databases. In L. Liu, & M. Özsu (Eds.), Encyclopedia of database systems (pp. 1920–1924). USA: Springer.
Fenk, R., Markl, V., Bayer, R. (2002). Interval processing with the UB-tree. In Proceedings of the 2002 international symposium on database engineering and applications (pp. 12–22).
Franzblau, D.S., & Xenakis, G. (2008). An algorithm for the difference between set covers. Discrete Applied Mathematics, 156(10), 1623–1632.
Hellerstein, J., Koutsupias, E., Papadimitriou, C. (1997). On the analysis of indexing schemes. In Proceedings of the 16th ACM SIGACT-SIGMOD-SIGART symposium on principles of database systems.
Jensen, C.S., & Lomet, D.B. (2001). Transaction timestam** in (temporal) databases. In Proceedings of the international conference on very large data bases (pp. 441–450).
Jensen, C.S., & Snodgrass, R.T. (1996). Semantics of time-varying information. Information Systems, 21(4):311–352.
Jensen, C.S., & Snodgrass, R. (1999). Temporal data management. IEEE Transactions on Knowledge and Data Engineering, 11(1), 36–44.
Kriegel, H., Pötke, M., Seidl, T. (2000). Managing intervals efficiently in object-relational databases. In Proceedings of the 26th international conference on very large databases (pp. 407–418).
Liu, L., & M.T. Özsu (eds) (2009). Encyclopedia of Database Systems. USA: Springer.
Lomet, D., Hong, M., Nehme, R., Zhang, R. (2008). Transaction time indexing with version compression. Proceedings of the VLDB Endowment, 1(1), 870–881.
Mao, C., Ma, H., Tang, Y., Yao, L. (2011). Temporal data model and temporal database systems. In Y. Tang, X. Ye, N. Tang (Eds.), Temporal information processing technology and its application (pp. 69–89). Berlin, Heidelberg: Springer.
Melton, J., & Simon, A.R. (2002). SQL:1999—Understanding relational language components. San Mateo: Morgan Kaufmann.
McKenzie, J.L.E., & Snodgrass, R.T. (1991). Evaluation of relational algebras incorporating the time dimension in databases. ACM Computing Surveys (CSUR), 23(4), 501–543.
Nguyen-Dinh, L.-V., Aref, W.G., Mokbel, M.F. (2010). Spatio-temporal access methods: part 2 (2003—2010). IEEE Data Engineering Bulletin, 33(2), 46–55.
Ozsoyoglu, G., & Snodgrass, R. (1995). Temporal and real-time databases: a survey. IEEE Transations on Knowlege and Data Engineering, 7(4), 513–532.
Šaltenis, S., & Jensen, C.S. (2002). Indexing of now-relative spatio-bitemporal data. VLDB Journal, 11(1), 1–16.
Shichao Zhang, C.Z., & Qin, Z. (2003). Modeling temporal semantics of data. Asian Journal of Information Technology, 2(1), 25–35.
Snodgrass, R.T. (1995). The TSQL2 temporal query language. Kluwer Academic.
Stantic, B., Sattar, A., Terenziani, P. (2009). The point approach to represent it now in bitemporal databases. Journal of Intelligent Information Systems, 32(3), 297–323.
Stantic, B., Terry, J., Topor, R.W., Sattar, A. (2010). Indexing temporal data with virtual structure. In Advances in databases and information systems—ADBIS (pp. 591–594).
Stantic, B., Thornton, J., Sattar, A. (2003). A novel approach to model NOW in temporal databases. In Proceeding of the 10th international symposium on temporal representation and reasoning (TIME-ICTL 2003) (pp. 174–181). Cairns.
Stantic, B., Topor, R.W., Terry, J., Sattar, A. (2010). Advanced indexing technique for temporal data. Computer Science and Information Systems, 7(4), 679–703.
Tansel, A.U., Clifford, J., Gadia, S., Jajodia, S., Segev, A., Snodgrass, R. (Eds.) (1993). Temporal databases: theory, design, and implementation. Redwood City: Benjamin-Cummings.
Torp, K., Jensen, C.S., Bohlen, M. (1999). Layered implementation of temporal DBMS concepts and techniques. A TimeCenter Technical Report TR-2.
Torp, K., Jensen, C.S., Böhlen, M.H. (1997). Layered temporal dbms: concepts and techniques. In Proceedings of the 5th international conference on database systems for advanced applications (DASFAA) (pp. 371–380). Singapore: World Scientific.
Torp, K., Jensen, C.S., Snodgrass, R.T. (2000). Effective timestam** in databases. VLDB Journal: Very Large Data Bases, 8(3–4), 267–288.
Torp, K., Jensen, C.S., Snodgrass, R.T. (2004). Modification semantics in now-relative databases. Information Systems, 29(8), 653–683.
Tsotras, V., & Kumar, A. (1996). Temporal database bibliography update. ACM Sigmod Record, 25(1), 41–51.
Author information
Authors and Affiliations
Corresponding author
Appendix
Appendix
Property 2
(Correctness of the MIN, MAX, NULL and POINT algebrae) The MIN, MAX, NULL and POINT algebrae are correct, since they provide (in the MIN, MAX, NULL and POINT representations) all and only the results that would be obtained by the underlying BCDM semantic approach.
Proof
The correctness of the MIN, MAX, NULL and POINT algebrae is proved by showing that, given the relations r N and s N and any binary operator Op N in the MIN, MAX, NULL or POINT approaches (the proof is analogous when considering unary operators), the application of the operator in MIN, MAX, NULL or POINT algebrae gives a result equivalent to the application of the corresponding operator in the BCDM algebra (indicated by Op B):
We prove the result for the operation of Cartesian product by proving the two inclusions, that is we prove that:
and
Let x be a BCDM tuple in \(to\_BCDM^{c_{\rm NOW}}(r^N \times^N s^N)\) and let R = (A 1, ..., A a , B 1, ..., B b |T) be the schema of \(to\_BCDM^{c_{\rm NOW}}(r^N \times^N s^N)\). We denote as A the attributes A 1, ..., A a and as B the attributes B 1, ..., B b . Then, by the definition of the \(to\_BCDM^{c_{\rm NOW}}\) function, there exists a maximal set of (possibly now-relative) tuples {y 0, y 1, ..., y k } in r N ×N s N (k ≥ 0) such that x[AB] = y 0[AB] = ... = y k [AB] and that, considering the rectangles resulting from the extension of their timestamps (with now = c NOW), their union corresponds to x[T], i.e., \(x[T] = EXT^{c_{\rm NOW}}(y_0[T]) \cup \ldots \cup EXT^{c_{\rm NOW}}(y_k[T])\). If such tuples {y 0, y 1, ..., y k } belongs to r N ×s N, by the definition of ×N, for each y i ∈ {y 0, y 1, ..., y k } there must be a tuple \({w}_{i'}' \in r^N\) and a tuple \({w}_{i''}'' \in s^N\) such that x[A] = y i [A] = w i′′[A], x[B] = y i [B] = w i′′′′[B] and the bitemporal chronons of y i correspond to the intersection of the bitemporal chronons of w i′′ and w i′′′′, i.e.:
In the following, let {w 1′, ..., w l ′} and {w 1′′, ..., w m ′′} the sets of all and only the tuples in r N and in s N respectively that generate the above tuples {y 0, y 1, ..., y k }.
Let us consider the tuples w 1′, ..., w l ′ in r N. Applying the to_BCDM function, since these tuples have the same values for the explicit attributes, by definition of to_BCDM, to_BCDM returns one BCDM tuple y ∈ to_BCDM(r N) such that:
and
If we consider the tuples \(\emph{w}_1'', \ldots, \emph{w}_m''\) in s N, the function to_BCDM returns one BCDM tuple z ∈ to_BCDM(s N) such that:
and
Applying the ×B operator to y and z, by definition of the operator, we obtain a relation on schema R(AB |T) containing a tuple \(x' \in to\_BCDM^{c_{\rm NOW}}(r^N) \times^B to\_BCDM^{c_{\rm NOW}}(s^N)\) such that x′[A] = y[A] = x[A] and x′[B] = z[B] = x[B] and:
For the distributive property of intersection over union:
Since by construction {w 1′, ..., w l ′} and {w 1′′, ..., w m ′′} are all and only the tuples that generates {y 0, y 1, ..., y k }, i.e., such that for each i, 0 ≤ i ≤ k, x[A] = y i [A] = w i′′[A], x[B] = y i [B] = w i′′′′[B] and \(EXT^{c_{\rm NOW}}({w}'_{i'}) \cap EXT^{c_{\rm NOW}}({w}''_{i''}) = EXT^{c_{\rm NOW}}(y_i[T])\), we have that, \(x'[T] = EXT^{c_{\rm NOW}}(y_1[T]) \cup \ldots \cup EXT^{c_{\rm NOW}}(y_k[T]) = x[T]\). Therefore, x = x′.
Now we prove the other direction of the inclusion.
Let x′ be a BCDM tuple in \(to\_BCDM^{c_{\rm NOW}}(r^N) \times^B to\_BCDM^{c_{\rm NOW}}(s^N)\). By definition of the ×B operator, there exist a tuple \(y \in to\_BCDM^{c_{\rm NOW}}(r^N)\) and a tuple \(z \in to\_BCDM^{c_{\rm NOW}}(s^N)\) such that x′[A] = y[A], x′[B] = z[B] and x′[T] = y[T] ∩ z[T] ≠ ∅.
By definition of to_BCDM function, if \(y \in to\_BCDM^{c_{\rm NOW}}(r^N)\) then there exists a (maximal) set of (possibly now-relative) tuples {w′0, ..., w′ l } that are in r N such that y[A] = w′0[A] = ... = w′ l [A] and \(y[T] = EXT^{c_{\rm NOW}}({w}'_0[T]) \cup \ldots \cup EXT^{c_{\rm NOW}}({w}'_l[T])\).
The same holds for z: there exists a (maximal) set of (possibly now-relative) tuples {w′′0, ..., w′′ m } that are in s N such that z[A] = w′′0[A] = ... = w′′ m [A] and \(z[T]=EXT^{c_{\rm NOW}}({w}''_0[T]) \cup \ldots \cup EXT^{c_{\rm NOW}}({w}''_m[T])\).
If we apply the ×N operator to r N and s N, because \(\{{w}'_0, \ldots, {w}'_l\} \subseteq r^N\) and \(\{{w}''_0, \ldots, {w}''_m\} \subseteq s^N\), we obtain, among the other tuples, a set of (possibly now-relative) tuples {y 1, ..., y k } such that y i [A] = w′ i′[A], y i [B] = w′′ i′′[B] and:
Because w′ i′[A] = y[A] and w′′ i′′[B] = z[B], the to_BCDM function coalesces these tuples in one BCDM tuple x such that:
and \(x[T]~=~EXT^{c_{\rm NOW}}(y_0[T])~ \cup~\ldots~\cup~EXT^{c_{\rm NOW}}(y_k[T])\).
Since for each i, 0 ≤ i ≤ k:
For the distributive property of union of sets over intersection of sets,
Since y[T] = \(EXT^{c_{\rm NOW}}({w}'_0[T])\) ∪ ... ∪ \(EXT^{c_{\rm NOW}}({w}'_l[T])\) and z[T] = \(EXT^{c_{\rm NOW}}\) (w′′0[T]) ∪ ... ∪ \(EXT^{c_{\rm NOW}}({w}''_m[T])\), we have that x[T] = y[T] ∩ z[T] = x′[T]. Therefore, x = x′.
The proof for the other operators is similar.□
Property 3
(Reducibility of MIN, MAX, NULL and POINT algebrae to the standard (non-temporal) algebra) The MIN, MAX, NULL and POINT algebrae reduce to the standard algebra, i.e., the non-temporal relation obtained by applying extended temporal operators to temporal relations and then taking a snapshot is equivalent to the standard (non-temporal) relation obtained by first taking a snapshot of the temporal relations and then applying a standard (non-temporal) operator.
More formally, let r N and s N be bitemporal relations defined over a schema \(R^N = (A_1, \ldots, A_n \mid TT_S, TT_E, VT_S, VT_E)\), c T an arbitrary time value not exceeding current time and c V an arbitrary time value, \(\rho_{c_T}(\tau_{c_V}(r^N Op^N s^N)) = \rho_{c_T}(\tau_{c_V}(r^N)) Op^S \rho_{c_T}(\tau_{c_V}(s^N))\), where Op N is a temporal operator and Op S is a standard (non-temporal) operator. The statement is analogous for unary operators.
Proof
We prove the property for the operator of Cartesian product. The proofs for the other operators are analogous.
The equivalence is proved by proving the two inclusions.
First we prove that \(\rho_{c_T}(\tau_{c_V}(r^N~\times^N~ s^N))~\subseteq~\rho_{c_T}(\tau_{c_V}(r^N))~\times^S~\rho_{c_T}(\tau_{c_V}(s^N))\).
Let R = (A 1, ..., A a , B 1, ..., B b |TT S , TT E , VT S , VT E ) be the schema of r N ×N s N. We denote as A the attributes A 1, ..., A a and as B the attributes B 1, ..., B b . Let \(x \in \rho_{c_T}(\tau_{c_V}(r^N \times^N s^N))\). Then, by definition of slice operators, there is a tuple x′ ∈ r N ×s N such that x′[AB] = x[AB] and \((c_T, c_V) \in EXT^{c_{\rm NOW}}((r^N \times\) N s N)[T]). Therefore, by definition of the ×N, there exist a tuple y ∈ r N and a tuple z ∈ s N such that y[A] = x′[A], z[B] = x′[B], \((c_T, c_V) \in EXT^{c_{\rm NOW}}(y[T])\) and \((c_T, c_V) \in EXT^{c_{\rm NOW}}(z[T])\).
Therefore, by definition of slice operators, there exist a tuple \(w' \in \rho_{c_T}(\tau_{c_V}(r^N))\) and a tuple \({w}'' \in \rho_{c_T}(\tau_{c_V}(s^N))\) such that w′ = y[A] = x′[A] and w′′ = z[B] = x′[B].
By definition of standard Cartesian product, there exists a tuple \(x'' \in \rho_{c_T}(\tau_{c_V}(r^N)) \times^S \rho_{c_T}(\tau_{c_V}(s^N))\) such that x′′[A] = w′ = y[A] = x′[A] and x′′[B] = w′′ = z[B] = x′[B]. Therefore, x = x′′.
Now we prove that \(\rho_{c_T}(\tau_{c_V}(r^N \times^N s^N)) \supseteq \rho_{c_T}(\tau_{c_V}(r^N)) \times^S \rho_{c_T}(\tau_{c_V}(s^N))\).
Let us assume that \(x'' \in \rho_{c_T}(\tau_{c_V}(r^N)) \times^S \rho_{c_T}(\tau_{c_V}(s^N))\). By definition of ×S operator, there exist a tuple \(w' \in \rho_{c_T}(\tau_{c_V}(r^N))\) and a tuple \({w}'' \in \rho_{c_T}(\tau_{c_V}(s^N))\) such that x′′[A] = w′ and x′′[B] = w′′. By definition of the slice operators, there exist a tuple y ∈ r N and a tuple z ∈ s N such that y[A] = w′, z[B] = w′′, \((c_V, c_T) \in EXT^{c_{\rm NOW}}(y[T])\) and \((c_V, c_T) \in EXT^{c_{\rm NOW}}(z[T])\).
By definition of ×N operator, there exists a tuple x′ ∈ r N ×N s N such that:
By definition of slice operators, there exists a tuple \(x \in \rho_{c_T}(\tau_{c_V}(r^N Op^N s^N))\) such that x = x′[AB]; therefore, since:
we have that x = x′′.□
Property 4
(Consistent extension) The temporal algebrae are consistent extensions of the standard (non-temporal) algebra, i.e., the standard relational operators have a counterpart in the temporal relational operators.
Proof
We have to prove that, let r N and s N be standard (non-temporal) relations defined over a schema: R = (A 1, ..., A n ) and \(tt\_start,~tt\_end,~\emph{v}t\_start,~\emph{v}t\_end\) timestamps,
where Op is a standard (non-temporal) operator and Op N a temporal operator. The statement is analogous for unary operators.
We prove the two inclusions separately for the Cartesian product. The proofs for the other operators are analogous.
Let x ∈ transform(r ×s, tt_start, tt_end, vt_start, vt_end). Then, by definition of transform function, x[AB] ∈ r ×s and x[T] = (tt_start, tt_end, vt_start, vt_end). By definition of ×, there exist a tuple y ∈ r and a tuple z ∈ s such that x[A] = y and x[B] = z. Applying the transform function to y, we obtain a bitemporal tuple y′ such that y′[A] = y and y′[T] = (tt_start, tt_end, vt_start, vt_end). The same holds for z: applying the transform function to z, we obtain a bitemporal tuple z′ such that z′[B] = z and z′[T] = (tt_start, tt_end, vt_start, vt_end). By definition of the ×N operator, there exists a bitemporal tuple x′ such that x′[A] = y′[A], x′[B] = z′[B] and:
Then, x = x′.
Now we assume that x′ ∈ transform(r, tt_start, tt_end, vt_start, vt_end) ×N transform(s, tt_start, tt_end, vt_start, vt_end). Then, by definition of ×N, there exist a tuple y′ ∈ transform(r, tt_start, tt_end, vt_start, vt_end) and a tuple z′ ∈ transform(s, tt_start, tt_end, vt_start, vt_end) such that x′[A] = y′[A] and x′[B] = z′[B], and z′[T] ∩ y′[T] ≠ ∅. By definition of the transform function, there exist a tuple y ∈ r and a tuple z ∈ s such that y = y′[A] and z = z′[A], and y[T] = (tt_start, tt_end, vt_start, vt_end) and z[T] = (tt_start, tt_end, vt_start, vt_end). By definition of the × operator, there exists a tuple x′′ ∈ r ×s such that x′′[A] = y, x′′[B] = z. By definition of the transform function, there exists a tuple x ∈ transform(r ×s, tt_start, tt_end, vt_start, vt_end) such that x[A] = x′′[A] = y′[A] = y = x′[A], x[B] = x′′[B] = z′[B] = z = x[B] and \(x[T] = z'[T] = y'[T] = x[T] = (tt\_start, tt\_end, {v}t\_start, \emph{v}t\_end)\).□
Rights and permissions
About this article
Cite this article
Anselma, L., Stantic, B., Terenziani, P. et al. Querying now-relative data. J Intell Inf Syst 41, 285–311 (2013). https://doi.org/10.1007/s10844-013-0245-8
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10844-013-0245-8