Top Banner
Temporal Query Languages a Survey a Survey by Jan Chomicki, January 24, 1995 by Jan Chomicki, January 24, 1995 Computing and Information Sciences Computing and Information Sciences Kansas State University Kansas State University Presented by Barry Klein, USC, October Presented by Barry Klein, USC, October 3, 2000 3, 2000
47

Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

Temporal Query Languages

a Surveya Survey

by Jan Chomicki, January 24, 1995by Jan Chomicki, January 24, 1995

Computing and Information SciencesComputing and Information Sciences

Kansas State UniversityKansas State University

Presented by Barry Klein, USC, October 3, 2000Presented by Barry Klein, USC, October 3, 2000

Page 2: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

Contents:

1.1. Introduction to temporal databasesIntroduction to temporal databases

2.2. Temporal databases overviewTemporal databases overview

3.3. Properties of query languagesProperties of query languages

4.4. Abstract query languagesAbstract query languages

5.5. Concrete query languagesConcrete query languages

6.6. Incomplete temporal informationIncomplete temporal information

7.7. Related work in artificial intelligenceRelated work in artificial intelligence

Page 3: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

Introduction to temporal databases

Key concepts: Temporal Domain, Abstract and Key concepts: Temporal Domain, Abstract and Concrete representations/Query lang’s, Incomplete Concrete representations/Query lang’s, Incomplete Temporal Information. Temporal Information. Interpreted Interpreted db domain. db domain.

Examples: financial/personnel/medical/legal records; Examples: financial/personnel/medical/legal records; network monitoring, process controlnetwork monitoring, process control

Framework: integrate temporal research with Framework: integrate temporal research with research in db theory, logic and AI.research in db theory, logic and AI.

Eschew Temporal DB Glossary of Jensen, et al, in Eschew Temporal DB Glossary of Jensen, et al, in Tansel book, to comply with accepted db terms.Tansel book, to comply with accepted db terms.

Page 4: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

Intro to temporal databases (cont’d)

ANSI/SPARC architecture: 3 levels:ANSI/SPARC architecture: 3 levels: Physical; External; Conceptual: abstract vs. concretePhysical; External; Conceptual: abstract vs. concrete

Abstract: formal meaning: representation-independ’tAbstract: formal meaning: representation-independ’t Concrete: specific, finite rep of a certain data modelConcrete: specific, finite rep of a certain data model

Abstract languages:Abstract languages: 11stst-order and temporal logic, relational algebra, -order and temporal logic, relational algebra,

deductive languagesdeductive languages Concrete languages:Concrete languages:

TSQL2 + others in [107, 108, 110]TSQL2 + others in [107, 108, 110]

Page 5: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2. Temporal databases Major issues:Major issues:

Choice of temporal domains (only “flat” types Choice of temporal domains (only “flat” types considered in this survey)considered in this survey)

Points vs. intervalsPoints vs. intervalsLinear vs. branchingLinear vs. branchingDense vs. discreteDense vs. discreteBounded vs. unbounded timeBounded vs. unbounded time

Query Language issues: Query Language issues: formal semantics, expressiveness, formal semantics, expressiveness,

implementationimplementation

Page 6: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.1 Temporal domains

Temporal ontology – 2 distinctions from AI Temporal ontology – 2 distinctions from AI and logic:and logic: Points, or instants (Points, or instants (atat particular times); particular times); Intervals (Intervals (durinduring ranges of time)g ranges of time)

Point view dominant in database work: Point view dominant in database work: intervals defined as pairs of endpoints, intervals defined as pairs of endpoints, making it easy to move between the 2 views making it easy to move between the 2 views in first-order casein first-order case

Page 7: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.1 Temporal domains (cont’d)

Mathematical structure on pointsMathematical structure on points Partial orderPartial order Total (linear) orderTotal (linear) order

