Overview of Temporal Data Models and Time Dimensions in Databases

 
Temporal
Data Models
 
 
F
F
a
a
b
b
i
i
o
o
 
 
G
G
r
r
a
a
n
n
d
d
i
i
fabio.grandi@unibo.it
DISI, 
Università di Bologna
 
A short course on Temporal Databaes for DISI PhD students, 2016
A short course on Temporal Databaes for DISI PhD students, 2016
Credits: most of the materials used is taken from slides prepared by Prof. M. Böhlen (Univ. of Zurich, Switzerland)
Credits: most of the materials used is taken from slides prepared by Prof. M. Böhlen (Univ. of Zurich, Switzerland)
 
Temporal Data Models
 
 
Data model: 
DM = (DS, QL)
DS
 is a set of data structures
QL
 is a language for querying and updating the data
structures
 
Example: the relational data model is composed
of relations and SQL (or relational algebra)
 
Many extensions of the relational data model to
support time have been proposed
 
 
Temporal Data Models
 
 
Several modeling aspects have to be considered
Different Time dimensions
Different Timestamp types
Tuple versus Attribute timestamping
 
(Ungrouped versus Grouped model?)
Point-based versus Period-based model
 
(Atelic versus Telic data?)
 
The different modeling aspects lead to subtle and
difficult issues. There are pros and cons in all
cases (no consensus can be reached)
 
Time Dimensions
 
Time in a TDB is multi-dimensional
:
valid time, transaction time, event/decision time,
publication time, efficacy time, “user-defined” time
 
Different time dimensions are of practical interest in
different application fields
 
The key question is: which time aspects are 
sufficiently
important 
so that they should be supported by the
database system?
 
There is a broad consensus that transaction time and
valid time are the most important time dimensions
 
 
 
 
Valid Time
 
 
Valid time
Valid time
 is the time a fact was/is/will be true in the
 is the time a fact was/is/will be true in the
modeled reality or mini-world
modeled reality or mini-world
A fact is a statement that is either true or false
A fact is a statement that is either true or false
A relation is a collection of facts
A relation is a collection of facts
Example: John has been hired on October 1, 2014
Example: John has been hired on October 1, 2014
Valid time captures the time-varying states of the mini-world
Valid time captures the time-varying states of the mini-world
All facts have a valid time by definition, however, it might not be
All facts have a valid time by definition, however, it might not be
recoreded in the database
recoreded in the database
Valid time is independent of the recording of the fact in a database
Valid time is independent of the recording of the fact in a database
Valid time is either bounded (does not extend until infinity) or
Valid time is either bounded (does not extend until infinity) or
unbounded (extends until infinity)
unbounded (extends until infinity)
Future facts can be represented (stated or forecasted)
Future facts can be represented (stated or forecasted)
 
 
Transaction Time
 
Transaction time 
Transaction time 
is the time when a fact is current/present
is the time when a fact is current/present
in the database as stored data
in the database as stored data
Example: the fact “John was hired on October 1, 2014” was stored
Example: the fact “John was hired on October 1, 2014” was stored
in the DB on October 5, 2014, and has been deleted on March 31,
in the DB on October 5, 2014, and has been deleted on March 31,
2015
2015
Transaction time has a duration: from insertion to deletion, with
Transaction time has a duration: from insertion to deletion, with
multiple insertions and deletions being possible for the same fact
multiple insertions and deletions being possible for the same fact
With transaction time deletions of facts are purely logical
With transaction time deletions of facts are purely logical
the fact remains in the database, but ceases to be part of the database
the fact remains in the database, but ceases to be part of the database
current state.
current state.
Transaction time captures the time-varying states of the database
Transaction time captures the time-varying states of the database
Always bounded on both ends
Always bounded on both ends
Starts when the database is created (nothing was stored before)
Starts when the database is created (nothing was stored before)
Does not extend past now (no facts are known to have been stored in the
Does not extend past now (no facts are known to have been stored in the
future)
future)
Basis for supporting accountability and “traceability” requirements,
Basis for supporting accountability and “traceability” requirements,
e.g. in financial, medical, legal applications
e.g. in financial, medical, legal applications
S
S
h
h
o
o
u
u
l
l
d
d
 
 
b
b
e
e
 
 
s
s
u
u
p
p
p
p
l
l
i
i
e
e
d
d
 
 
a
a
n
n
d
d
 
 
m
m
a
a
n
n
a
a
g
g
e
e
d
d
 
 
a
a
u
u
t
t
o
o
m
m
a
a
t
t
i
i
c
c
a
a
l
l
l
l
y
y
 
 
b
b
y
y
 
 
t
t
h
h
e
e
 
 
D
D
B
B
M
M
S
S
 
Dimensions of Time
 
A data model can support none, one, two, or more of
these time dimensions
Snapshot data model: None of the time dimensions is supported
Represents a single snapshot of the reality and the database
Valid time data model: Supports only valid time
Transaction time data model: Supports only transaction time
Bitemporal data model: Supports valid time and transaction time
In a former terminology [Snodgrass & Ahn 1986]:
Historical DB 
 valid-time DB
Rollback DB 
transaction-time DB
Temporal DB 
→ bitemporal DB
A DB where snapshot, transaction-time, valid-time and
bitemporal relations coexist can be called a multi-
temporal database
 
Temporal Relations
 
 
A pictorial representation of the 4 kinds of
temporal table and evolution along the time axes
 
 
 
 
 
 
 
snapshot table
  
transaction-time table
 
 
 
 
 
 
valid-time table
  
bitemporal table
 
Dimensions of Time
 
Which time dimensions are needed by an application?
(what can be done and what cannot be done?)
Consider the following example involving the career of an
employee:
 
   1.
 
John was hired as a programmer (PRG)
 
with initial salary 2000 at time 1;
 
   2.
 
John’s salary was raised to 3000 at time 3
 
 
(but recorded in the DB at time 4);
 
   3. John became a database administrator (DBA)
 
at time 6.
Notice that 2. involves a 
retroactive
 update
In a Transaction-time DB
 
 
   
1.
 
John was hired as a programmer (PRG)
 
with initial salary 2000 at time 1;
 
   2.
 
John’s salary was raised to 3000 at time 3
 
 
(but recorded in the DB at time 4);
 
   3. John became a database administrator (DBA)
 
at time 6.
  
Emp
 
 
 
The time of the change 2. is incorrectly represented
In a Valid-time DB
 
 
   
1.
 
John was hired as a programmer (PRG)
 
with initial salary 2000 at time 1;
 
   2.
 
John’s salary was raised to 3000 at time 3
 
 
(but recorded in the DB at time 4);
 
   3. John became a database administrator (DBA)
 
at time 6.
  
Emp
 
 
 
The validity of changes is correctly represented but
there is no way to know that change 2. was retroactive
In a Bitemporal DB
 
 
   
1.
 
John was hired as a programmer (PRG)
 
