Data Models and Query Languages of Spatio-Temporal Information Cindy Xinmin Chen Computer Science Department UCLA February 28, 2001.

Slides:



Advertisements
Similar presentations
Limitations of the relational model 1. 2 Overview application areas for which the relational model is inadequate - reasons drawbacks of relational DBMSs.
Advertisements

Chapter 10: Designing Databases
From Handbook of Temporal Reasoning in Artificial Intelligence By Jan Chomicki & David Toman Temporal Databases Presented by Leila Jalali CS224 presentation.
Spatial Database Systems. Spatial Database Applications GIS applications (maps): Urban planning, route optimization, fire or pollution monitoring, utility.
TURKISH STATISTICAL INSTITUTE 1 /34 SQL FUNDEMANTALS (Muscat, Oman)
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.
Kien A. Hua Division of Computer Science University of Central Florida.
Advanced Databases Temporal Databases Dr Theodoros Manavis
1 Enviromatics Spatial database systems Spatial database systems Вонр. проф. д-р Александар Маркоски Технички факултет – Битола 2008 год.
Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
CS240A: Databases and Knowledge Bases Introduction Carlo Zaniolo Department of Computer Science University of California, Los Angeles WINTER 2002.
ETEC 100 Information Technology
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Spatio-Temporal Databases
Fall 2000CS 599 – Spatial and Temporal Databases Research Issues in Spatio- temporal Database Systems Timos Sellis Presented by Handy Patriawan.
Temporal Databases. Outline Spatial Databases Indexing, Query processing Temporal Databases Spatio-temporal ….
Modification Statements in TSQL2 INSERT INTO Prescription %Executed on VALUES ('Melanie','Dr. Beren','Proventil','30 mg', INTERVAL '8:00' MINUTE)
Introduction to Structured Query Language (SQL)
Computer Science Spatio-Temporal Aggregation Using Sketches Yufei Tao, George Kollios, Jeffrey Considine, Feifei Li, Dimitris Papadias Department of Computer.
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.
Time Chapter 10 © Worboys and Duckham (2004)
Geographic Information Systems
Introduction to Structured Query Language (SQL)
Spatial Database Systems. Spatial Database Applications GIS applications (maps): Urban planning, route optimization, fire or pollution monitoring, utility.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
IST Databases and DBMSs Todd S. Bacastow January 2005.
CS240A: Databases and Knowledge Bases Introduction Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Dr. Mohamed Osman Hegazi 1 Database Systems Concepts Database Systems Concepts Course Outlines: Introduction to Databases and DBMS. Database System Concepts.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Daniel J. Abadi · Adam Marcus · Samuel R. Madden ·Kate Hollenbach Presenter: Vishnu Prathish Date: Oct 1 st 2013 CS 848 – Information Integration on the.
Object Persistence (Data Base) Design Chapter 13.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Exam and Lecture Overview.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Geographic Information Systems Temporal GIS Lecture 8 Eng. Osama Dawoud.
Leonardo Guerreiro Azevedo Geraldo Zimbrão Jano Moreira de Souza Approximate Query Processing in Spatial Databases Using Raster Signatures Federal University.
Fushen Wang, XinZhou, Carlo Zaniolo Using XML to Build Efficient Transaction- Time Temporal Database Systems on Relational Databases In Time Center, 2005.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
Benjamin Post Cole Kelleher.  Availability  Data must maintain a specified level of availability to the users  Performance  Database requests must.
資工所 在職碩一 P 莊浚銘 Temporal Database Paper Reading Report.
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.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Temporal Data Modeling
Where does time go ?. Applications abound Temporal database systems provide built-in support for recording and querying time-varying information Application.
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.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
CPT-S Advanced Databases 11 Yinghui Wu EME 49.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
L12-S1 Spatiotmporal DB 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
CS240A: Databases and Knowledge Bases Introduction Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
CS240A: Databases and Knowledge Bases Introduction
Haixun Wang, Carlo Zaniolo Computer Science Dept.
Data, Databases, and DBMSs
Spatio-Temporal Databases
Temporal Databases.
Spatial and temporal data management
Data Model.
CS240A: Databases and Knowledge Bases TSQL2
CS240A: Databases and Knowledge Bases A Taxonomy of Temporal DBs
Presentation transcript:

