Time in Database Systems

Data Models and Temporal Databases 5 Booking Meeting Room Time DB Group DC1331 06-Jan-04.10:00 DB Group DC1331 06-Jan-04.10:01 DB Group DC1331 06-Jan-04.10:02 DB Group DC1331 16-Jan-04.11:59 Intro to Databases MC4042 06-Jan-04.10:00 Intro to Databases MC4042 06-Jan-04.11:19 Intro to Databases MC4042 08-Jan-04.10:00 Intro to Databases MC4042 08-Jan-04.11:19 Fig. 19.1 A Fragment of a Timestamp Instance of the Booking relation from Example 19.1. A timestamp temporal database is a first-order structure , where are temporal relations— instances of the temporal extensions . In addition we require that the set be finite for every and . Note that at this point there are no cardinality restrictions imposed on the number of time instants in the instances of abstract temporal relations; we address issues connected with the actual finite representation of these relations in Section 19.6. In the rest of the chapter we use the following example to illustrate various concepts. Example 19.1 Consider a database recording room bookings for meetings in a university. A relational schema booking Meeting Room links meetings to rooms. We assume that rooms are identified by their room numbers and meetings have distinct descriptions (names). Thus our temporal database, assuming the use of the timestamp model, contains a single relational schema with three attributes, Booking Meeting Room Time A tuple in an instance of this relation denotes the fact that a meeting is in a room at time . For simplicity in this chapter we assume that time is measured in minutes. An example instance of this schema is shown in Figure 19.1. To distinguish between non-temporal relations and (the derived) timestamp relations we capitalize the name of the later. The granularity of time in our examples is one minute (more on granularities in Section 19.9). It is important to understand that, e.g., the “DB group” meeting has booked room DC1331 for every time instant between 06-Jan-04.10:00 and 06-Jan-04.11:59. 30th January 2004 16:9 WorldScientific/ws-b9-75x6-50 book-timeai 6 Time in Database Systems This set of tuples, depending on properties of the time domain, can be infinite (e.g., when dense time domain is considered). There are several things to note about the example: an instance of the Booking relation represents complete information about meeting schedule; in particular it contains information about meetings that have already finished (e.g., for accounting and evaluation purposes) as well as about meetings scheduled in the future (e.g., to avoid overbooking of rooms). This is necessary, for example, if we want to schedule another meeting in the future, as we need to make sure no other meeting conflicts with it. For this purpose we need to query the database for empty rooms at the particular future time we desire and such a query is only possible utilizing the closed-world assumption. Second, we assume that distinct meetings have distinct names. Thus the same meeting (e.g., a class) can meet in several different rooms at different times. Moreover the meeting times may not be continuous (as is common, e.g., for classes). If we wish to distinguish between instances of a particular meeting we need to use distinguished names (or an additional attribute). 19.3.1.2 The Snapshot Model The sbstract temporal databases in this model are defined as a mapping of the temporal domain to the class of standard relational databases. This gives a Kripke structure with the temporal domain serving as the accessibility relation. Definition 19.3 (Abstract Snapshot Temporal Database) A snapshot temporal database over , , and is a map , where is the class of finite relational databases over and . It is easy to see that snapshot and timestamp abstract temporal databases are merely different views of the same data and thus can represent the same class of temporal databases. Formally, a snapshot temporal database corresponds to a timestamp temporal database if and only if % ( , for all (and ) in the schema of ( ), where ( , ( ) are the instances of the relations ( ) in ( ), respectively, where ! . This correspondence allows us to move freely between the two models. Example 19.2 A snapshot representation of the instance in Figure 19.1 is shown in Figure 19.2. Note that the relationship between the timestamp and snapshot models is essentially currying and uncurrying [Barendregt, 1984] (the correspondence is exact if the relations are considered to be boolean functions from tuples to the set " # $&% '( *) + % ). 30th January 2004 16:9 WorldScientific/ws-b9-75x6-50 book-timeai Abstract Data Models and Temporal Databases 7Data Models and Temporal Databases 7 Time booking 06-Jan-04.10:00 (DB Group,DC1331), (Intro to Databases,MC4042) 06-Jan-04.10:01 (DB Group,DC1331), (Intro to Databases,MC4042) 06-Jan-04.11:19 (DB Group,DC1331), (Intro to Databases,MC4042) 06-Jan-04.11:20 (DB Group,DC1331) 06-Jan-04.11:59 (DB Group,DC1331) 06-Jan-04.12:00 06-Jan-04.12:00 08-Jan-04.10:00 (Intro to Databases,MC4042) 08-Jan-04.11:19 (Intro to Databases,MC4042) Fig. 19.2 A Fragment of a Snapshot Instance of the Booking relation. Thus, in the rest of the chapter we use the timestamp abstract temporal databases as the common underlying temporal data model. Also, let us reiterate that the abstract data models are used solely at the conceptual level; relations will likely be stored in a different, more space-efficient format, e.g., one that uses time intervals (see Section 19.6). 19.3.1.3 Relational Database Histories Relational databases are updatable and it is natural to consider sequences of database states resulting from the updates. Definition 19.4 (Finite History) A history over a database schema and a data domain is a sequence ( of database instances (called states) such that (1) all the states share the same schema and the same data domain , (2) is the initial instance of the database, (3) results from applying an update to , , There is a clear correspondence between histories over and and snapshot temporal databases over , N (natural numbers), and (see Definitions 19.3 and 19.2). Consequently, any query language for abstract temporal databases can also be used to query database histories. However, there is a difference in the restrictions placed on updates: while there are no a priori limitations placed on snapshot temporal database updates (they can involve any snapshot), histories are append-only (the past cannot be modified). This property is often 30th January 2004 16:9 WorldScientific/ws-b9-75x6-50 book-timeai 8 Time in Database Systems associated with transaction time databases—temporal databases in which time instants correspond to commitment time of transactions; the append-only nature of such databases corresponds to the requirement of durable transactions. Indeed, transaction-time temporal databases can be viewed as finite histories of standard relational databases. 19.3.2 Multiple Temporal Dimensions So far we have considered only single-dimensional temporal databases: temporal relations were allowed only a single temporal attribute. To motivate the introduction of multiple temporal dimensions in the context of temporal databases, consider the following examples: Bitemporal databases: with each tuple in a relation two kinds of time are stored—the valid time (when a particular tuple is true) and the transaction time (when the particular tuple was inserted/deleted in the database) [Jensen et al., 1993]. Spatial databases: multiple dimensions over an interpreted domain can be used for representing spatial data where multiple dimensions serve as coordinates of points in a -dimensional Euclidean space. Most of the data modeling techniques require only fixed-dimensional data. However, the true need for arbitrarily large dimensionality of data models originates in the requirement of having a first-order complete query language (see Theorem 19.5 in Section 19.5). Thus, there are two cases to consider: temporal models with a fixed number of dimensions , and temporal models with a varying number of temporal dimensions without an upper bound. The representation of multiple temporal dimensions in abstract temporal databases is quite straightforward: we simply index relational databases by the elements of an appropriate self-product of the temporal domain (in the case of snapshot temporal databases), or add the appropriate number of temporal attributes (in the case of timestamp temporal databases). 19.3.3 Non 1NF Temporal Models Several temporal data models associate relationships between data values— truth of facts recorded in the database— with sets of time instants (rather than with a single time instant). These models are no longer in first normal form (N1NF) and are often called temporally grouped models [Clifford et al., 1993; Clifford et al., 1994]. 30th January 2004 16:9 WorldScientific/ws-b9-75x6-50 book-timeai Abstract Data Models and Temporal Databases 9Data Models and Temporal Databases 9 Example 19.3 The instance of the Booking relation from Figure 19.1 represented in the N1NF (temporally grouped) model is as follows Booking Meeting Room Time DB group DC1331 06-Jan-04.10:00, 06-Jan-04.10:01, . . . ,06-Jan-04.11:59 Intro to Databases MC4042 06-Jan-04.10:00, . . . ,06-Jan-04.11:19, 08-Jan-04.10:00, . . . ,08-Jan-04.11:19 However, the set-based attributes can be flattened, perhaps by introducing additional surrogate keys, to obtain a 1NF temporal database containing the same information [Clifford et al., 1993; Wijsen, 1999]. Without introducing additional keys, however, this transformation can be lossy. Example 19.4 Consider a fragment of a N1NF temporal relation booking(DB group, DC1331, 06-Jan-04.10:00, . . . ,06-Jan-04.11:59 ) booking(DB group, DC1331, 09-Jan-04.10:00, . . . ,09-Jan-04.11:59 ) The meetings in this design are no longer identified by their names, but rather by their name and the set of all meeting times. The same information, however, can be captured by explicitly identifyin

[1]  Johan Anthory Willem Kamp,et al.  Tense logic and the theory of linear order , 1968 .

[2]  E. F. Codd,et al.  Normalized Data Structure: A Brief Tutorial. , 1971 .

[3]  E. F. Codd,et al.  Relational Completeness of Data Base Sublanguages , 1972, Research Report / RJ / IBM / San Jose, California.

[4]  Lennart Åqvist A conjectured axiomatization of two-dimensional Reichenbachian tense logic , 1979, J. Philos. Log..

[5]  Richard Hull,et al.  Sort sets in the relational model , 1983, PODS '83.

[6]  Pierre Wolper Temporal Logic Can Be More Expressive , 1983, Inf. Control..

[7]  James F. Allen Maintaining knowledge about temporal intervals , 1983, CACM.

[8]  Richard T. Snodgrass,et al.  The temporal query language TQuel , 1987, TODS.

[9]  James F. Allen Towards a General Theory of Action and Time , 1984, Artif. Intell..

[10]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[11]  R. Snodgrass Temporal Databases , 1986, Computer.

[12]  Pierre Wolper,et al.  On the Relation of Programs and Computations to Models of Temporal Logic , 1987, Temporal Logic in Specification.

[13]  Jeffrey D. Ullman,et al.  Principles of Database and Knowledge-Base Systems, Volume II , 1988, Principles of computer science series.

[14]  Moshe Y. Vardi A temporal fixpoint calculus , 1988, POPL '88.

[15]  Jan Chomicki,et al.  Temporal deductive databases and infinite objects , 1988, PODS.

[16]  Adrian Walker,et al.  Towards a Theory of Declarative Knowledge , 1988, Foundations of Deductive Databases and Logic Programming..

[17]  Martín Abadi,et al.  Temporal Logic Programming , 1989, J. Symb. Comput..

[18]  Pierre Wolper,et al.  Handling infinite temporal data , 1990, PODS.

[19]  E. Allen Emerson,et al.  Temporal and Modal Logic , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[20]  James Clifford,et al.  A Temporal Relational Algebra as a Basis for Temporal Relational Completeness , 1990 .

[21]  Christoph Brzoska,et al.  Temporal Logic Programming and its Relation to Constraint Logic Programming , 1991, ISLP.

[22]  Thomas A. Henzinger,et al.  Logics and Models of Real Time: A Survey , 1991, REX Workshop.

[23]  Fahiem Bacchus,et al.  A Non-Reified Temporal Logic , 1989, Artif. Intell..

[24]  Ron Koymans,et al.  Specifying Message Passing and Time-Critical Systems with Temporal Logic , 1992, Lecture Notes in Computer Science.

[25]  Sushil Jajodia,et al.  Temporal Databases: Theory, Design, and Implementation , 1993 .

[26]  Richard T. Snodgrass,et al.  An Overview of TQuel , 1993, Temporal Databases.

[27]  Christoph Brzoska,et al.  Temporal Logic Programming with Bounded Universal (Modality) Goals , 1993, Workshop Logische Programmierung.

[28]  Nikos A. Lorentzos The Interval-extended Relational Model and Its Applications to Valid-time Databases , 1993, Temporal Databases.

[29]  Christian S. Jensen,et al.  Unification of temporal data models , 1993, Proceedings of IEEE 9th International Conference on Data Engineering.

[30]  Albert Croker,et al.  On the Completeness of Query Languages for Grouped and Ungrouped Historical Data Models , 1993, Temporal Databases.

[31]  Ramez Elmasri,et al.  TSQL2 language specification , 1994, SGMD.

[32]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[33]  Albert Croker,et al.  On completeness of historical relational query languages , 1991, TODS.

[34]  Marianne Baudinet,et al.  Constraint-Generating Dependencies , 1994, PPCP.

[35]  Jan Chomicki,et al.  Temporal Query Languages: A Survey , 1994, ICTL.

[36]  D. Gabbay,et al.  Temporal Logic Mathematical Foundations and Computational Aspects , 1994 .

[37]  Jan Chomicki,et al.  Datalog with Integer Periodicity Constraints , 1994, J. Log. Program..

[38]  Christoph Brzoska Temporal Logic Programming in Dense Time , 1995, ILPS.

[39]  Richard T. Snodgrass,et al.  The TSQL2 Temporal Query Language , 1995 .

[40]  Alexandra Poulovassilis,et al.  Manipulation Operations for an Interval-Extended Relational Model , 1995, Data Knowl. Eng..

[41]  Elisa Bertino,et al.  Semantic assumptions and query evaluation in temporal databases , 1995, SIGMOD '95.

[42]  M. Baudinet On the Expressiveness of Temporal Logic Programming , 1995, Inf. Comput..

[43]  Christian S. Jensen,et al.  Evaluating and Enhancing the Completeness of TSQL2 , 1995 .

[44]  Jan Chomicki,et al.  On the Feasibility of Checking Temporal Integrity Constraints , 1995, J. Comput. Syst. Sci..

[45]  Jan Chomicki,et al.  Efficient checking of temporal integrity constraints using bounded history encoding , 1995, TODS.

[46]  Jan Chomicki,et al.  Variable independence and aggregation closure , 1996, PODS.

[47]  Serge Abiteboul,et al.  Temporal versus first-order logic to query temporal databases , 1996, PODS.

[48]  Christian S. Jensen,et al.  Adding Valid Time to SQL/Temporal , 1996 .

[49]  Jan Chomicki,et al.  Querying TSQL2 Databases with Temporal Logic , 1996, EDBT.

[50]  David Toman,et al.  First-Order Queries over Temporal Databases Inexpressible in Temporal Logic , 1996, EDBT.

[51]  Richard T. Snodgrass,et al.  Coalescing in Temporal Databases , 1996, VLDB.

[52]  David Toman,et al.  Point vs. interval-based query languages for temporal databases (extended abstract) , 1996, PODS.

[53]  Mehmet A. Orgun,et al.  ON TEMPORAL DEDUCTIVE DATABASES , 1996, Comput. Intell..

[54]  Christian S. Jensen,et al.  Extending Existing Dependency Theory to Temporal Databases , 1996, IEEE Trans. Knowl. Data Eng..

[55]  A. Prasad Sistla,et al.  Modeling and querying moving objects , 1997, Proceedings 13th International Conference on Data Engineering.

[56]  Sushil Jajodia,et al.  Logical design for temporal databases with multiple granularities , 1997, TODS.

[57]  David Toman,et al.  A point-based temporal extension of SQL , 1997 .

[58]  Nikos A. Lorentzos,et al.  SQL Extension for Interval Data , 1997, IEEE Trans. Knowl. Data Eng..

[59]  Nicolas Beldiceanu,et al.  Constraint Logic Programming , 2010, 25 Years GULP.

[60]  Jef Wijsen,et al.  Reasoning about Qualitative Trends in Databases , 1998, Inf. Syst..

[61]  Stéphane Grumbach,et al.  Constraint Databases , 1999, JFPLC.

[62]  Jef Wijsen,et al.  Temporal FDs on complex objects , 1999, TODS.

[63]  Serge Abiteboul,et al.  Temporal Connectives Versus Explicit Timestamps to Query Temporal Databases , 1999, J. Comput. Syst. Sci..

[64]  Carlo Zaniolo,et al.  Universal temporal extensions for database languages , 1999, Proceedings 15th International Conference on Data Engineering (Cat. No.99CB36337).

[65]  Christian S. Jensen,et al.  Temporal Entity-RelationshipModels | a Survey , 1996 .

[66]  Vassilis J. Tsotras,et al.  Comparison of access methods for time-evolving data , 1999, CSUR.

[67]  Richard T. Snodgrass,et al.  Developing Time-Oriented Database Applications in SQL , 1999 .

[68]  Jennifer Widom,et al.  TIP: a temporal extension to Informix , 2000, SIGMOD '00.

[69]  David J. DeWitt,et al.  NiagaraCQ: a scalable continuous query system for Internet databases , 2000, SIGMOD '00.

[70]  Sushil Jajodia,et al.  Time Granularities in Databases, Data Mining, and Temporal Reasoning , 2000, Springer Berlin Heidelberg.

[71]  Carlo Zaniolo,et al.  Version Management of XML Documents , 2000, WebDB.

[72]  Stephan Merz,et al.  Model Checking , 2000 .

[73]  Frank Wolter,et al.  Decidable fragment of first-order temporal logics , 2000, Ann. Pure Appl. Log..

[74]  Jan Chomicki,et al.  Querying ATSQL databases with temporal logic , 1996, TODS.

[75]  Bart Kuijpers,et al.  A Theory of Spatio-Temporal Database Queries , 2001, DBPL.

[76]  David Toman Expiration of historical databases , 2001, Proceedings Eighth International Symposium on Temporal Representation and Reasoning. TIME 2001.

[77]  Ouri Wolfson,et al.  A Spatiotemporal Model and Language for Moving Objects on Road Networks , 2001, SSTD.

[78]  Maurizio Lenzerini,et al.  Data integration: a theoretical perspective , 2002, PODS.

[79]  Ian M. Hodkinson,et al.  Monodic Packed Fragment with Equality is Decidable , 2002, Stud Logica.

[80]  Samuel Madden,et al.  Continuously adaptive continuous queries over streams , 2002, SIGMOD '02.

[81]  Frank Wolter,et al.  Decidable and undecidable fragments of first-order branching temporal logics , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[82]  Jennifer Widom,et al.  Characterizing memory requirements for queries over continuous data streams , 2002, PODS '02.

[83]  C. J. Date,et al.  Temporal data and the relational model , 2002 .

[84]  Carlo Zaniolo,et al.  Efficient schemes for managing multiversionXML documents , 2002, The VLDB Journal.

[85]  David Toman,et al.  Logical data expiration , 2002, Proceedings Ninth International Symposium on Temporal Representation and Reasoning.

[86]  Jennifer Widom,et al.  Models and issues in data stream systems , 2002, PODS.

[87]  Hector J. Levesque,et al.  Logical foundations of active databases , 2003 .

[88]  Jan Chomicki,et al.  Variable Independence in Constraint Databases , 2003, IEEE Trans. Knowl. Data Eng..

[89]  Jef Wijsen,et al.  Logical Languages for Data Mining , 2003, Logics for Emerging Applications of Databases.

[90]  Frank Wolter,et al.  On the computational complexity of decidable fragments of first-order linear temporal logics , 2003, 10th International Symposium on Temporal Representation and Reasoning, 2003 and Fourth International Conference on Temporal Logic. Proceedings..

[91]  Christian S. Jensen,et al.  A foundation for vacuuming temporal databases , 2003, Data Knowl. Eng..

[92]  David Toman,et al.  Logical Data Expiration for Fixpoint Extensions of Temporal Logics , 2003, SSTD.

[93]  Enrico Franconi,et al.  Fixpoint Extensions of Temporal Description Logics , 2003, Description Logics.

[94]  Gunter Saake,et al.  Logics for Emerging Applications of Databases , 2003, Springer Berlin Heidelberg.

[95]  Luc Segoufin,et al.  Order Independent Temporal Properties , 2004, J. Log. Comput..

[96]  Abraham Kandel,et al.  Data Mining in Time Series Database , 2004 .

[97]  Enrico Franconi,et al.  A survey of temporal extensions of description logics , 2001, Annals of Mathematics and Artificial Intelligence.

[98]  Enrico Franconi,et al.  Temporal Description Logics , 2005, Handbook of Temporal Reasoning in Artificial Intelligence.

[99]  Floris Geerts,et al.  Constraint Query Languages , 2008, Encyclopedia of GIS.

[100]  Vasilis Vassalos,et al.  Answering Queries Using Views , 2009, Encyclopedia of Database Systems.

[101]  David Weimer Bibliography , 2018, Medical History. Supplement.

[102]  Hans Kamp,et al.  Formal Properties of ‘Now’ , 2013 .