with initial salary 2000 at time 1;
 
   2.
 
John’s salary was raised to 3000 at time 3
 
 
(but recorded in the DB at time 4);
 
   3. John became a database administrator (DBA)
 
at time 6.
 
 
 
 
VT
 
TT
 
1
 
1
 
PRG, 2000
 
4
 
6
 
3
 
6
 
PRG, 3000
 
DBA, 3000
corner under the diagonal
corner under the diagonal
(i.e. VT.Start < TT.Start):
(i.e. VT.Start < TT.Start):
retroactive transaction
retroactive transaction
In a Bitemporal DB
 
 
   
1.
 
John was hired as a programmer (PRG)
 
with initial salary 2000 at time 1;
 
   2.
 
John’s salary was raised to 3000 at time 3
 
 
(but recorded in the DB at time 4);
 
   3. John became a database administrator (DBA)
 
at time 6.
  
Emp
 
 
 
 
Choice of Temporal Dimensions
 
A Transaction-time DB allows user to only effect
immediate (on-time) transactions; proactive transactions
are physically impossible and retroactive transactions
store data histories with a wrong “validity”
 
A Valid-time DB allows users to execute retro-/pro-active
transactions (validity of modifications aka 
applicability
period
 is expressed by users via the DML); after its
execution, there is no way to know whether a transaction
was immediate or retro/pro-active
 
A Bitemporal DB allows users to execute retro-/proactive
transactions and to keep track of their execution in the DB
 
 
 
 
Other Time Dimensions
 
Event Time [Chakravarthy & Kim 94] aka
Decision Time [Nascimento & Eich 95]
Considering the event E causing the change of some data
with some validity (in the mini-world and in the DB):
E occurs at time T in the mini-world (Decision/Event Time)
E occurs at time T
ꞌ ≥ 
T in the DB (Transaction Time)
E/D-T vs VT (=,<,>): current, futuristic, past due
TT vs VT (=,<,>): immediate, proactive, retroactive
E/D-T vs TT (=,<,>): instantaneous, late, N/A
 
In specific application domains, other time dimensions
can be of interest (e.g. Efficacy time in the legal field)
 
 
 
 
 
Event vs State Temporal Relations
 
Moreover, in a TDB there can be two kinds of
Moreover, in a TDB there can be two kinds of
temporal relations:
temporal relations:
Event tables
Event tables
, with instant timestamps
, with instant timestamps
 
 
(store information about facts without duration)
(store information about facts without duration)
State tables
State tables
, with period or element timestamps
, with period or element timestamps
Event table are suitable to store measures,
Event table are suitable to store measures,
sensor data, departure/transit/arrival times
sensor data, departure/transit/arrival times
 
 
Departures
Departures
Departures
Departures
 
 
 
 
 
 
Temporal Relations
 
In the following, we focus on state tables
In the following, we focus on state tables
 
An implicit 
An implicit 
continuity assumption 
continuity assumption 
is often done
is often done
(data values as produced by an insertion or update are
(data values as produced by an insertion or update are
assumed to persist until they are changed or deleted, e.g.
assumed to persist until they are changed or deleted, e.g.
salary of an employee)
salary of an employee)
 
Emp
Emp
 
Timestamping
 
A timestamp is a value that is associated with data in a
database
Captures some temporal aspect, e.g. valid time, transaction time
Represented as one or more attributes/columns of a relation
Three different types of timestamps are widely used
Time points
Time periods
Temporal elements
Two different ways of timestamping
Tuple timestamping
Attribute timestamping
 
Temporally grouped models are not based on
timestamping (but adopt a functional approach similar to
attribute timestamping though)
 
Timestamping
 
E
x
a
m
p
l
e
:
 
V
i
d
e
o
g
a
m
e
 
s
t
o
r
e
 
w
h
e
r
e
 
c
u
s
t
o
m
e
r
s
,
 
i
d
e
n
t
i
f
i
e
d
b
y
 
a
 
C
u
s
t
I
D
,
 
r
e
n
t
 
v
i
d
e
o
g
a
m
e
s
,
 
i
d
e
n
t
i
f
i
e
d
 
b
y
 
a
 
G
a
m
e
N
o
.
C
o
n
s
i
d
e
r
 
t
h
e
 
f
o
l
l
o
w
i
n
g
 
r
e
n
t
a
l
s
 
d
u
r
i
n
g
 
M
a
y
 
2
0
1
5
:
On 3rd of May, customer C101 rents game G1234 for three days
On 5th of May, customer C102 rents game G1245 for 3 days
From 9th to 12th of May, customer C102 rents game G1234
From 19th to 20th of May, and again from 21st to 22nd of May,
customer C102 rents game G1245
These rentals are stored in a relation CheckOut which is
graphically illustrated below
(C101, G1234)                                                                                                            (C102, G1245)
(C101, G1234)                                                                                                            (C102, G1245)
(C102, G1245)            (C102, G1234)                                        (C102, G1245)
(C102, G1245)            (C102, G1234)                                        (C102, G1245)
 
Tuple Timestamping with Points
 
Point-based data model
Point-based data model
:
:
each tuple is timestamped
each tuple is timestamped
with a time point/instant
with a time point/instant
Most basic and simple data model
Most basic and simple data model
Timestamps are atomic values that
Timestamps are atomic values that
can be easily compared, using
can be easily compared, using
=, <>, >, <, >=, <=
=, <>, >, <, >=, <=
Multiple tuples are used if a fact is
Multiple tuples are used if a fact is
valid at several time points
valid at several time points
Syntactically different relations store
Syntactically different relations store
different information
different information
Provides an 
Provides an 
abstract view 
abstract view 
of a DB
of a DB
and is not meant for physical
and is not meant for physical
implementation
implementation
Conceptual simplicity and
Conceptual simplicity and
computational complexity make it
computational complexity make it
popular for theoretical studies
popular for theoretical studies
 
Tuple Timestamping with Points
 
 
The reconstruction of the
original relation is not always
possible
The table on the previous slide
makes it impossible to
determine if C102 rented
G1245 once or twice in the
period from 19 to 22
Additional attributes are
required, e.g. Rental to
represent the individual rentals
It is difficult to predict when an
additional attribute is needed
 
Tuple Timestamping with Periods
 
Period-based 
Period-based 
(interval-based) 
(interval-based) 
data model
data model
:
:
each tuple is timestamped with a time period
each tuple is timestamped with a time period
  
  
     
     
CheckOut
CheckOut
 
 
 
 
 
 
Timestamps are atomic values that can be compared
Timestamps are atomic values that can be compared
using Allen’s 13 basic relationships between periods
using Allen’s 13 basic relationships between periods
(before, meets, during, etc.)
(before, meets, during, etc.)
More convenient than comparing the endpoints of the periods
More convenient than comparing the endpoints of the periods
The benefits of Allen’s predicates are relatively small
The benefits of Allen’s predicates are relatively small
 