Data Models and Query Languages of Spatio-Temporal Information Cindy Xinmin Chen Computer Science Department UCLA February 28, 2001

2 The Problem Data models and query languages for spatio- temporal databases:  many different approaches proposed  complexity of technical problem  diversity of application requirements Implementation: extensions for spatio-temporal information  zero extensibility in Relational DBMS  Object-Relational systems are better, but still have many limitations

3 Contribution of This Research Better data models and query languages for temporal and spatio-temporal information Multi-layered architecture for spatio-temporal extensions on O-R systems Support further extensions and customization by end-users via user-defined spatio-temporal aggregates

4 Outline Temporal Data Models and Query Languages -- SQL T Spatio-Temporal Data Models and Query Languages -- SQL ST Implementation of SQL ST More Abstract Representation of Spatio-Temporal Data Conclusion

5

6 State of Art More than 40 temporal data models according to [Jensen and Snodgrass 99] Interval-based approach [Lorentzos 97]  same conceptual level and implementation level representations but requires interval coalescing after projection TSQL2’s implicit time [Snodgrass 95]  temporal joins are specified without ever mentioning the time column in WHERE or SELECT clauses of the query Point-based approach [Toman 98]

7 Interval-Based Time Model and Coalescing A temporal relation contains prescription information Projection on Name and Physican: Projection on Name and Drug: Prescription(Melanie, Dr. Jones, Proventil, 3mg, [ , ]) Prescription(Melanie, Dr. Jones, Prozac, 3mg, [ , ]) Prescription(Melanie, Dr. Bond, Prozac, 3mg, [ , ]) (Melanie, Dr. Jones, [ , ]) (Melanie, Dr. Bond, [ , ]) (Melanie, Proventil, [ , ]) (Melanie, Prozac, [ , ])

8 TSQL2 Bitemporal Conceptual Data Model -- coalesced data model Two dimensional time -- valid time and transaction time Implicit time model -- no coalescing Lack of universality

9 TSQL2 -- An Example Schema Definition Query 1: find the drugs Melanie took in 1996 and the time she took them. CREATE TABLE Prescription (Name CHAR(30), Physician CHAR(30), Drug CHAR(30), Dosage CHAR(30)) AS VALID STATE DAY SELECT Drug VALID INTERSECT(VALID(Prescription), PERIOD(‘[1996]’ AS DAY)) FROM Prescription WHERE Name = “Melanie”

10 Point-Based Model Expressive power [Toman 97] Use user-defined aggregates to express Allen's interval operators Universality:  uniformly applicable to SQL, QBE and Datalog  use current query languages’ construct types  no new constructs are introduced

11 SQL T : Schema Definition Define the Prescription relation CREATE TABLE Prescription (Name CHAR(30), Physician CHAR(30), Drug CHAR(30), Dosage CHAR(30), VTime DATE)

12 Temporal Selection and Join Query 1’: find the drugs Melanie took in 1996 and the time she took them. SELECT Drug, VTime FROM Prescription WHERE Name = “Melanie” = VTime

13 Interval-Oriented Reasoning Query 2: find the patients who have taken Proventil throughout the time they took Prozac. SELECT P1.Name FROM Prescription AS P1 P2 WHERE P1.Name = P2.Name AND P1.Drug = “Proventil” AND P2.Drug = “Prozac” GROUP BY P1.Name HAVING DURING(P1.VTime. P2.VTime)

14 Interval-Oriented Reasoning (cont.) Query 2 in QBE Prescription Name Physician Drug Dosage VTime P.G._name Proventil _vtime1 _name Prozac _vtime2 Conditions DURING(_vtime1, _vtime2)

15 Interval-Oriented Reasoning (cont.) Query 2 in Datalog query2(Name, during )  prescription(Name, _, “Proventil”, _, VTime1), prescription(Name, _, “Prozac”, _, VTime2).

