Temporal Data Modeling

Slides:



Advertisements
Similar presentations
Physical Database Design and Tuning R&G - Chapter 20 Although the whole of this life were said to be nothing but a dream and the physical world nothing.
Advertisements

From Handbook of Temporal Reasoning in Artificial Intelligence By Jan Chomicki & David Toman Temporal Databases Presented by Leila Jalali CS224 presentation.
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Database Systems: Design, Implementation, and Management Tenth Edition
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.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Dimensional Modeling Business Intelligence Solutions.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Spatio-Temporal Databases
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
Spatio-Temporal Databases. Outline Spatial Databases Temporal Databases Spatio-temporal Databases Multimedia Databases …..
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 ….
Time Chapter 10 © Worboys and Duckham (2004)
1 C. Shahabi CSCI599-Fall2000 Introduction to Temporal Database Research by Cyrus Shahabi from Christian S. Jensen’s Chapter 1.
Chapter 11 Data Management Layer Design
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Features Lecture 2. Desirable features in an information system Integrity Referential integrity Data independence Controlled redundancy Security.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Week 6 Lecture Normalization
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
RDB/1 An introduction to RDBMS Objectives –To learn about the history and future direction of the SQL standard –To get an overall appreciation of a modern.
Database Management Systems Accounting Information Systems, 5 th edition James A. Hall COPYRIGHT © 2007 Thomson South-Western, a part of The Thomson Corporation.
Database System Concepts and Architecture
Recent research : Temporal databases N. L. Sarda
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
Daniel J. Abadi · Adam Marcus · Samuel R. Madden ·Kate Hollenbach Presenter: Vishnu Prathish Date: Oct 1 st 2013 CS 848 – Information Integration on the.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Chapter 9 Database Systems © 2007 Pearson Addison-Wesley. All rights reserved.
UNIT-II Principles of dimensional modeling
Chapter 2: Intro to Relational Model. 2.2 Example of a Relation attributes (or columns) tuples (or rows)
WXGE 6101 DATABASE CONCEPTS & IMPLEMENTATIONS. Lesson Overview The Relational Model Terminology of relational model. Properties of database relations.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Relational Databases.
SPATIO-TEMPORAL DATABASES Temporal Databases. Temporal Data. Modeling Temporal Data Temporal Semantics Temporal density: the time is seen as being: 
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Chapter 4 Logical & Physical Database Design
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Relational Databases.
Where does time go ?. Applications abound Temporal database systems provide built-in support for recording and querying time-varying information Application.
Manipulating Data Lesson 3. Objectives Queries The SELECT query to retrieve or extract data from one table, how to retrieve or extract data by using.
CS240A: Databases and Knowledge Bases TSQL2 Carlo Zaniolo Department of Computer Science University of California, Los Angeles Notes From Chapter 6 of.
Oracle 10g Database Administrator: Implementation and Administration Chapter 10 Basic Data Management.
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Database Planning Database Design Normalization.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
SPECIAL PURPOSE DATABASES 13/09/ Temporal Database Concepts  Time is considered ordered sequence of points in some granularity Use the term choronon.
Relational Model.
Relational Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany)
TODL - Temporal Object Definition Language
Lec 3: Object-Oriented Data Modeling
Spatio-Temporal Databases
Temporal Databases.
The Relational Model Textbook /7/2018.
Temporal Databases.
Contents Preface I Introduction Lesson Objectives I-2
Database Design: Relational Model
Manipulating Data Lesson 3.
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs
Presentation transcript:

Temporal Data Modeling N. L. Sarda IIT Bombay

Temporal Data Modeling All activities have context of time No explicit support from database systems Approaches Schema for current data Past data in archived, not accessible thru DB schema Or, include history explicitly by time-stamping Alternative : provide support for temporal data

Applications Administrative – personnel, accounting, … Medical applications Insurance Reservation systems Planning, …

Conventional way Add attributes for time, its granularity, meaning Write statements differently Explicitly co-relate data over time Example : Emp table with FROM and TO columns to indicate employment data period Emp (Eno, Dno, Salary, Rank, From, To) Insert new emp : what value for To ? Get current salary of Mahesh Change salary of Mahesh : no UPDATE st ! Another table Dept : how to find when Mahesh worked in Toy department

Time : Semantics and representation Many clocks (a physical process that ‘measures’ time) and representations exist Day clock, year clock, etc Representations differ in range, granularity, storage size, efficiency of operations Models of time continuous, discrete Linear or branching Basic units : instant, interval (unanchored), span Temporal element : as a set of instants on spans Operations on time : arithmetic, comparisons on instants and intervals (+, <, overlaps, …) Calendar notion – human interpretation; defines new units and constants Gregorian calendar most common