Tuple Timestamping with Periods
 
 
The start and end of an interval are distinguished change
points
The Rental attribute is not needed to distinguish different
checkouts
Multiple tuples are used if a fact is valid over disjoint time
periods
Cannot model a single checkout with a gap
The most popular model from an implementation
perspective (even in SQL89, with two columns Start, End)
Time periods are not closed under all set operations
Ex. subtracting [5, 7] from [1, 9] returns a set of periods
{ [1, 4], [8, 9] }
 
Tuple Timestamping
with Temporal Elements
 
 
Data model with temporal elements
Data model with temporal elements
:
:
each tuple is timestamped with a temporal element,
each tuple is timestamped with a temporal element,
that is a finite set of time periods
that is a finite set of time periods
CheckOut                                             CheckOut
CheckOut                                             CheckOut
 
 
 
 
The full history of a fact is stored in one tuple
The full history of a fact is stored in one tuple
Usually the periods of a temporal element must be disjoint
Usually the periods of a temporal element must be disjoint
and non-adjacent (i.e. element = union of maximal disjoint
and non-adjacent (i.e. element = union of maximal disjoint
periods). This makes it similar to point timestamps
periods). This makes it similar to point timestamps
 
Attribute Timestamping
 
Attribute value timestamping
Attribute value timestamping
: each attribute value is
: each attribute value is
timestamped with a set of time points/periods
timestamped with a set of time points/periods
All information about a real-world object is captured in a
All information about a real-world object is captured in a
single tuple
single tuple
e.g. all information about a customer in a tuple of the relation
e.g. all information about a customer in a tuple of the relation
below; each tuple is timestamped with a temporal element,
below; each tuple is timestamped with a temporal element,
that is a finite set/union of time periods
that is a finite set/union of time periods
 
 
CheckOut
CheckOut
 
 
 
 
 
Attribute Timestamping
 
Notice that a single tuple may record multiple facts
e.g. the second tuple records the following facts: rental
information for customer C102 for the games G1245 and G1234,
and four different checkouts
   
CheckOut
 
 
 
 
 
 
Non-first-normal-form (N1NF) data model
In a previous terminology:
Homogeneous model 
t
uple timestamping
Inhomogeneous model 
a
ttribute timestamping
 
 
 
 
 
Attribute Timestamping
 
Different groupings of the information into tuples are
possible for attribute-value timestamping
Information about other objects is spread across several tuples
(e.g. information about videogames)
e.g. regrouping the CheckOut table on GameNo in the example
below
 
CheckOut
 
 
 
 
 
  
  
(such an operation is, in general, problematic!)
 
 
 
 
 
 
Temporally Grouped Model
 
In a 
In a 
temporally
temporally
 
 
grouped 
grouped 
(or history-oriented) 
(or history-oriented) 
data
data
 
 
model
model
the temporal dimension is implicit in the structure of data
the temporal dimension is implicit in the structure of data
representation
representation
data objects are substituted by their 
data objects are substituted by their 
histories 
histories 
(ID not necessary)
(ID not necessary)
attributes can be regarded as 
attributes can be regarded as 
partial functions 
partial functions 
that map time into
that map time into
data domains
data domains
 
 
 
 
 
 
 
 
Temporal models based on addition of timestamping
Temporal models based on addition of timestamping
columns can be considered 
columns can be considered 
ungrouped
ungrouped
 
Temporally Grouped Model
 
A temporally grouped model is strictly more 
expressive
than an ungrouped data model
Ex. If we project the CheckOut relation on CustID:
 
 
 
 
 
 
 
 
A temporally grouped model is difficult to implement
History IDs (e.g. surrogates) are needed to represent grouped
data in a 1NF relation
Operations (e.g. join) are problematic to define with HIDs
A N1NF (e.g. XML) database would be needed
 
We still know that such tuples involve 5
different rentals: the last two tuples do
not merge as they belong to different
groups (i.e. checkouts)
In an ungrouped models the last two
tuples can be coalesced and we lose
such information
 
Point- versus Period-based Data Model
 
In a 
In a 
point-based
point-based
 data model, truth value of facts
 data model, truth value of facts
is associated to time points
is associated to time points
Tuple timestamping with periods (or elements)
Tuple timestamping with periods (or elements)
can be used as a compact representation or
can be used as a compact representation or
normalization tool
normalization tool
Adjacent or overlapping value-equivalent tuples can be
Adjacent or overlapping value-equivalent tuples can be
coalesced to obtain a canonical representation
coalesced to obtain a canonical representation
A fact true in [S,E] is true at any instant t
A fact true in [S,E] is true at any instant t
[S,E]
[S,E]
 
In a 
In a 
period-based
period-based
 (or interval-based) data model,
 (or interval-based) data model,
period timestamps are first-class objects and
period timestamps are first-class objects and
truth value of facts can be associated to whole
truth value of facts can be associated to whole
time periods
time periods
 
Period-based Data Model
 
In a 
weak interpretation
, period timestamps are
first-class objects
Although the truth value of facts is point-based,
it is important to preserve (e.g. for
lineage/provenance management) the
individuality of period boundaries through
operations, as they are reminiscent of change
events (initiation and termination)
Ex. promotion or retirement for salary changes
 
In a 
strong interpretation
, period timestamps are
used to represent telic facts
 
Atelic versus Telic Temporal Data
 
Atelic
Atelic
 
 
data
data
 is temporal data that describe facts that do not
 is temporal data that describe facts that do not
involve a goal or culmination (e.g. have a job, salary)
involve a goal or culmination (e.g. have a job, salary)
Atelic data enjoy the 
Atelic data enjoy the 
downward and upward inheritance
downward and upward inheritance
properties
properties
Downward inheritance: fact valid in period T is also valid in any
Downward inheritance: fact valid in period T is also valid in any
subset of T (and at any instant of T)
subset of T (and at any instant of T)
Upward inheritance: a fact valid in consecutive or overlapping
Upward inheritance: a fact valid in consecutive or overlapping
periods  T1 and T2 is also valid in T1 U T2
periods  T1 and T2 is also valid in T1 U T2
Telic
Telic
 
 
data
data
 are temporal data for which downward and
 are temporal data for which downward and
upward inheritance properties do not hold
upward inheritance properties do not hold
Telic data 
Telic data 
represent accomplishments or achievements
represent accomplishments or achievements
Examples of telic facts:
Examples of telic facts:
the Golden Gate bridge was built from January 1933 to April 1937
the Golden Gate bridge was built from January 1933 to April 1937
John had a phleboclysis of 500mg of drug X from 10:30 to 11:45
John had a phleboclysis of 500mg of drug X from 10:30 to 11:45
 
 
 
 
The Bitemporal Conceptual Data Model
 
 
The goal of the Bitemporal Conceptual Data Model
(BCDM) is to capture the essential semantics of time-
varying relations
The BCDM is not intended for presentation, storage, or query
evaluation purposes
The goal of the BCDM is similar to the goal of abstract temporal
databases
Chomicki [2009] proposed the notions of abstract and concrete
temporal databases to separate semantics and representation
 