Ex: Ex: cycliccyclic time modeled with linear time modeled with linear transitive order, reflexive & symmetric, or transitive order, reflexive & symmetric, or with ultimately periodic setswith ultimately periodic sets

Branching time modeled with partial order Branching time modeled with partial order satisfying left-linearity (no branch to left)satisfying left-linearity (no branch to left)

Page 8: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.1 Temporal domains (cont’d)

Temporal domain: first-order structure with a Temporal domain: first-order structure with a given given SignatureSignature (set of Constant, Function (set of Constant, Function and Relation symbols)and Relation symbols)

Typical elements of signatures:Typical elements of signatures: ““<“ – binary-order relation<“ – binary-order relation ““0” – origin or std ref pt of a temporal domain0” – origin or std ref pt of a temporal domain ““s” – denotes succession of time pointss” – denotes succession of time points ““+”, “-” – relative distance of time points+”, “-” – relative distance of time points ““k” – periodicity: congruence modulo ” – periodicity: congruence modulo kk

Page 9: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.1 Temporal domains (cont’d)

Standard temporal domains Standard temporal domains (in this 1(in this 1stst-order -order structure:structure: NN – natural numbers – natural numbers ZZ – integers – integers QQ – rationals – rationals RR – real numbers – real numbers

Equality not necessarily available in domains like Equality not necessarily available in domains like TSQL2TSQL2

Temp domains may have finite universes, or bounded Temp domains may have finite universes, or bounded subsets of standard domainssubsets of standard domains

Page 10: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.1 Temporal domains (cont’d)

Common assumption: “Time is discrete and Common assumption: “Time is discrete and isomorphic to natural numbers” vs. AI view that isomorphic to natural numbers” vs. AI view that time is usually dense.time is usually dense.

Continuous time is becoming valuable in math, Continuous time is becoming valuable in math, physics and hybrid systems.physics and hybrid systems.

Constraint formula allows finite representation of Constraint formula allows finite representation of dense sets in computer storagedense sets in computer storage

Higher level, or multiple-time granularities (hours Higher level, or multiple-time granularities (hours vs. weeks), require multiple, interrelated temporal vs. weeks), require multiple, interrelated temporal domains (not included in this survey)domains (not included in this survey)

Page 11: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal databases

Model-theoretic view is most basic viewModel-theoretic view is most basic view Treats ATD as a 1Treats ATD as a 1stst-order structure-order structure

Snapshot view treats ATD as a function Snapshot view treats ATD as a function mapping each instant as a tuplemapping each instant as a tuple

Timestamp view maps a set of instants with Timestamp view maps a set of instants with each tupleeach tuple

Page 12: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Assumptions:Assumptions: Single temporal dimension and domain Single temporal dimension and domain TT Single data domain U containing standard Single data domain U containing standard

db constants db constants (these two will be expanded)(these two will be expanded) Context: relational data model, then Context: relational data model, then

generalized to other 1generalized to other 1stst-order data models-order data models Fixed db schema with a fixed set of Fixed db schema with a fixed set of

relationsrelations

Page 13: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Model-theoretic viewModel-theoretic view Abstract temporal relation:Abstract temporal relation:

((aa1,-,a,-,an,t,t) ) ЄЄ P’P’ iff iff PP((aa1,-,a,-,an) holds at ) holds at tt where ( where (aa1,-,a,-,an) ) ЄЄ UU

where where PP is a relation of arity is a relation of arity nn, , P’P’ of arity of arity nn+1, +1, UU is a single data is a single data domain, and domain, and tt is a particular instant. is a particular instant.

Formally, an ATD (a finite Formally, an ATD (a finite temporal structure Dtemporal structure D) = () = (U,T,PU,T,P1,…,,…,PPk) for the ) for the 2-sorted 12-sorted 1stst-order language L-order language LD containing a new relation symbol for containing a new relation symbol for each A.T. relation each A.T. relation PPi i and constant symbol for all and constant symbol for all Є Є UU, and also 0+ , and also 0+ ЄЄ T.T. The final element of The final element of PPii is temporal; the others are data. is temporal; the others are data. No assumptions are made about temporal domain No assumptions are made about temporal domain TT DD is finite if it consists of finite relations is finite if it consists of finite relations

Page 14: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Model-Theoretic View

Page 15: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Snapshot view – a set of functions s/t:Snapshot view – a set of functions s/t:

ff PiPi((tt) = {() = {(aa1,…,a,…,an) : ) : PPii((aa1,…,a,…,an) holds at t}) holds at t}

where each such relation is binary in which the values where each such relation is binary in which the values of the 2of the 2ndnd attribute are sets of tuples; i.e., non-1NF. attribute are sets of tuples; i.e., non-1NF.

Timestamp view – a set of functions s/t:Timestamp view – a set of functions s/t:

ff PiPi(( aa1,…,a,…,an) = {) = {tt : : PPii((aa1,…,a,…,an) holds at t}) holds at t}

Here the db consists of a timestamp relation for each Here the db consists of a timestamp relation for each relation symbol, and each relation (non-1NF) data relation symbol, and each relation (non-1NF) data attributes corresponding to the relation symbol, + a attributes corresponding to the relation symbol, + a timestamp attribute, which is a set of instants.timestamp attribute, which is a set of instants.

Page 16: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Snapshot View

Page 17: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Timestamp View

Page 18: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Multiple temporal dimensionsMultiple temporal dimensions Necessary to model intervals (pairs of pts)Necessary to model intervals (pairs of pts) Multiple kinds of timeMultiple kinds of time

Valid vs. transaction; ref. time vs. event timeValid vs. transaction; ref. time vs. event time Assumption: single temporal domainAssumption: single temporal domain Interpretations of MDTD captured by adding Interpretations of MDTD captured by adding

axioms as integrity contstraints:axioms as integrity contstraints:““An interval’s start must precede its end.”An interval’s start must precede its end.”

Adding dimensions increases complexityAdding dimensions increases complexity

Page 19: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.2 Abstract temporal db’s (cont’d)

Example properties of ATD’sExample properties of ATD’s In Valid-time TD’s, a model is point-based if In Valid-time TD’s, a model is point-based if

facts are associated with single instants;facts are associated with single instants; Interval-based if events are associated with Interval-based if events are associated with

intervals (represented as pairs of instants)intervals (represented as pairs of instants) The semantics of many query languages and The semantics of many query languages and

integrity constraints can be defined directly, integrity constraints can be defined directly, regardless of representation method.regardless of representation method.

Page 20: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal databases

Any model-specific db: just a rep of a ATDAny model-specific db: just a rep of a ATD 2 CTDs are equiv if they rep the same ATD2 CTDs are equiv if they rep the same ATD An ATD may be infinite, but only finite An ATD may be infinite, but only finite

objects can be explicitly represented in objects can be explicitly represented in storage.storage.

Many TDB models incompatible unless Many TDB models incompatible unless specific representations of ATDs.specific representations of ATDs.

Page 21: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Two important properties of CTD classes:Two important properties of CTD classes: Data expressiveness – Data expressiveness –

How many ATDs can be represented within How many ATDs can be represented within it (gives a metric to expressiveness)it (gives a metric to expressiveness)

Succinctness – how much space is needed Succinctness – how much space is needed to express a given ATD (also good metric).to express a given ATD (also good metric).

Page 22: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Concrete Timestamp Databases:Concrete Timestamp Databases: Timestamp view Timestamp view most useful for CTD most useful for CTD Infinite set implicitly represented with Infinite set implicitly represented with

timestamp formulae:timestamp formulae: 1 1stst-order formulae with -order formulae with one free variable in the language of the one free variable in the language of the temporal domain.temporal domain. Example: 0 < Example: 0 < tt < 5 < 5 V V tt > 10 > 10 See next slide for an example CTS DBSee next slide for an example CTS DB

Page 23: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Timestamp View with Timestamp Formulae

Page 24: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Timestamp formulaeTimestamp formulae:: For temporal domain (N, <) timestamps must be For temporal domain (N, <) timestamps must be

finite or co-finite subsets of N.finite or co-finite subsets of N. Presurger arithmetic (N, 0, +, <): timestamps all Presurger arithmetic (N, 0, +, <): timestamps all

ultimately periodic subsets of N.ultimately periodic subsets of N. Ex: natural numbers beginning with 0, period 7:Ex: natural numbers beginning with 0, period 7:

yy, , t = y + y + y + y + y + y + yt = y + y + y + y + y + y + y Equivalently, as Equivalently, as congruence formula: t congruence formula: t 77 0 0

where “where “ kk” means” means congruent modulo k. congruent modulo k.

Page 25: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

These as timestamps allow infinite ultimately These as timestamps allow infinite ultimately periodic ATD to be represented finitely.periodic ATD to be represented finitely.

Ultimately periodic means that, if some natural Ultimately periodic means that, if some natural number is added to the time coordinate, a given number is added to the time coordinate, a given set of relationships in the ATD still holds true.set of relationships in the ATD still holds true.

Calendars can be defined with inf. periodic sets.Calendars can be defined with inf. periodic sets. Finite periodic sets may be represented well as Finite periodic sets may be represented well as

infinite sets + constraints for finiteness.infinite sets + constraints for finiteness. Ex: all Sundays in a yearEx: all Sundays in a year

Page 26: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Quantifier Elimination:Quantifier Elimination: main tool in theory of main tool in theory of timestamp db’s.timestamp db’s.

A theory A theory admits Q.E.admits Q.E. if every formula in the if every formula in the theory’s language can theory’s language can an equiv formula free of an equiv formula free of quantifiers. quantifiers.

These must satisfy tests, for example, that a These must satisfy tests, for example, that a specific instant belongs to a timestamp. specific instant belongs to a timestamp.

Page 27: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Features of timestamp formulae:Features of timestamp formulae: ConstraintsConstraints are atomic TSFs are atomic TSFs A TSF is termed A TSF is termed separableseparable if it is a conjunction of if it is a conjunction of

the forms the forms tt = = cc, , tt < < cc or or tt > > cc, and , and cc is in is in TT To admit > 1 dimension or rep an interval requires To admit > 1 dimension or rep an interval requires

timestamp formula to have at least 2 free variablestimestamp formula to have at least 2 free variables Timestamps may be associated either with tuples Timestamps may be associated either with tuples

or with attribute valuesor with attribute values

Assumption: timestamps are finite or bounded Assumption: timestamps are finite or bounded sets, unless TSF used to rep inf sets implicitlysets, unless TSF used to rep inf sets implicitly

Page 28: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Finite Temporal DBsFinite Temporal DBs For For snapshot dbsnapshot db’s or ’s or temporal structurestemporal structures to to

be used as CDBs requires they be finite and be used as CDBs requires they be finite and describe a finite subset of time domaindescribe a finite subset of time domain

These 2 forms usually waste too much These 2 forms usually waste too much spacespace

Page 29: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.3 Concrete temporal db’s (cont’d)

Features of Logic ProgramsFeatures of Logic Programs To represent an (infinite) ATD as finite, LPs To represent an (infinite) ATD as finite, LPs

consist of deductive (Horn) rules + a finite dbconsist of deductive (Horn) rules + a finite db The ATD corresponding to such a program is The ATD corresponding to such a program is

called its called its least Herbrand modelleast Herbrand model Ex: to rep Sundays:Ex: to rep Sundays: sunday sunday(0),(0),

sundaysunday((ss77((TT)): - )): - sundaysunday((TT). ). Notation (Notation (NN, 0, , 0, ss) used for LP syntax where ) used for LP syntax where ss is a is a

unary successor, in only 1 argument of a relationunary successor, in only 1 argument of a relation

Page 30: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

2.4 Interoperability

If two temporal data models, If two temporal data models, ΔΔ11 and and ΔΔ22, use the same , use the same temporal domains, then the meaning of temporal domains, then the meaning of ΔΔ11 (resp (resp ΔΔ22) is ) is defined as a total mapping defined as a total mapping hh11 (resp (resp hh22) from CTDs ) from CTDs def’d under def’d under ΔΔ11 (resp (resp ΔΔ22) to ATDs.) to ATDs.

The inverse mappings The inverse mappings hh-1-111 and and hh-1-1

22 may be only partial may be only partial (some ATDs may not be rep’able in the given data (some ATDs may not be rep’able in the given data model)model)

Let Let °° rep rep function compositionfunction composition; then ; then dd11= = hh-1-111° ° hh22((dd22) )

represents the CDB under represents the CDB under ΔΔ11 corresp to a CDB corresp to a CDB dd22 under under ΔΔ22. Then . Then dd11 can be queried the same as can be queried the same as ΔΔ11..

This provides the access for This provides the access for dd22..

Page 31: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

3 Properties of Query Languages

A semantics is A semantics is declarativedeclarative if it assigns meaning to if it assigns meaning to a query without ref to evaluation methoda query without ref to evaluation method

Query evaluation can be in Query evaluation can be in closed formclosed form if the if the query result can be expressed in the db’s languagequery result can be expressed in the db’s language

Rep’l independence:Rep’l independence: a query answer s/b the same a query answer s/b the same for any 2 CDBs representing the same ATDfor any 2 CDBs representing the same ATD

Query expressiveness:Query expressiveness: 2 queries equivalent if they 2 queries equivalent if they return the same answer for every db.return the same answer for every db.

Data complexity:Data complexity: the computational complexity the computational complexity of the set of finite db’s where a fixed query = trueof the set of finite db’s where a fixed query = true

Page 32: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

4 Abstract Query Languages

4.1 4.1 Relational CalculusRelational Calculus Domain relational calculus:Domain relational calculus: the 1 the 1stst-ord logic of an -ord logic of an

ATD (ATD (model theoreticmodel theoretic view) can be used as a QL. view) can be used as a QL. Semantics: Tarskian, which is declarative: the Semantics: Tarskian, which is declarative: the

answer to a 1answer to a 1stst-order query is {valuations that -order query is {valuations that make the query formula true in the given db}make the query formula true in the given db}

11stst-order logic can be used as a concrete query -order logic can be used as a concrete query languagelanguage

Page 33: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

4.1 Relational Calculus (continued)

Example query: Example query: “list all countries that lost and “list all countries that lost and regained independence.”regained independence.” (the example was done (the example was done in 2in 2ndnd-order relational calculus)-order relational calculus)

2 ways to implement query evaluation in CTS DBs:2 ways to implement query evaluation in CTS DBs: Translate the query to relational algebra, use Translate the query to relational algebra, use

generalized versions of RA operations.generalized versions of RA operations. Directly eval the query in closed form (resulting in Directly eval the query in closed form (resulting in

a timestamp relation) using quantifier-elimination a timestamp relation) using quantifier-elimination procedures for the temporal and data domains.procedures for the temporal and data domains.

Page 34: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

4.2 Relational Algebra

RA semantics are defined as set theory for RA semantics are defined as set theory for possibly infinite relations, so it fits the possibly infinite relations, so it fits the model-theoretic view of ATDsmodel-theoretic view of ATDs

In snapshot view, RA operations can be In snapshot view, RA operations can be used only on snapshots corresponding to the used only on snapshots corresponding to the same time instants in different relations same time instants in different relations ((pointwisepointwise).).

Page 35: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

4.3 Temporal Logic

Use a temporal extension of 1Use a temporal extension of 1stst-order -order LLDD: : tltl((LLDD))

Contains the binary connectives “since” & “until”Contains the binary connectives “since” & “until”

AA = “sometime in the past” = “true = “sometime in the past” = “true sincesince AA””

AA = (sometime in the future = (sometime in the future AA) = “true ) = “true untiluntil AA”” These connectives may become invalid when the These connectives may become invalid when the

dimension is > 1dimension is > 1

Page 36: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

4.4 Inductive Query Languages Natural queries may be inductive or 2Natural queries may be inductive or 2ndnd-order-order Ex: “find all who are at risk (infected previously or Ex: “find all who are at risk (infected previously or

been in contact with an at-risk person)”been in contact with an at-risk person)” Logic programming languagesLogic programming languages extend extend DatalogDatalog

(language of function-free logic programs):(language of function-free logic programs): DatalogDatalog<z<z – with integer order constraints – with integer order constraints DatalogDatalog<Q <Q – with rational order constraints– with rational order constraints DatalogDatalog1S1S – – a unary successor symbol in 1 arga unary successor symbol in 1 arg unary successor symbol + linear arith constraintsunary successor symbol + linear arith constraints

Page 37: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5 Concrete Query Languages

5.1 5.1 TQuelTQuel Supports single temporal domain: discrete, finite, Supports single temporal domain: discrete, finite,

multi-level (can refer to specific day or hour)multi-level (can refer to specific day or hour) 2 temporal dimensions: 2 temporal dimensions: validvalid and and transactiontransaction time time Data model: a timestamp is an intervalData model: a timestamp is an interval

Intervals must be maximal so the timestamps of Intervals must be maximal so the timestamps of identical facts coalesce for overlapped intervalsidentical facts coalesce for overlapped intervals

An insertion may trigger a coalesce operationAn insertion may trigger a coalesce operation

Page 38: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5.1 TQuel (continued)

TQuel can simulate temporal logic queriesTQuel can simulate temporal logic queries 11stst-order language: can’t express inductive -order language: can’t express inductive

temporal queriestemporal queries Data complexity: polynomialData complexity: polynomial Timestamp max req Timestamp max req a given abstract a given abstract

temporal rel is uniquely rep’d as a TQuel reltemporal rel is uniquely rep’d as a TQuel rel No support for > 2 temporal dimensionsNo support for > 2 temporal dimensions

Page 39: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5.2 TSQL2 SQL2 with time componentSQL2 with time component Linearly orderedLinearly ordered No test for equality of time constraints (can give No test for equality of time constraints (can give

diff answers for discrete & dense temp domains)diff answers for discrete & dense temp domains) Point-, not interval-basedPoint-, not interval-based Facts are timestamped with finite unions of max’l Facts are timestamped with finite unions of max’l

intervals (one timestamp/fact)intervals (one timestamp/fact) No semantics or formal properties established No semantics or formal properties established

use of interval rel’s; insufficient for unions of use of interval rel’s; insufficient for unions of intervalsintervals

Page 40: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5.3 Hist. Relational Data ModelHRDM supports single, discrete and infinite HRDM supports single, discrete and infinite

temporal domain + single time dimensiontemporal domain + single time dimension Relations are finiteRelations are finite Non-uniform rel attributes: some are parts of keyNon-uniform rel attributes: some are parts of key Non-key attributes can be functionsNon-key attributes can be functions limited limited

non-1NF relationsnon-1NF relations No spec’s for which subsets of the temporal No spec’s for which subsets of the temporal

domain can serve as function domains: difficulty domain can serve as function domains: difficulty assessing expressiveness of the model or comp assessing expressiveness of the model or comp complexity of queries.complexity of queries.

Page 41: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5.3 HRDM (continued)

Redefines most operators of RARedefines most operators of RA Semantics defined with set theorySemantics defined with set theory Can’t express queries relating snapshots at Can’t express queries relating snapshots at

different instantsdifferent instants 11stst-order algebra can’t express inductive -order algebra can’t express inductive

temporal queriestemporal queries SQL extension not representation-SQL extension not representation-

independentindependent

Page 42: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5.4 Backlog Relations

Supports single, discrete, infinite temporal domain Supports single, discrete, infinite temporal domain + + valid-valid- and and transactiontransaction--timetime dimensions dimensions These 2 dimensions are not independent hereThese 2 dimensions are not independent here

Backlog rel’s store not data, but Backlog rel’s store not data, but change requestschange requests Only transaction-time instants are storedOnly transaction-time instants are stored

Valid time requires a scan that a tuple was inserted Valid time requires a scan that a tuple was inserted but not later deletedbut not later deleted

BRs rep only finite abstract temporal relationsBRs rep only finite abstract temporal relations

Page 43: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

5.4 Backlog Relations (continued)

Example - 5 attributes: consec# of updates; op-name; Example - 5 attributes: consec# of updates; op-name; transaction time; country; capital.transaction time; country; capital.

Page 44: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

6 Incomplete Temporal info

Example: partial ordering of eventsExample: partial ordering of events

Various solutions proposed:Various solutions proposed: Non-linear, based on eventsNon-linear, based on events Generalize the temporal db paradigmGeneralize the temporal db paradigm Marked nulls – stand for some value in domainMarked nulls – stand for some value in domain

Same null value may be in diff columns or rowsSame null value may be in diff columns or rows Each row has quantifier-free local condition with Each row has quantifier-free local condition with

some nulls of this rowsome nulls of this row

Page 45: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

6 Incomplete Temporal info (cont’d)

Entire table has a quantifier-free global condition Entire table has a quantifier-free global condition relating nulls in different rowsrelating nulls in different rows

Indefinite timestamp formulae define indefinite Indefinite timestamp formulae define indefinite timestamps which are sets of timestampstimestamps which are sets of timestamps

An An indefinite timestamp tableindefinite timestamp table is a finite set of is a finite set of tuples with tuples with indef ts formulaeindef ts formulae + a global condition + a global condition

Semantics of an indef temporal table Semantics of an indef temporal table semsem((TT):): reprep((TT) is {ts rels ) is {ts rels subst’ing domain vals for subst’ing domain vals for

nulls satisfying the global condition of nulls satisfying the global condition of TT

Page 46: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

6 Incomplete Temporal info (cont’d)

In van der Meyden’s framework, only single vals, In van der Meyden’s framework, only single vals, which may be null, can constitute timestampswhich may be null, can constitute timestamps

Only finite ATDs can then be representedOnly finite ATDs can then be represented Nulls can be related via global conjunctive condNulls can be related via global conjunctive cond May be arbitrary # of temporal dim’s, but the May be arbitrary # of temporal dim’s, but the

complexity of evaluating queries relies on the num.complexity of evaluating queries relies on the num. Data complexity for certain answers to FO queries:Data complexity for certain answers to FO queries:

In PTIME for one-dimensional timeIn PTIME for one-dimensional time co-NP-complete for greater # of dimensionsco-NP-complete for greater # of dimensions

Page 47: Temporal Query Languages a Survey by Jan Chomicki, January 24, 1995 Computing and Information Sciences Kansas State University Presented by Barry Klein,

7 Related Work in AI

Most AI approaches restricted to the propositional Most AI approaches restricted to the propositional (non-temporal) case(non-temporal) case

Often take an interval view of time originating in Often take an interval view of time originating in the work of J.F. Allen, where each prop is assoc the work of J.F. Allen, where each prop is assoc with an interval where it holds true.with an interval where it holds true.

2 intervals could relate via a {rel’s representing a 2 intervals could relate via a {rel’s representing a disjunction}disjunction} allows rep of much disjunctive info allows rep of much disjunctive info

11stst-order queries re quantifiers are not supported-order queries re quantifiers are not supported Queries eval’d via constraint-satisfactn algorithmsQueries eval’d via constraint-satisfactn algorithms