CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.

Slides:



Advertisements
Similar presentations
TSQL 2 : QUERY LANGUAGE FOR TEMPORAL DATA CS 224 : Advanced Topics in Data Management.
Advertisements

CIT 613: Relational Database Development using SQL Revision of Tables and Data Types.
From Handbook of Temporal Reasoning in Artificial Intelligence By Jan Chomicki & David Toman Temporal Databases Presented by Leila Jalali CS224 presentation.
1 Lecture 11: Transactions: Concurrency. 2 Overview Transactions Concurrency Control Locking Transactions in SQL.
Temporal Constraints Time and Time Again: The Many Ways to Represent Time James F Allen.
PostgreSQL & Temporal Data Christopher Browne Afilias Canada PGCon 2009.
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.
CS240A: Databases and Knowledge Bases Temporal Applications and SQL:1999 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Dr. Kalpakis CMSC 661, Principles of Database Systems Representing Data Elements [12]
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.
Temporal Databases and Maintenance of Time-Oriented Clinical Data Yuval Shahar, M.D., Ph.D.
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.
Elementary Data Types Prof. Alamdeep Singh. Scalar Data Types Scalar data types represent a single object, i.e. only one value can be derived. In general,
Chapter 3 Probability Distribution. Chapter 3, Part A Probability Distributions n Random Variables n Discrete Probability Distributions n Binomial Probability.
Structured Query Language - SQL Carol Wolf Computer Science.
Representing Data Elements Gayatri Gopalakrishnan.
Fall 2001Arthur Keller – CS 1808–1 Schedule Today Oct. 18 (TH) Schemas, Views. u Read Sections u Project Part 3 extended to Oct. 23 (T). Oct.
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 …..
Winter 2002Arthur Keller – CS 1808–1 Schedule Today: Jan. 29 (T) u Modifications, Schemas, Views. u Read Sections Assignment 3 due. Jan. 31 (TH)
CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Spatiotemporal GIS: Incorporating Time Group 7 Nathan Hunstad, Kyle Martin Csci 5980.
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Winter 2002Judy Cushing8–1 Schedule Jan. 30 (Wed) u Modifications, Schemas, Views. Read Sections This Week (Feb 4ff) u Constraints Read Sections.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
Time Chapter 10 © Worboys and Duckham (2004)
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Modification of the Database – Deletion Delete all account records at the Perryridge branch.
CS240A: Databases and Knowledge Bases Applications of Active Database Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
MM3FC Mathematical Modeling 3 LECTURE 2 Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri,
Concepts of Database Management, 4th Edition, Pratt & Adamski
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Structured Query Language (SQL) A2 Teacher Up skilling LECTURE 2.
Said Salomon Unitrin Direct Insurance T-SQL Date and Time Functions Said Salomon.
HAP 709 – Healthcare Databases SQL Data Manipulation Language (DML) Updated Fall, 2009.
Recent research : Temporal databases N. L. Sarda
Winter 2006Keller Ullman Cushing8–1 Turning in Assignments Please turn in hard copy (use only in the direst of circumstances). I am not your secretary.
USE OF TEMPORAL CONCEPTS IN TRANSACTIONAL DATABASES.
SCUHolliday - coen 1788–1 Schedule Today u Modifications, Schemas, Views. u Read Sections (except and 6.6.6) Next u Constraints. u Read.
CS240A: Databases and Knowledge Bases Recursive Queries in SQL 1999 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Advanced Database CS-426 Week 1 - Introduction. Database Management System DBMS contains information about a particular enterprise Collection of interrelated.
SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.
CS 338The Relational Model2-1 The Relational Model Lecture Topics Overview of SQL Underlying relational model Relational database structure SQL DDL and.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
P-1 The Real Number System. Real Numbers— Irrational Numbers— the real number that can not be written as the ratio of two integers. Rational Numbers—
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.
CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Temporal Data Modeling
Where does time go ?. Applications abound Temporal database systems provide built-in support for recording and querying time-varying information Application.
Spatiotemporal GIS Standard GIS: Spatial Characteristics only Implicit time is usually “now” Spatiotemporal GIS: Adds concept of time What happened when.
CS240A: Databases and Knowledge Bases Recursive Queries in SQL 2003 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
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.
Working with Date and Time ISYS 475. How PHP processes date and time? Traditional way: – Timestamp Newer and object oriented way: – DateTime class.
IBM Research: Software Technology © 2005 IBM Corporation Programming Technologies 1 Temporal Rules Vijay Saraswat IBM TJ Watson July 27, 2012.
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
Data Types COMP3211 Advanced Databases Dr Nicholas Gibbins
SPECIAL PURPOSE DATABASES 13/09/ Temporal Database Concepts  Time is considered ordered sequence of points in some granularity Use the term choronon.
Data Types COMP3017 Advanced Databases Dr Nicholas Gibbins
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
COMP3211 Advanced Databases
Temporal Databases.
Defining a Database Schema
Temporal Databases.
CS240A: Databases and Knowledge Bases TSQL2
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs
Rational Numbers and Irrational Numbers
Presentation transcript:

CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles Revised: January 2003 Notes From Chapter 5 of Advanced Database Systems by Zaniolo, Ceri, Faloutsos, Snodgrass, Subrahmanian and Zicari. Morgan Kaufmann, 1997

Time Properties  Structure  Boundedness  Density  Time Data Types  Time and Facts

Time Structure  Linear Time  Branching Time  Directed Acyclic Graph  Periodic/Cyclic Time Sunday. E.g., days of the week.  Boundedness of Time From now on, we will assume a linear time structure.  Boundedness  Unbounded  Time origin exists (bounded from the left)  Bounded time (bounds on both ends)

Time Density  Discrete:  Time line is isomorphic to the integers  Timeline composed of a sequence of non­decomposable time periods of some fixed, minimal duration, termed chronons.  Between each pair of chronons is a finite number of other chronons.  Dense: (difficult to implement)  Time line is isomorphic to the rational numbers.  Between any two chronons is an infinite number of other instants.  Continuous: (very difficult to implement)  Time line is isomorphic to the real numbers.  Between each pair of instants is a infinite number of other instants.  A bounded discrete representation of time is the simplest option used in SQL-2 and most temporal DBs.

Time Datatype in SQL-2  DATE : four digits for the year and two for month and day. Multiple formats allowed:  E.g., or 12/08/2001 or  ISO, USA, EUR, JIS representations supported---DBA selects which one is used in specific system.  Internal representation is the same, independent of external ones. The internal representation of a time is a string of 4 bytes (each packs 2 decimal digits).  TIME : 2 digits for hour, 2 for minutes, and 2 for seconds (plus optional fractional digits---system dependent). E.g., 13:50:00, 13:50, 1:50 PM denote the same time— internally three 2-packed decimal digits.

Time Datatype in SQL-2 (cont.)  TIMESTAMP : date+time with six fractional digits for the second field. A timestamp is a seven-part value (year, month, day, hour, minute, second, and microsecond) that designates a date and time as defined above, Time includes a fractional specification of microseconds. E.g  The internal representation of a timestamp is a string of 10 bytes, each of which consists of 2 packed decimal digits. The first 4 bytes represent the date, the next 3 bytes the time, and the last 3 bytes the microseconds.  The length of a TIMESTAMP column, as described in the SQLDA, is 26 bytes, which is the appropriate length for the character string representation of the value.

Time Data Type in SQL-2 (cont.)  TIME(STAMP) WITH ZONE: offset according to UTC (universel temps coordonné)  INTERVAL: I.e. a time span. In DB2 is called a labeled duration. E.g., 10 DAYS  Time expressions. Using the labeled duration in arithmetic : orderdate + 10 DAYS < CURRENT DATE --- this is valid, but CURRENT DATE - overdate > 10 DAYS --- this is invalid.  CAST expressions: E.g. CAST(2 DAYS AS HOURS) returns 48 HOURS

Various Temporal Types used in temporal DBs  A time instant is a time point on the time line.  An event is an instantaneous fact, i.e, something occurring at an instant. The event occurrence time of an event is the instant at which the event occurs in the real world.  An instant set is a set of instants.  A time period is the set of time instants between two instants (start time and end time).  In TSQL2, the basic temporal element is a finite union of periods.

Periods versus Time Intervals  Periods are frequently called (time) intervals.  but this conflicts with the SQL data type INTERVAL and we will try to avoid it.  A SQL time interval is a directed duration of time. A duration is an amount of time with a known length, but no specific starting or ending instants.Also called a span.  A positive interval denotes forward motion of time; a negative interval denotes backwards motion of time.

Valid Time and Transaction Time  Valid Time of a fact: when the fact is true in the modeled reality  Transaction Time of a fact: when it was recorded in the database.  Thus we have four different kinds of tables: 1. Snapshot 2. Valid-time 3. Transaction-time 4. Bitemporal

Example: Tom's Employment History  On January 1, 1984, Tom joined the faculty as an Instructor.  On December 1, 1984, Tom completed his doctorate, and so was promoted to Assistant Professor effective on July 1, 1984 (retroactive update).  On March 1, 1989, Tom was promoted to Associate Professor, effective July 1, 1989 (proactive update).

Queries and Updates  A transaction time table is append-only: it keeps the history of the updates made on the database.  Transaction time tables supports rollback queries, such as:  On October 1, what rank was our database showing for Tom?  A valid time table can be updated: e.g., Tom’s past record is changed once his rank is changed retroactively.  Valid time tables support historical queries, such as:  What was Tom’s rank on October 1 (according to our current database)? Transaction time databases also can support historical queries.

Bitemporal Tables  Bitemporal Tables are append­only and supports queries of both kinds (rollback&historical) such as:  On October 1, 1984, what did we think Tom's rank was at that date?  TSQL3: SELECT Rank FROM Faculty AS F WHERE Name = 'Tom‘ AND VALID(F) OVERLAPS DATE '1984­10­01‘ AND TRANSACTION(F) OVERLAPS DATE '1984­10­01'