Semantics associated with periods is not possible in the
BCDM (it is a point-based data model)
 
The Bitemporal Conceptual Data Model
 
Bitemporal Conceptual Data Model (BCDM)
Supports valid time and transaction time
Both time domains are linear and discrete
Valid-time domain: D
VT
 = { t
1
, t
2
, …, t
k
 }
Transaction-time domain: 
D
TT
 = { tꞌ
1
, tꞌ
2
, …, tꞌ
j
 } U {now}
A bitemporal chronon is a pair of a transaction-time chronon and a
valid-time chronon
(t
i
 , t
j
) 
 
D
TT
 x 
D
VT
"tiny rectangle" in the two-dimensional space
A bitemporal element is a set of bitemporal chronons
Timestamp attribute T with domain of bitemporal elements
Explicit (non-timestamp) attributes
Names: D
A
 = 
{ A
1
, A
2
, …, A
n
 }
BCDM schema: (
A
1
, A
2
, …, A
n
,T
)
BCDM tuple: (a
1
, a
2
, …, a
n
, t
b
)
Value-equivalent tuples (tuples with identical explicit attributes)
are not allowed
the full history of a fact is contained in a single tuple
 
The Bitemporal Conceptual Data Model
 
Example: Consider a relation recording
empolyee/department information
Employee Jake was hired in the shipping department for the
period from time 10 to time 15
This fact became current in the database at time 5
 
 
 
 
 
 
 
 
Arrows indicate that the tuple has not been deleted yet
 
The Bitemporal Conceptual Data Model
 
Example (contd.)
The 
personnel
 office discovers that Jake had really been hired
from time 5 to time 20
The database is corrected beginning at time 10
 
 
 
 
 
 
 
 
Later on at time 15 the HR department has been informed that the
original time was correct
 
The Bitemporal Conceptual Data Model
 
Example (contd.) 
At time point 19 the following updates are
performed (updates shall become effective at time 20):
Jake was not in the shipping department, but in the loading
department
The fact (Jake,Ship) is removed from the current state, and the fact
(Jake,Load) is inserted
A new employee Kate is hired for the shipping department for the
time from 25 to 30
 
The Bitemporal Conceptual Data Model
 
After the updates the bitemporal relation contains 3 facts and is given
below
 
 
 
 
 
 
 
     
 
    
dept
 
Updates in the BCDM
 
 
 
Update operations
New facts with a given valid timestamp are inserted to a relation
with now as transaction time chronon
As time passes by, the bitemporal elements associated with
current facts are updated
Facts are (logically) deleted by removing the chronons containing
now
 
Updates in the BCDM
 
Insert
Insert
: Record in a relation r a currently unrecorded fact
: Record in a relation r a currently unrecorded fact
(a
(a
1
1
, a
, a
2
2
, …, a
, …, a
n
n
) with validity t
) with validity t
v
v
Three cases are distinguished:
Three cases are distinguished:
1.
If 
If 
(a
(a
1
1
, a
, a
2
2
, …, a
, …, a
n
n
) 
) 
was never recorded, a new tuple is appended
was never recorded, a new tuple is appended
2.
If 
If 
(a
(a
1
1
, a
, a
2
2
, …, a
, …, a
n
n
)
)
 was part of some previously current state, the
 was part of some previously current state, the
tuple recording is updated
tuple recording is updated
3.
If 
If 
(a
(a
1
1
, a
, a
2
2
, …, a
, …, a
n
n
)
)
 is already current in the database, a modification
 is already current in the database, a modification
is required (and the insertion is rejected)
is required (and the insertion is rejected)
 
Updates in the BCDM
 
ts_update
ts_update
: Special routine to add new chronons as time
: Special routine to add new chronons as time
goes by
goes by
Applied to all bitemporal relations at each clock tick
Applied to all bitemporal relations at each clock tick
Updates the timestamps to include the new transaction-time value
Updates the timestamps to include the new transaction-time value
Each bitemporal chronon with a transaction time of now produces
Each bitemporal chronon with a transaction time of now produces
an appended bitemporal chronon with now replaced with the
an appended bitemporal chronon with now replaced with the
current transaction time
current transaction time
 
 
 
 
 
Example: 
Example: 
Department relation at time 19 and 20
Department relation at time 19 and 20
 
Updates in the BCDM
 
Delete
Delete
: Logical removal of a tuple from the current valid-
: Logical removal of a tuple from the current valid-
time state
time state
Delete all chronons (now, c
Delete all chronons (now, c
v
v
) from the timestamp of the tuple
) from the timestamp of the tuple
(
(
c
c
v
v
 is some valid-time chronon)
 is some valid-time chronon)
The timestamp is not expanded by subsequent invocations of
The timestamp is not expanded by subsequent invocations of
ts_update, and the tuple will not appear in future valid-time states
ts_update, and the tuple will not appear in future valid-time states
 
 
 
 
 
 
 
Modify
Modify
: Modification of a current tuple
: Modification of a current tuple
 
Updates in the BCDM
 
Example: The istance of the department relation
dept
 
is created by the following sequence of
commands
 
Concrete Temporal Data Models
 
 
The 
abstract 
Bitemporal Conceptual Data Model
needs conversion into a representational or
concrete
 temporal data model to be implemented
in a DBMS
 
The BCDM is a unifying framework for studying
and comparing different temporal data models
 
Mappings have been provided for most of the
concrete temporal data models proposed in the
literature
 
Tuple Timestamped Model [Snodgrass]
 
Supports valid time and transaction time
Supports valid time and transaction time
Adds four atomic-valued attributes to each relation
Adds four atomic-valued attributes to each relation
Start and end point of the valid time: Vs ,Ve
Start and end point of the valid time: Vs ,Ve
Start and end point of the transaction time: Ts ,Te
Start and end point of the transaction time: Ts ,Te
Schema: R = (A1, . . . , An, 
Schema: R = (A1, . . . , An, 
Ts ,Te ,Vs ,Ve
Ts ,Te ,Vs ,Ve
)
)
Timestamping attributes Ts, Te, Vs, Ve have been also
Timestamping attributes Ts, Te, Vs, Ve have been also
called differently (e.g. In, Out, From, To, respectively)
called differently (e.g. In, Out, From, To, respectively)
Ts, Te (Vs, Ve, resp.) represent the endpoints of a
Ts, Te (Vs, Ve, resp.) represent the endpoints of a
transaction (valid, resp.) time period, which is usually
transaction (valid, resp.) time period, which is usually
considered open to the right
considered open to the right
Hence Ts ,Te ,Vs ,Ve represent the bitemporal chronons
Hence Ts ,Te ,Vs ,Ve represent the bitemporal chronons
(a bitemporal chronon is a two-dimensional time point)
(a bitemporal chronon is a two-dimensional time point)
of the corresponding rectangular region [Ts,Te) x [Vs,Ve)
of the corresponding rectangular region [Ts,Te) x [Vs,Ve)
1NF relations
1NF relations
 