Time dimensions Different interpretations Basic dimensions: Orthogonal Real-world or valid time System or transaction time Orthogonal Leads to 4 basic database types : No time : snap-shot DBs Only valid time : historical DBs Only transaction time : Rollback DBs Both : Bi-temporal DBs

Transaction time DBMS records system time with data System time advances automatically : represent by UC Example : insert Mohan with 10K salary at system time 15 System is aware of this fact, and continues to ‘know’ it from 15 onwards (until changed) Tuple <Mohan, 10K, 15, TC> captures this Removing (deleting) this (at time 35) means this data is not ‘known’ to system anymore after 35. Example : <Mohan, 10K, 15, 35> <Mohan, 12K, 36, UC> We can rollback system time

Valid Time Is External for the system Defines real-world validity of data Data can be past, current or future with respect to current time <Mahesh, 10K, 1-1-2002, 31-12-2008> Updates change valid time stamp Some facts may be valid now and in future Use NOW as a ‘moving’ time variable

Bi-temporal data model Each fact is associated with both times Effectively, system stores everything and never forgets anything ! A tuple in pure Bi-temporal model contains a set of bi-temporal ‘cronons’ telling when the fact was valid and when it was known to the system A 2-dim temporal space A fact represented by graph/area in this space Example {time by (valid, tran time) pairs} <Mahesh, CSE, {(5,7), (5,9), (5,10), (6,7), …>

Update semantics Need to be clearly understood for insert, delete Insert <Meera, CSE> valid over <15..25>: This fact exists and is current >> reject ! Does not exist at all : add with tran time UC which will keep expanding Exists but not current : merge with newer cronon values Need to be carefully implemented

Choosing interval-based representation The conceptual model uses temporal element Not normalized and in-efficient Use valid and tran time intervals with a fact <Mahesh, CSE, (15..35), (20..UC)> Define update semantics carefully At tran time 28, we find that Mahesh was in fact in EE during valid time 21 to 24 Updating should now give us the following <Mahesh, CSE, (15..35), (20..27)> <Mahesh, CSE, (15..20), (28..UC)> <Mahesh, EE, (21..24), (28, UC)> <Mahesh, CSE, (25..35), (28, UC)> Need to split intervals carefully

Temporal Normalization A table now contains user defined and temporal attributes Time applies to the whole tuple User defined attributes may have different rates of change, and every change produces ‘history’ Better to decompose a relation based on rate of change Salary changes more frequently than Dept Split Emp (Eno, Salary, Dept) into 2 relations

Temporal algebra and query language Algebra defines how time to be considered Usual selection, projection, etc can be defined Product gives two timestamps >> not a temporal relation ! Join should relate data with overlapping validity and currency R JOIN S : check that tuple r in R and s in S have overlapping valid time and they are both current Result should contain intersection of time elements Exact definition will depend on representation

Coalesce operation Interval based representation, while simpler to understand and implement, requires time intervals across result tuples to be compacted Coalesce operation produces tuples with proper time intervals Bitemporal tuple has a rectangular time element Projection, union, etc requires 2 rectangles to be converted into multiple tuples with proper rectangular regions

Event Vs Interval semantics An application may choose to represent events or states of entities : salary change or salary interval <Mohan, 10K, 15> <Mohan, 10K, 15..26> <Mohan, 15K, 27> <Mohan, 15K, 27..NOW> Maybe done for both time dimensions Algebra and query language will need to be oriented towards a specific representation

Choosing a representation Literature has suggested many representation Tuple level time stamping Vs attribute level time stamping Event or interval or set of these Entity level or tuple level Entire history in a single tuple One tuple gives full history across all attributes Each attribute is multi-valued, each value tome-stamped <e21, Mohan, {(10K, 15) (12K, 27)}, {(CSE, 10),(EE, 18)}>

Modeling Temporal Entities Entity has key and a set of attributes Temporal entities have ‘lifespan’, non-changing key (or, surrogate) Identify non-temporal (non-changing) and temporal attributes Attribute values also have a time stamp Contained in the lifespan of the entity Modeling using valid time characteristics How much change an entity can ‘tolerate’ ? Application dependent issue

Modeling Temporal Relationships Relationship also has a lifespan May have changing temporal attributes Mohan works in CSE at various points in time in different roles (student, programmer, faculty) Works relationship with attribute Role and valid time interval Relationship instance validity must be contained in the lifespan of the entities it relates Temporal characteristics can be associated with inheritance and aggregation relationships also

Exercise ! Consider student, course, registrations as per the bulletin, etc Courses are modified Bulletins change every few years and may overlap Students repeat courses when they fail Students change departments, may get credits for a few course, may have a special schedule (==bulletin !)

Summary Time is ubiquitous Requirements must be understood clearly Ad hoc solutions create problems Specialized representations and query languages simplify time management