BCDM Temporal Domains - Time is linear and totally ordered - Chronons are the basic time unit - Time domains are isomorphic to subsets of the domain of.

Slides:



Advertisements
Similar presentations
Extending Temporal Databases to Deal with Telic/Atelic Medical Data Paolo Terenziani 1, Richard T. Snodgrass 2, Alessio Bottrighi 1, Mauro Torchio 3, Gianpaolo.
Advertisements

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
From Handbook of Temporal Reasoning in Artificial Intelligence By Jan Chomicki & David Toman Temporal Databases Presented by Leila Jalali CS224 presentation.
COMP 521 F10 Final Exam Review. 1. Which of the following is defined as a property or description of an entity. A. RelationB. Attribute C. DomainD. Selection.
1 Efficient Temporal Coalescing Query Support in Relational Database Systems Xin Zhou 1, Carlo Zaniolo 1, Fusheng Wang 2 1 UCLA, 2 Simens Corporate Research.
Advanced Databases Temporal Databases Dr Theodoros Manavis
Temporal and Real-Time Databases: A Survey by Gultekin Ozsoyoglu and Richard T. Snodgrass Presentation by Didi Yao.
Time in Databases CSCI 6442 With thanks to Richard Snodgrass, 1985 ACM /85/005/0236.
Normalisation The theory of Relational Database Design.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
The Relational Model System Development Life Cycle Normalisation
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
Event Processing Course Event Types (relates to chapter 3)
1 C. Shahabi CSCI599-Fall2000 Introduction to Temporal Database Research by Cyrus Shahabi from Christian S. Jensen’s Chapter 1.
Database Systems More SQL Database Design -- More SQL1.
Databases 6: Normalization
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
The need for Temporal Databases (1)Need for coping with temporal data (both VT and TT) (2)Just adding 1 (or 2, or 4) temporal attributes (and maybe some.
Applying formal methods to clinical guidelines: the case of temporal information Paolo Terenziani Dipartimento di Informatica, Univ. del Piemonte Orientale.
LOGICAL DATABASE DESIGN
Midterm 1 Concepts Relational Algebra (DB4) SQL Querying and updating (DB5) Constraints and Triggers (DB11) Unified Modeling Language (DB9) Relational.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch Via Yoonsuck Choe.
Week 6 Lecture Normalization
Functional Dependencies
National Survey and Cadastre – Denmark Conceptual Modeling of Geographic Databases - Emphasis on Relationships among Geographic Databases Anders Friis-Christensen.
Introduction to Accounting Information Systems
The Telic\Atelic Distinction in Temporal Databases Paolo Terenziani Institute of Computer Science, DISIT, Univ. Piemonte Orientale “A. Avogadro”, Viale.
The Telic\Atelic Distinction in Temporal Databases Paolo Terenziani Institute of Computer Science, DISIT, Univ. Piemonte Orientale “A. Avogadro”, Viale.
FEN  Concepts and terminology  Operations (relational algebra)  Integrity constraints The relational model.
Recent research : Temporal databases N. L. Sarda
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 136 Database Systems I SQL Modifications and Transactions.
Fushen Wang, XinZhou, Carlo Zaniolo Using XML to Build Efficient Transaction- Time Temporal Database Systems on Relational Databases In Time Center, 2005.
1 Functional Dependencies and Normalization Chapter 15.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
SPATIO-TEMPORAL DATABASES Temporal Databases. Temporal Data. Modeling Temporal Data Temporal Semantics Temporal density: the time is seen as being: 
CS240A: Databases and Knowledge Bases Temporal Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
Temporal Data Modeling
Where does time go ?. Applications abound Temporal database systems provide built-in support for recording and querying time-varying information Application.
Ch 7: Normalization-Part 1
Lecture 03 Constraints. Example Schema CONSTRAINTS.
CS240A: Databases and Knowledge Bases TSQL2 Carlo Zaniolo Department of Computer Science University of California, Los Angeles Notes From Chapter 6 of.
1 The T4SQL Temporal Query Language Presented by 黃泰豐 2007/12/26.
Chap4 Temporal Database Chap 4: Temporal Extensions to the Relational Model and SQL.
The relational model1 The relational model Mathematical basis for relational databases.
Dr. T. Y. Lin | SJSU | CS 157A | Fall 2015 Chapter 3 Database Normalization 1.
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z.Yang Course Website: c3220m.htm Office: TEL.
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Temporal Data Models Fabio Grandi DISI, Università di Bologna A short course on Temporal Databaes for DISI PhD students, 2016 Credits:
SPECIAL PURPOSE DATABASES 13/09/ Temporal Database Concepts  Time is considered ordered sequence of points in some granularity Use the term choronon.
Copyright © 2004 Pearson Education, Inc.. Chapter 24 Enhanced Data Models for Advanced Applications.
Chapter 8: Concurrency Control on Relational Databases
Paolo Terenziani, Alessio Bottrighi, Stefania Montani
Light-weight Ontology Versioning with Multi-temporal RDF Schema
Chap 2: A Prelude to Parametric Data
Multi-temporal RDF Ontology Versioning
Temporal Databases.
Temporal Databases.
Data Model.
Chapter 19 (part 1) Functional Dependencies
Extending computer guideline system with advanced AI and DB facilities
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs
Presentation transcript:

BCDM Temporal Domains - Time is linear and totally ordered - Chronons are the basic time unit - Time domains are isomorphic to subsets of the domain of Natural numbers D VT = {t 1,t 2, …, t k }(valid time) D TT = {t’ 1,t’ 2, …, t’ h }  {UC} (transaction time) D TT  D VT (bitemporal chronons)

BCDM Data Attribute names: D A ={A 1, A 2, …, A n } Attribute domains D D ={D 1, D 2, …, D n } Schema of a bitemporal relation: R = A i1, A i2, …, A ij T Domain of a bitemporal relation: D i1  D i2  …  D ij  D TT  D VT Tuple of a relation r(R): x = (a 1, a 2, …, a j | t B )

BCDM Example. Relation Employee with Schema: (name,salary,T) “Andrea was earning 60K at valid times 10, 11, 12 Such a tuple has been inserted into Employee at time 12, and is current now (say now=13)” (Andrea, 60k | {(12,10), (12,11), (12,12),(13,10), (13,11), (13,12), ……}) VT TT

BCDM Example. Relation Employee with Schema: (name,salary,T) “Andrea was earning 60K at valid times 10, 11, 12 Such a tuple has been inserted into Employee at time 12, and is current now (say now=13)” (Andrea, 60k | {(12,10), (12,11), (12,12),(13,10), (13,11), (13,12), (UC,10), (UC,11), (UC,12)}) VT TT UC

BCDM Bitemporal relation: set of bitemporal tuples. Constraint: Value equivalent tuples are not allowed. (Bitemporal) DB: set of (bitemporal) relations

BCDM Semantics (another viewpoint) NameSalaryT Andrea60K{(12,10), (12,11), (12,12),(13,10), (13,11), (13,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)} (12,10)  {Employee(Andrea,60K)} (12,11)  {Employee(Andrea, 60K)} (12,12)  {Employee(Andrea, 60K), Employee(John,50K)} (12,13)  {Employee(John,50K)} (13,10)  {Employee(Andrea,60K)} (13,11)  {Employee(Andrea, 60K)} …….. (UC,12)  {Employee(Andrea, 60K)}

BCDM PROPERTIES Consistent extension (of “classical” SQL DB) A temporal DB is a set of “classical” DBs, one for each bitemporal chronon Uniqueness of representation (from the constraint about value equivalent tuples)

BCDM Semantics of UC e.g., the DB’s clock thicks time 14 NameSalaryT Andrea60K{(12,10), (12,11), (12,12), (13,10), (13,11),(13,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)} NameSalaryT Andrea60K{(12,10), (12,11), (12,12), (13,10), (13,11), (13,12), (14,10), (14,11), (14,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)}

UC semantics

Deletion

BCDM deletion (e.g., at time 15) delete(Employee, (Andrea,60K)) NameSalaryT Andrea60K{(12,10), (12,11), (12,12), (13,10), (13,11), (13,12), (14,10), (14,11), (14,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)} NameSalaryT Andrea60K{(12,10), (12,11), (12,12), (13,10), (13,11), (13,12), (14,10), (14,11), (14,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)}

Insertion

BCDM insertion (e.g., at time 16) insert(Employee, (Andrea,60K|{12,13})) insert(Employee, (Mary,70K|{16})) NameSalaryT Andrea60K{(12,10), (12,11), (12,12),(13,10), (13,11), (13,12), (14,10), (14,11), (14,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)} NameSalaryT Andrea60K{(12,10), (12,11), (12,12),(13,10), (13,11), (13,12), (14,10), (14,11), (14,12), (16,12),(16,13),(UC,12),(UC,13) } John50K{(12,12),(12, 13)} Mary70K{(16,16),(UC,16)}

BCDM π D (r)={z | ∃x  r (z[D]=x[D]) ∧ ∀ y  r (y[D]=z[D] ⇒ y[T]  z[T]) ∧ ∀ t  z[T] ∃y  r (y[D]=z[D] ∧ t  y[T])} Algebraic Operators (Ex. Projection) - No value-equivalent tuple generated (uniqueness of representation!) - Coalescing!

Example

BCDM BCDM algebraic operators are a consistent extension of SQL’s ones (reducibility and equivalence) Algebraic Operators Properties

BCDM Reducibility rTrT ρ t T (r T ) ρtTρtT op T (r T ) op T op op(ρ t T (r T )) ρtTρtT ρ t T (op T (r T )) =

BCDM Equivalence r τtτt τ t (r) op T op op(r) τtτt τ t (op(r))=op T (τ t (r))

BCDM PROBLEM Semantically clear but ….. inefficient (not suitable for a “direct” implementation) (1) Not 1-NF (2) UC (at each thick of the clock, all current tuples should be updated!)

Task An efficient implementation must be devised The implementation must be proven to respect the semantics. Core issue here: efficient (1-NF) implementations hardly grant uniqueness of representation.

An example of implementation: TSQL2 (Snodgrass et al., 1995) Temporal attribute T  four temporal attributes (TT S, TT E, VT S, VT E ) Attribute value: a timestamp or UC Bitemporal tuple: A 1,….A n | TT S, TT E, VT S, VT E Bitemporal relation: set of bitemporal tuples Notice: value-equivalent tuples are allowed!

An example of implementation: TSQL2 (Snodgrass et al., 1995) NameSalaryT Andrea60K{(12,10), (12,11), (12,12),(13,10), (13,11), (13,12), (UC,10), (UC,11), (UC,12)} John50K{(12,12),(12, 13)} NameSalaryTT S TT E VT S VT E Andrea60K12UC1012 John50K12 13 SEMANTICS BCDM TSQL2

Semantics of TSQL2 representation

From BCDM to TSQL2

Property

Insertion and Deletion in TSQL2

An example of implementation: TSQL2 (Snodgrass et al., 1995) Efficient implementation (data model): - 1-NF - UC managed efficiently - clear semantics (mapping onto BCDM) BUT to get efficiency, we loose the uniqueness of representation property

Problem: no uniqueness of representation NameSalaryT Andrea60K{(10,2), (10,3), (11, 2),(11,3), (12,1), (12,2),(12,3),(12,4),(13,1),(13,2),(13,3),(13,4)} NameSalaryTT S TT E VT S VT E Andrea60K Andrea60K12UC14 NameSalaryTT S TT E VT S VT E Andrea60K12UC11 Andrea60K10UC23 Andrea60K12UC44 BCDM SEMANTICS TSQL2 (a) TSQL2 (b) Example. At time 10, the fact that Andrea earned 60K from 2 to 3 inserted in Employee. At time 12, such a tuple is updated: Andrea earned 60K from 1 to 4. At time 13, the tuple is (logically) deleted.

Problem: no uniqueness of representation VT TT TSQL2 implementation: “covering” rectangles

Problem: no uniqueness of representation VT TT TSQL2 Representation (a) NameSalaryTT S TT E VT S VT E Andrea60K Andrea60K12UC14

Problem: no uniqueness of representation VT TT TSQL2 Representation (b) NameSalaryTT S TT E VT S VT E Andrea60K12UC11 Andrea60K10UC23 Andrea60K12UC44

Problem: no uniqueness of representation VT TT Other TSQL2 Representations!!

Problem: no uniqueness of representation NameSalaryTT S TT E VT S VT E Andrea60K Andrea60K12UC14 NameSalaryTT S TT E VT S VT E Andrea60K12UC11 Andrea60K10UC23 Andrea60K12UC44 Potentially, an enormous problem! e.g., Return all employees earning more than 50K for at most 3 consecutive time chronons NameTT S TT E VT S VT E Andrea12UC14 ?

Problem: no uniqueness of representation One must grant that the temporal DB implementation respects its underlying semantics, independently of the representation DB1 DB2 op 1, …, op k DB1’ DB2’ op 1, …, op k Given two “semantically equivalent” temporal DBs, and given any sequence of operations, the results are always “semantic equivalent” Otherwise …..We cannot trust DB’s results!

Problem: no uniqueness of representation Solution. Step 1. Formal definition of “semantic equivalence” Snapshot equivalence: Informally: two relations (Databases) are snapshot equivalent if they are identical at each bitemporal chronon

Problem: no uniqueness of representation Solution. Step 2. Definition of manipulation and algebraic operators that preserve snapshot equivalence e.g., proofs given about TSQL2 (bitemporal) operators rB1rB1 rB2rB2 op B i op B i (r B 1 ) op B i (r B 2 ) snapshot equivalent snapshot equivalent

Snapshot Equivalence Valid-timeslice operator σ B t1 (r) = {z (n+1) |  x  r (z[A]=x[A]  z[T v ] = {t2 | (t1, t2)  x[T]}  z[T v ]  } Transaction-timeslice operator

Snapshot Equivalence

Uniqueness of representation (BCDM)

Timeslice operators in TSQL2

TSQL2 property