Tuple Timestamped Model
 
A closed region in a two dimensional space (TT x VT)
must be represented by a set of rectangles
any bitemporal chronon in x.T is contained in at least one
rectangle
each bitemporal chronon in a rectangle is contained in x.T
Various coverings of a 2D area are possible:
Overlapping versus non-overlapping rectangles
Partitioning by transaction time versus partitioning by valid time
 
 
 
 
 
 
 
 
Partitioning by TT (VT) yields maximal segments in VT (TT) direction
 
Tuple Timestamped Model
 
 
Example: Department relation in the tuple timestamped
data model, using partitioning by transaction time
 
 
  dept
 
 
 
 
 
 
 
 
Once the partitioning criterion has been chosen, a unique
mapping from the BCDM is defined
 
Backlog-based Data Model [Jensen]
 
Supports valid time and transaction time
Supports valid time and transaction time
Adds four atomic-valued attributes to each relation
Adds four atomic-valued attributes to each relation
Start and end point of the valid time (Vs ,Ve)
Start and end point of the valid time (Vs ,Ve)
Transaction time when the tuple was inserted into the backlog (T)
Transaction time when the tuple was inserted into the backlog (T)
An operation which is either insert or delete (Op)
An operation which is either insert or delete (Op)
Schema: R = (A1, . . . , An, 
Schema: R = (A1, . . . , An, 
Vs ,Ve ,T, Op
Vs ,Ve ,T, Op
)
)
Tuples in backlogs are never updated, i.e. backlogs are
Tuples in backlogs are never updated, i.e. backlogs are
append-only 1NF relations
append-only 1NF relations
The fact in an insertion request is current starting at the
The fact in an insertion request is current starting at the
transaction’s timestamp and until a matching delete
transaction’s timestamp and until a matching delete
request is recorded
request is recorded
 
 
 
T is the commit time of the transaction executing Op
T is the commit time of the transaction executing Op
 
Backlog-based Data Model
 
Example: Department relation in the backlog-based data
model
 
 
  dept
 
 
 
 
 
 
 
 
 
 
 
Implicitly does partitioning by TT in mapping from the BCDM
 
Attribute Timestamped Data Model [Gadia]
 
Supports valid time and transaction time
Schema:
 
R = ({(TT1 x VT1, A1)}, . . . , {(TTn x VTn, An)})
A tuple is composed of n sets
Each set element is composed of a bitemporal period
(e.g. [Ts,Te) x [Vs,Ve) ) and an attribute value
N1NF relations (e.g. suitable to OODB or XML)
 
A relation might be restructured (regrouped) on different
attributes
For example, group by department rather than employee yields
facts for each department
 
Attribute Timestamped Data Model
 
Example: Department relation in the attribute
timestamped data model
 
 
dept
 
 
 
 
 
 
 
 
 
 
 
Attribute Timestamped Data Model
 
Temporal elements can also be used as timestamps
 
 
dept
 
 
 
 
 
 
 
 
The mapping from the BCDM is univocally defined once we
have chosen the form of the periods (e.g. closed or open
to the right)
 
 
 
 
 
 
 
 
 
Slide Note
Embed
Share

Explore the concepts of temporal data models and time dimensions in databases, covering topics such as data structures, query languages, different timestamp types, valid time, and transaction time. Learn about the importance of supporting various time aspects in database systems and the complexities involved in modeling temporal data effectively.

  • Temporal data
  • Time dimensions
  • Database systems
  • Query languages
  • Valid time