16 Implementation of SQL T on DB2 From point-based representation to interval based representation Difficulty of support temporal data model and query language extensions on existed O-R systems  only user-defined functions (UDFs) available UDFs can not access the database tables directly UDFs are hard to develop and debug

17

18 Previous Work Constraint-based approach  Triangulation-based spatial objects + interval- based time [Chomicki 97]  Parametric rectangles + interval-based time [Cai 00]  Time as another dimension in space [Grumbach 98] Composite spatio-temporal data types: mpoint and mregion [Güting 00] Orthogonal space and time [Worboy 94]

19 Previous Work (cont.) Commercial DBMSs  no spatio-temporal extensions  only spatial DataBlades, Extenders, etc. provide a predefined library of functions offer no extensibility

20 Objective of SQL ST orthogonality, minimality and extensibility  separated temporal and spatial information  minimal extensions to SQL  additional constructs can be built in SQL ST

21 Design and Implementation of SQL ST Define a minimal set of built-in primitives in procedure language Use user-defined aggregates for further extension Data types:  Temporal data type -- time interval  Spatial data types -- points, lines (finite straight line segments), and counterclockwise directed triangles

22 Counterclockwise Directed Triangle A triangle is counterclockwise directed if its three vertexes are counterclockwise orientated Makes point-location problem easy   inside(point, triangle) T V1 V2 V3 P’ P

23 Application Example Cyclone statistics for the northern Hemisphere from NSF Arctic System Science Research Program ID Trajectory Pressure Start Time End Time x1 y1 x2 y (1146, 1034, 1303, 1775) (1303, 1775, 1664, 1779) (1664, 1779, 1957, 1018) day1 day2day3 day4

24 SQL ST : Schema Definition Define the Cyclone relation Define the Island relation CREATE TABLE Cyclone (ID INT, Trajectory LINE, Pressure REAL, Tstart DATE, Tend DATE) CREATE TABLE Island (Name CHAR(30), Region TRIANGLE)

25 Spatio-Temporal Queries Query 3: find all cyclones whose high pressure stage (pressure > 1000mb) have lasted more than 3 days. SELECT ID FROM Cyclone WHERE Pressure > 1000 GROUP BY ID HAVING DURATION(Tstart, Tend) > 3

26 Spatio-Temporal Queries (cont.) Query 4: find the cyclones whose trajectory have been enclosed by the island Misfortune. SELECT ID FROM Cyclone, Island WHERE Name = “Misfortune” GROUP BY ID HAVING CONTAIN(Trajectory, Region)

27

28 Approach Define a minimal set of ADTs built in C++ Use user-defined aggregates to define new spatio- temporal primitives Allow end-users to extend and customize the system for their application

29 Built-in Spatial Functions length(line) area(triangle) center_of_mass(triangle) distance(point, point) distance(point, line) intersect(line, line) intersect(line, triangle) intersect(triangle, triangle)

30 User-Defined Aggregates (UDAs) UDAs provide a more general and powerful mechanism for DB extensions  ease of use  no impedance mismatch of data types and programming paradigms  DB advantages -- scalability, data independence, optimizability, etc.

31 Aggregate eXtension Language (AXL) [Wang 00] Stream orientated processing Three functions expressed in SQL  INTIALIZE : gives an initial value to the aggregate  ITERATE : computes the intermediate aggregate value for each new record  TERMINATE : returns the final value computed for the aggregate Local tables  state  return Built on the Berkeley DB storage manager

32 Duration Calculates the total length of the time intervals Cyclone(960001, _, _, , ) Cyclone(960001, _, _, , ) Cyclone(960001, _, _, , ) 15 days