Uploaded on Oct 05, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Temporal Data Models Fabio Grandi fabio.grandi@unibo.it DISI, Universit di Bologna A short course on Temporal Databaes for DISI PhD students, 2016 Credits: most of the materials used is taken from slides prepared by Prof. M. B hlen (Univ. of Zurich, Switzerland)

  2. Temporal Data Models Data model: DM = (DS, QL) DS is a set of data structures QL is a language for querying and updating the data structures Example: the relational data model is composed of relations and SQL (or relational algebra) Many extensions of the relational data model to support time have been proposed

  3. Temporal Data Models Several modeling aspects have to be considered Different Time dimensions Different Timestamp types Tuple versus Attribute timestamping (Ungrouped versus Grouped model?) Point-based versus Period-based model (Atelic versus Telic data?) The different modeling aspects lead to subtle and difficult issues. There are pros and cons in all cases (no consensus can be reached)

  4. Time Dimensions Time in a TDB is multi-dimensional: valid time, transaction time, event/decision time, publication time, efficacy time, user-defined time Different time dimensions are of practical interest in different application fields The key question is: which time aspects are sufficiently important so that they should be supported by the database system? There is a broad consensus that transaction time and valid time are the most important time dimensions

  5. Valid Time Valid time is the time a fact was/is/will be true in the modeled reality or mini-world A fact is a statement that is either true or false A relation is a collection of facts Example: John has been hired on October 1, 2014 Valid time captures the time-varying states of the mini-world All facts have a valid time by definition, however, it might not be recoreded in the database Valid time is independent of the recording of the fact in a database Valid time is either bounded (does not extend until infinity) or unbounded (extends until infinity) Future facts can be represented (stated or forecasted)

  6. Transaction Time Transaction time is the time when a fact is current/present in the database as stored data Example: the fact John was hired on October 1, 2014 was stored in the DB on October 5, 2014, and has been deleted on March 31, 2015 Transaction time has a duration: from insertion to deletion, with multiple insertions and deletions being possible for the same fact With transaction time deletions of facts are purely logical the fact remains in the database, but ceases to be part of the database current state. Transaction time captures the time-varying states of the database Always bounded on both ends Starts when the database is created (nothing was stored before) Does not extend past now (no facts are known to have been stored in the future) Basis for supporting accountability and traceability requirements, e.g. in financial, medical, legal applications Should be supplied and managed automatically by the DBMS

  7. Dimensions of Time A data model can support none, one, two, or more of these time dimensions Snapshot data model: None of the time dimensions is supported Represents a single snapshot of the reality and the database Valid time data model: Supports only valid time Transaction time data model: Supports only transaction time Bitemporal data model: Supports valid time and transaction time In a former terminology [Snodgrass & Ahn 1986]: Historical DB valid-time DB Rollback DB transaction-time DB Temporal DB bitemporal DB A DB where snapshot, transaction-time, valid-time and bitemporal relations coexist can be called a multi- temporal database

  8. Temporal Relations A pictorial representation of the 4 kinds of temporal table and evolution along the time axes snapshot table transaction-time table valid-time table bitemporal table

  9. Dimensions of Time Which time dimensions are needed by an application? (what can be done and what cannot be done?) Consider the following example involving the career of an employee: 1. John was hired as a programmer (PRG) with initial salary 2000 at time 1; 2. John s salary was raised to 3000 at time 3 (but recorded in the DB at time 4); 3. John became a database administrator (DBA) at time 6. Notice that 2. involves a retroactive update

  10. In a Transaction-time DB 1. John was hired as a programmer (PRG) with initial salary 2000 at time 1; 2. John s salary was raised to 3000 at time 3 (but recorded in the DB at time 4); 3. John became a database administrator (DBA) at time 6. Emp Name John John John Name John Name John John Job PRG PRG Job PRG Job PRG PRG DBA Salary 2000 3000 Salary 2000 3000 3000 Salary 2000 TT [1,Now] TT [1,3] [4,Now] TT [1,3] [4,5] [6,Now] The time of the change 2. is incorrectly represented

  11. In a Valid-time DB 1. John was hired as a programmer (PRG) with initial salary 2000 at time 1; 2. John s salary was raised to 3000 at time 3 (but recorded in the DB at time 4); 3. John became a database administrator (DBA) at time 6. Emp Name John Name John John Job PRG PRG Job PRG Salary 2000 Salary 2000 3000 VT [1,2] [3,Now] VT [1,Now] Name John John John Job PRG PRG DBA Salary 2000 3000 3000 VT [1,2] [3,5] [6,Now] The validity of changes is correctly represented but there is no way to know that change 2. was retroactive

  12. In a Bitemporal DB 1. John was hired as a programmer (PRG) with initial salary 2000 at time 1; 2. John s salary was raised to 3000 at time 3 (but recorded in the DB at time 4); 3. John became a database administrator (DBA) at time 6. 1 3 6 corner under the diagonal (i.e. VT.Start < TT.Start): retroactive transaction VT 1 PRG, 2000 4 PRG, 3000 6 DBA, 3000 TT

  13. In a Bitemporal DB 1. John was hired as a programmer (PRG) with initial salary 2000 at time 1; 2. John s salary was raised to 3000 at time 3 (but recorded in the DB at time 4); 3. John became a database administrator (DBA) at time 6. Emp Name John John John John John Name John Name John John John Job PRG PRG PRG PRG DBA Job PRG Job PRG PRG PRG Salary 2000 Salary 2000 2000 3000 3000 3000 Salary 2000 2000 3000 TT [1,Now] TT [1,3] [4,Now] [4,5] [6,Now] [6,Now] TT [1,3] [4,Now] [4,Now] VT [1,Now] VT [1,Now] [1,2] [3,Now] [3,5] [6,Now] VT [1,Now] [1,2] [3,Now]

  14. Choice of Temporal Dimensions A Transaction-time DB allows user to only effect immediate (on-time) transactions; proactive transactions are physically impossible and retroactive transactions store data histories with a wrong validity A Valid-time DB allows users to execute retro-/pro-active transactions (validity of modifications aka applicability period is expressed by users via the DML); after its execution, there is no way to know whether a transaction was immediate or retro/pro-active A Bitemporal DB allows users to execute retro-/proactive transactions and to keep track of their execution in the DB

  15. Other Time Dimensions Event Time [Chakravarthy & Kim 94] aka Decision Time [Nascimento & Eich 95] Considering the event E causing the change of some data with some validity (in the mini-world and in the DB): E occurs at time T in the mini-world (Decision/Event Time) E occurs at time T T in the DB (Transaction Time) E/D-T vs VT (=,<,>): current, futuristic, past due TT vs VT (=,<,>): immediate, proactive, retroactive E/D-T vs TT (=,<,>): instantaneous, late, N/A In specific application domains, other time dimensions can be of interest (e.g. Efficacy time in the legal field)

  16. Event vs State Temporal Relations Moreover, in a TDB there can be two kinds of temporal relations: Event tables, with instant timestamps (store information about facts without duration) State tables, with period or element timestamps Event table are suitable to store measures, sensor data, departure/transit/arrival times Departures Flight Time 2015-08-01 12:30 2015-09-10 11:15 2016-01-01 16:40 Departures 100 55 256

  17. Temporal Relations In the following, we focus on state tables An implicit continuity assumption is often done (data values as produced by an insertion or update are assumed to persist until they are changed or deleted, e.g. salary of an employee) Emp Name Tom Ann Ann Dept SE DB DB Salary 2300 3200 3400 Time [1/1/12, 1/1/16) [1/1/10, 1/1/15) [1/1/15, Now]

  18. Timestamping A timestamp is a value that is associated with data in a database Captures some temporal aspect, e.g. valid time, transaction time Represented as one or more attributes/columns of a relation Three different types of timestamps are widely used Time points Time periods Temporal elements Two different ways of timestamping Tuple timestamping Attribute timestamping Temporally grouped models are not based on timestamping (but adopt a functional approach similar to attribute timestamping though)

  19. Timestamping Example: Videogame store where customers, identified by a CustID, rent videogames, identified by a GameNo. Consider the following rentals during May 2015: On 3rd of May, customer C101 rents game G1234 for three days On 5th of May, customer C102 rents game G1245 for 3 days From 9th to 12th of May, customer C102 rents game G1234 From 19th to 20th of May, and again from 21st to 22nd of May, customer C102 rents game G1245 These rentals are stored in a relation CheckOut which is graphically illustrated below (C101, G1234) (C102, G1245) (C102, G1245) (C102, G1234) (C102, G1245)

  20. Tuple Timestamping with Points CustID C101 C101 C101 C102 C102 C102 C102 C102 C102 C102 C102 C102 C102 C102 GameNo G1234 G1234 G1234 G1245 G1245 G1245 G1234 G1234 G1234 G1234 G1245 G1245 G1245 G1245 Time 3 4 5 5 6 7 9 10 11 12 19 20 21 22 Point-based data model: each tuple is timestamped with a time point/instant Most basic and simple data model Timestamps are atomic values that can be easily compared, using =, <>, >, <, >=, <= Multiple tuples are used if a fact is valid at several time points Syntactically different relations store different information Provides an abstract view of a DB and is not meant for physical implementation Conceptual simplicity and computational complexity make it popular for theoretical studies

  21. Tuple Timestamping with Points Rental R1 R1 R1 R2 R2 R2 R3 R3 R3 R3 R4 R4 R5 R5 CustID C101 C101 C101 C102 C102 C102 C102 C102 C102 C102 C102 C102 C102 C102 GameNo Time G1234 G1234 G1234 G1245 G1245 G1245 G1234 G1234 G1234 G1234 G1245 G1245 G1245 G1245 3 4 5 5 6 7 9 10 11 12 19 20 21 22 The reconstruction of the original relation is not always possible The table on the previous slide makes it impossible to determine if C102 rented G1245 once or twice in the period from 19 to 22 Additional attributes are required, e.g. Rental to represent the individual rentals It is difficult to predict when an additional attribute is needed

  22. Tuple Timestamping with Periods Period-based (interval-based) data model: each tuple is timestamped with a time period CheckOut CustID C101 C102 C102 C102 C102 GameNo G1234 G1245 G1234 G1245 G1245 Time [3,5] [5,7] [9,12] [19,20] [21,22] Timestamps are atomic values that can be compared using Allen s 13 basic relationships between periods (before, meets, during, etc.) More convenient than comparing the endpoints of the periods The benefits of Allen s predicates are relatively small

  23. Tuple Timestamping with Periods The start and end of an interval are distinguished change points The Rental attribute is not needed to distinguish different checkouts Multiple tuples are used if a fact is valid over disjoint time periods Cannot model a single checkout with a gap The most popular model from an implementation perspective (even in SQL89, with two columns Start, End) Time periods are not closed under all set operations Ex. subtracting [5, 7] from [1, 9] returns a set of periods { [1, 4], [8, 9] }

  24. Tuple Timestamping with Temporal Elements Data model with temporal elements: each tuple is timestamped with a temporal element, that is a finite set of time periods CheckOut CustID GameNo C101 G1234 C102 G1245 C102 G1234 CheckOut CustID GameNo C101 G1234 C102 G1245 C102 G1234 Time [3,5] [5,7] U [19,22] [9,12] Time { [3,5] } { [5,7], [19,22] } { [9,12] } The full history of a fact is stored in one tuple Usually the periods of a temporal element must be disjoint and non-adjacent (i.e. element = union of maximal disjoint periods). This makes it similar to point timestamps

  25. Attribute Timestamping Attribute value timestamping: each attribute value is timestamped with a set of time points/periods All information about a real-world object is captured in a single tuple e.g. all information about a customer in a tuple of the relation below; each tuple is timestamped with a temporal element, that is a finite set/union of time periods CheckOut CustID C101 { [3,5] } C102 { [5,7], [9,12], [19,22] } Rental R1 { [3,5] } R2 { [5,7] } R3 { [9,12] } R4 { [19,20] } R5 { [21,22] } GameNo G1234 { [3,5] } G1245 { [5,7], [19,22] } G1234 { [9,12] }

  26. Attribute Timestamping Notice that a single tuple may record multiple facts e.g. the second tuple records the following facts: rental information for customer C102 for the games G1245 and G1234, and four different checkouts CheckOut CustID C101 { [3,5] } C102 { [5,7], [9,12], [19,22] } Rental R1 { [3,5] } R2 { [5,7] } R3 { [9,12] } R4 { [19,20] } R5 { [21,22] } GameNo G1234 { [3,5] } G1245 { [5,7], [19,22] } G1234 { [9,12] } Non-first-normal-form (N1NF) data model In a previous terminology: Homogeneous model tuple timestamping Inhomogeneous model attribute timestamping

  27. Attribute Timestamping Different groupings of the information into tuples are possible for attribute-value timestamping Information about other objects is spread across several tuples (e.g. information about videogames) e.g. regrouping the CheckOut table on GameNo in the example below CheckOut CustID C101 { [3,5] } C102 { [9,12] } C102 { [5,7], [19,22] } Rental R1 { [3,5] } R3 { [9,12] } R2 { [5,7] } R4 { [19,20] } R5 { [21,22] } GameNo G1234 { [3,5], [9,12] } G1245 { [5,7], [19,22] } (such an operation is, in general, problematic!)

  28. Temporally Grouped Model In a temporally grouped (or history-oriented) data model the temporal dimension is implicit in the structure of data representation data objects are substituted by their histories (ID not necessary) attributes can be regarded as partial functions that map time into data domains Rental R1 R2 R3 R4 R5 CustID { [3,5] } C101 { [5,7] } C102 { [9,12] } C102 { [19,20] } C102 { [21,22] } C102 GameNo { [3,5] } G1234 { [5,7] } G1245 { [9,12] } G1234 { [19,20] } G1245 { [21,22] } G1245 Temporal models based on addition of timestamping columns can be considered ungrouped

  29. Temporally Grouped Model A temporally grouped model is strictly more expressive than an ungrouped data model Ex. If we project the CheckOut relation on CustID: CustID { [3,5] } C101 { [5,7] } C102 { [9,12] } C102 { [19,20] } C102 { [21,22] } C102 We still know that such tuples involve 5 different rentals: the last two tuples do not merge as they belong to different groups (i.e. checkouts) In an ungrouped models the last two tuples can be coalesced and we lose such information A temporally grouped model is difficult to implement History IDs (e.g. surrogates) are needed to represent grouped data in a 1NF relation Operations (e.g. join) are problematic to define with HIDs A N1NF (e.g. XML) database would be needed

  30. Point- versus Period-based Data Model In a point-based data model, truth value of facts is associated to time points Tuple timestamping with periods (or elements) can be used as a compact representation or normalization tool Adjacent or overlapping value-equivalent tuples can be coalesced to obtain a canonical representation A fact true in [S,E] is true at any instant t [S,E] In a period-based (or interval-based) data model, period timestamps are first-class objects and truth value of facts can be associated to whole time periods

  31. Period-based Data Model In a weak interpretation, period timestamps are first-class objects Although the truth value of facts is point-based, it is important to preserve (e.g. for lineage/provenance management) the individuality of period boundaries through operations, as they are reminiscent of change events (initiation and termination) Ex. promotion or retirement for salary changes In a strong interpretation, period timestamps are used to represent telic facts

  32. Atelic versus Telic Temporal Data Atelic data is temporal data that describe facts that do not involve a goal or culmination (e.g. have a job, salary) Atelic data enjoy the downward and upward inheritance properties Downward inheritance: fact valid in period T is also valid in any subset of T (and at any instant of T) Upward inheritance: a fact valid in consecutive or overlapping periods T1 and T2 is also valid in T1 U T2 Telic data are temporal data for which downward and upward inheritance properties do not hold Telic data represent accomplishments or achievements Examples of telic facts: the Golden Gate bridge was built from January 1933 to April 1937 John had a phleboclysis of 500mg of drug X from 10:30 to 11:45

  33. The Bitemporal Conceptual Data Model The goal of the Bitemporal Conceptual Data Model (BCDM) is to capture the essential semantics of time- varying relations The BCDM is not intended for presentation, storage, or query evaluation purposes The goal of the BCDM is similar to the goal of abstract temporal databases Chomicki [2009] proposed the notions of abstract and concrete temporal databases to separate semantics and representation Semantics associated with periods is not possible in the BCDM (it is a point-based data model)

  34. The Bitemporal Conceptual Data Model Bitemporal Conceptual Data Model (BCDM) Supports valid time and transaction time Both time domains are linear and discrete Valid-time domain: DVT= { t1, t2, , tk} Transaction-time domain: DTT= { t 1, t 2, , t j} U {now} A bitemporal chronon is a pair of a transaction-time chronon and a valid-time chronon (ti, tj) DTTx DVT "tiny rectangle" in the two-dimensional space A bitemporal element is a set of bitemporal chronons Timestamp attribute T with domain of bitemporal elements Explicit (non-timestamp) attributes Names: DA= { A1, A2, , An} BCDM schema: (A1, A2, , An,T) BCDM tuple: (a1, a2, , an, tb) Value-equivalent tuples (tuples with identical explicit attributes) are not allowed the full history of a fact is contained in a single tuple

  35. The Bitemporal Conceptual Data Model Example: Consider a relation recording empolyee/department information Employee Jake was hired in the shipping department for the period from time 10 to time 15 This fact became current in the database at time 5 Arrows indicate that the tuple has not been deleted yet

  36. The Bitemporal Conceptual Data Model Example (contd.) The personnel office discovers that Jake had really been hired from time 5 to time 20 The database is corrected beginning at time 10 Later on at time 15 the HR department has been informed that the original time was correct

  37. The Bitemporal Conceptual Data Model Example (contd.) At time point 19 the following updates are performed (updates shall become effective at time 20): Jake was not in the shipping department, but in the loading department The fact (Jake,Ship) is removed from the current state, and the fact (Jake,Load) is inserted A new employee Kate is hired for the shipping department for the time from 25 to 30

  38. The Bitemporal Conceptual Data Model After the updates the bitemporal relation contains 3 facts and is given below dept Emp Dept Jake Ship T {(5,10), ,(5,15), ,(9,10), ,(9,15), (10,5), ,(10,20), ,(14,5), ,(14,20), (15,10), ,(15,15), ,(19,10), ,(19,15)} {(now,10), ,(now,15)} Jake Load Kate Ship {(now,25), ,(now,30)}

  39. Updates in the BCDM Update operations New facts with a given valid timestamp are inserted to a relation with now as transaction time chronon As time passes by, the bitemporal elements associated with current facts are updated Facts are (logically) deleted by removing the chronons containing now

  40. Updates in the BCDM Insert: Record in a relation r a currently unrecorded fact (a1, a2, , an) with validity tv Three cases are distinguished: 1. If (a1, a2, , an) was never recorded, a new tuple is appended 2. If (a1, a2, , an) was part of some previously current state, the tuple recording is updated 3. If (a1, a2, , an) is already current in the database, a modification is required (and the insertion is rejected)

  41. Updates in the BCDM ts_update: Special routine to add new chronons as time goes by Applied to all bitemporal relations at each clock tick Updates the timestamps to include the new transaction-time value Each bitemporal chronon with a transaction time of now produces an appended bitemporal chronon with now replaced with the current transaction time Example: Department relation at time 19 and 20

  42. Updates in the BCDM Delete: Logical removal of a tuple from the current valid- time state Delete all chronons (now, cv) from the timestamp of the tuple (cvis some valid-time chronon) The timestamp is not expanded by subsequent invocations of ts_update, and the tuple will not appear in future valid-time states Modify: Modification of a current tuple

  43. Updates in the BCDM Example: The istance of the department relation dept is created by the following sequence of commands Operation insert(dept, ("Jake","Ship"), [10,15]) modify(dept, ("Jake","Ship"), [5,20]) modify(dept, ("Jake","Ship"), [10,15]) delete(dept, ("Jake","Ship")) insert(dept, ("Jake","Load"), [10,15]) insert(dept, ("Kate","Ship"), [25,30]) TT 5 10 15 20 20 20

  44. Concrete Temporal Data Models The abstract Bitemporal Conceptual Data Model needs conversion into a representational or concrete temporal data model to be implemented in a DBMS The BCDM is a unifying framework for studying and comparing different temporal data models Mappings have been provided for most of the concrete temporal data models proposed in the literature

  45. Tuple Timestamped Model [Snodgrass] Supports valid time and transaction time Adds four atomic-valued attributes to each relation Start and end point of the valid time: Vs ,Ve Start and end point of the transaction time: Ts ,Te Schema: R = (A1, . . . , An, Ts ,Te ,Vs ,Ve) Timestamping attributes Ts, Te, Vs, Ve have been also called differently (e.g. In, Out, From, To, respectively) Ts, Te (Vs, Ve, resp.) represent the endpoints of a transaction (valid, resp.) time period, which is usually considered open to the right Hence Ts ,Te ,Vs ,Ve represent the bitemporal chronons (a bitemporal chronon is a two-dimensional time point) of the corresponding rectangular region [Ts,Te) x [Vs,Ve) 1NF relations

  46. Tuple Timestamped Model A closed region in a two dimensional space (TT x VT) must be represented by a set of rectangles any bitemporal chronon in x.T is contained in at least one rectangle each bitemporal chronon in a rectangle is contained in x.T Various coverings of a 2D area are possible: Overlapping versus non-overlapping rectangles Partitioning by transaction time versus partitioning by valid time Partitioning by TT (VT) yields maximal segments in VT (TT) direction

  47. Tuple Timestamped Model Example: Department relation in the tuple timestamped data model, using partitioning by transaction time dept Emp Jake Jake Jake Jake Kate Dept Ship Ship Ship Load Ship Ts 5 10 15 20 20 Te 10 15 20 Now Now Vs 10 5 10 10 25 Ve 15 20 15 15 30 Once the partitioning criterion has been chosen, a unique mapping from the BCDM is defined

  48. Backlog-based Data Model [Jensen] Supports valid time and transaction time Adds four atomic-valued attributes to each relation Start and end point of the valid time (Vs ,Ve) Transaction time when the tuple was inserted into the backlog (T) An operation which is either insert or delete (Op) Schema: R = (A1, . . . , An, Vs ,Ve ,T, Op) Tuples in backlogs are never updated, i.e. backlogs are append-only 1NF relations The fact in an insertion request is current starting at the transaction s timestamp and until a matching delete request is recorded T is the commit time of the transaction executing Op

  49. Backlog-based Data Model Example: Department relation in the backlog-based data model dept Emp Jake Jake Jake Jake Jake Jake Jake Kate Dept Ship Ship Ship Ship Ship Ship Load Ship Ts 10 10 5 5 10 10 10 25 Te 15 15 20 20 15 15 15 30 T 5 10 10 15 15 20 20 20 Op I D I D I D I I Implicitly does partitioning by TT in mapping from the BCDM

  50. Attribute Timestamped Data Model [Gadia] Supports valid time and transaction time Schema: R = ({(TT1 x VT1, A1)}, . . . , {(TTn x VTn, An)}) A tuple is composed of n sets Each set element is composed of a bitemporal period (e.g. [Ts,Te) x [Vs,Ve) ) and an attribute value N1NF relations (e.g. suitable to OODB or XML) A relation might be restructured (regrouped) on different attributes For example, group by department rather than employee yields facts for each department

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#