33 Duration (cont.) AGGREGATE DURATION(Tstart DATE, Tend DATE) : INT { TABLE state (i INT); INITIALIZE : { INSERT INTO state VALUES(Tend - Tstart + 1); } ITERATE : { UPDATE state SET i = i + (Tend - Tstart + 1); } TERMINATE : { INSERT INTO return SELECT i FROM state; }

34 Contain Tests if one object contains another  returns 1 if true; returns nothing otherwise contain(O1, O2)   triangle t2  O2, vertex v of t2,  triangle t1  O1, v inside t1

35 Contain (cont.) AGGREGATE CONTAIN(Object1 TRIANGLE, Object2 TRIANGLE) : INT { TABLE state (b INT) AS VALUES(1); TABLE triangles(Object TRIANGLE); TABLE points(Vertex POINT); INITIALIZE : ITERATE : { INSERT INTO triangles VALUES(Object1); INSERT INTO points VALUES(Object2.Vertex); } TERMINATE : { UPDATE state SET b = 0 WHERE NOT EXIST (SELECT Vertex FROM points, triangles WHERE inside(Vertex, Object) = 1); INSERT INTO return SELECT b FROM state WHERE b = 1; }

36 Other UDAs Overlap  tests if any edges of two objects intersect Edge_Distance  calculates the minimum distance from the vertexes of one object to the edges of the other object Moving_Distance  calculates the distance an object has traveled continuously

37 Key Issue: Performance Size of data set:  Cyclone table ,000 tuples  Island table tuples Cases compared  AXL using indexes  AXL not using indexes  C++ using indexes  C++ not using indexes Index  Tstart on Cyclone table and Name on Island table

38 Performance -- Duration Query 5: find the duration of the cyclones occurred in June, SELECT DURATION(Tstart, Tend) FROM Cyclone WHERE = Tstart GROUP BY ID

39 Performance – Duration (cont.)

40 Performance – Contain Query 6: find the cyclones which occurred in June, 1996 and have been enclosed by the region of the island Misfortune. SELECT ID FROM Cyclone, Island WHERE = Tstart AND Name = “Misfortune” GROUP BY ID HAVING CONTAIN(Region, Trajectory)

41 Performance – Contain (cont.)

42

43 Abstract Model Objective: flexibility  user can decide which level of abstraction they want  may have more than two layers Data types:  temporal data type -- time instants  spatial data types – points, lines, and polygons

44 A Spatio-Temporal Object The concrete model -- space triangles and time intervals A more abstract representation  -- sequence of snapshots (S, ((2,2),(6,2),(2,6)), [1,10]) (S, ((2,6),(6,2),(6,6)), [1,10]) 1<=t<=10 S (S, [(2,2),(2,6),(6,6),(6,2)], 1) (S, [(2,2),(2,6),(6,6),(6,2)], 2) …… (S, [(2,2),(2,6),(6,6),(6,2)], 10)

45 Schema Definition The Cyclone relation The Island relation CREATE TABLE Cyclone (ID INT, Position POINT, Pressure REAL, Time DATE) CREATE TABLE Island (Name CHAR(30), Extent POLYGON)

46 Mapping UDA -- map Table function -- decompose (Point, Time Instant) (Line, Time Interval) (Polygon) (Triangle)

47 Spatio-Temporal Queries Query 3’: find all cyclones whose high pressure stage (pressure > 1000mb) have lasted more than 3 days. SELECT NEW.ID FROM (SELECT ID, MAP(Position, Time) FROM Cyclone WHERE Pressure > 1000 GROUP BY ID) AS NEW(ID, Trajectory, Tstart, Tend) GROUP BY NEW.ID HAVING DURATION(New.Tstart, New.Tend) > 3

48 Spatio-Temporal Queries (cont.) Query 4’: find the cyclones whose trajectory have been enclosed by the island Misfortune. SELECT NEW.ID FROM (SELECT ID, MAP(Position, Time), T.Region FROM Cyclone, Island, TABLE(decompose(Extent)) AS T WHERE Name = “Misfortune” GROUP BY ID, T.Region) AS NEW(ID, Trajectory, Tstart, Tend, Region) GROUP BY NEW.ID HAVING CONTAIN(New.Region, New.Trajectory)

49 Conclusion Better data models and query languages for temporal and spatio-temporal information Multi-layered architecture for spatio-temporal extensions on O-R systems Support further extensions and customization by end-users via user-defined spatio-temporal aggregates