A pattern matching language for spatio-temporal ... - Semantic Scholar

2 downloads 274 Views 852KB Size Report
Spatio-temporal data, spatial data, tem- poral data, parametric data, pattern ..... and a temporal element respectively. The expression reg n p will be treated.
A pattern

matching

language

Tsz

S. Cheng

for spatio-temporal

and

Department

Shashi

K. Gadia

of Computer

Iowa

State

Ames,

Iowa

{tcheng,gadia}(

Science

University 50011-1040

lcs.iastate.edu;

(515)

other

Abstract We propose

a pattern

databases.

based

upon

the

dimension gions. for

it

The

paper

The

concept

on

of the

language

language

ParaSQL

databases,

for

because

of the In

can

SQL-like The

in active

spatial

pat-

Index

terms.

data,

relational time

Spatio-temporal

parametric

data,

databases,

cursor,

object

active

spatial

data,

matching,

identity,

SQL,

dimension

temobject-

alignment,

of patterns our

posed

for

WD92, [SV89, Most

temporal

SS87, Gut88,

expressive

For

application

bedding

on

ples in spatial

and

complex,

at

them

but

a uniform

a user

time

ceive nature,

the

same

structure. pattern

to express

From and

temporal

a powerful

such

purpose

paradigm

complex

for

queries

studied

are similar,

where

the

differently.

concept

very

powerprovide

be very

underlying

model this

language with the

yet

pattern

of change

has

patterns

language

the query

patterns

tion

provides

are

in

two

second

it

respects.

One

of AOB.

reminder

to have

of our

Thus spatial,

ex-

SQL

and

thus

seamlessness temporal

like

is

generaliza-

in a uniform

and

manner,

associative

navi-

of this

a fixed

paper

context,

object-relational

is organized

in Section

as follows.

In or-

parametric

2 we give

data

ParaSQL.

In

Section

3 we introduce

Tu-

matching

language.

In

Section

4 we give

and

interesting

We

examples.

discuss

future

conclude

in

an overview

model

language

also

the

feature

Such

to ParaSQL

First,

extends

of

in ParaSQL.

The

gives

have

seamlessly

[CGN93].

are handled

seamlessly

patterns

independent

to be rewritten.

patterns

where

appli-

for our object-relational

compatibility

need

We

find

databases

language

language data

backward

achieved

is

this

a generalization

queries

languages.

would

DG93].

In particular

spatio-temporal

that

der

allows

2

Overview temporai

of spatial and

per-

The

an evolutionary

is important.

for

SC91,

matching

ParaSQL1,

and

ease. structures

and

and

its query

our

and

pattern

explain

Section

some

5, where

we

work.

structure,

which

we experience

Time

large

in [Da88,

of a model.

gation

(e.g.

development.

to exploit

of view

lack

do not

and

pat t ems

query

temporal

to em-

language are

and can

matching

dimensions time

the

In order

point

and

as C++

databases time

to resort

level

application

and

to

language databases,

spatio-temporal

development.

confined

matching active

is

data-

is not

pattern

as triggers.

no existing

Egn94].

(AOB)

has

languages

an abstract

space

often

a lower

Tan93,

temporal

application

one in

languages

are general

an appropriate

we give

for

pro-

databases

GC93,

and

navigation

needed

been

CC87,

spatial

RT93,

spatial

associative

language

Although they

and

Ash93, in

development

a query

C++).

OM88,

power

GV85,

PM93]

languages

concentrate

the

ful,

query

[Sn87,

PM92,

RFS88,

of the

bases

databases

SC91,

have

on pro-

[SA93]

cases of spatio-temporal

Active

model languages

is based operators

in

Temporal

used

tends query

be found

crm-

matching

spatial

in spatio-temporal

be Our

and

we

of time

A discussion

can

paper.

are special

dimension

pattern

using

in

shapes

matching

[Ash93].

operators of this

time

pattern

regions,

located

certain

concept

string

spatial

ADJACENT

scope

the

can

databases.

of models

in

cations been

Introduction. A number

the

that

choice

1

and

at once,

having

on the

cursorin

The

of these

patterns

Use

as triggers.

data,

pattern

mind,

to the

all

other,

syntactically. feel

poral

in

of spatial

BETWEEN

there,

matching

[GG73].

is beyond

query

this

is similar

some

are

to each

pattern

properties

cessing

pattern

application

be used

like

model

the

our

which

on the

this

databases.

also have

patterns

underlying

our

sor,

regions

relative

Keeping

based

in SNOBOL4

of rein

sizes.

have

is

in spatial sizes

particular,

extends

would

and

introduced

spatio-temporal

language

but

shape

choice

seamlessly

dimension

of time,

matching

databases.

matching

matching

nature

time

spatial

directions

and

for spatio-temp-

in

placement,

of pattern

is independent

language

process

evolutionary

is based

spatio-temporal

tern

matching

matching

294-4377

hand

some oral

databases

On

the

concept

matching

of the

choice

data.

to fix

a context

the

In

nary

order we give

query

guage

handle data

spatial,

Para stands databases

introduced

for

our

of our

ORParaSQL.

seamlessly.

model

of a model

an overview

language

1 The prefix spatio-temporal

288

of pattern

is independent section

Permission to co y w“thout fee all or part of this material is granted provided t 1!at the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Association of Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission. CIKM ’94- 11/94 Gaitherburg MD USA @ 1994 ACM d-89791 -674-3/94/001 1..$3.50

of our object-relational data.

temporal, ORParaDB

for

in this

in

ORParaDB

model

and

based

for parametric, of which are special cases,

and on temporal,

this and

query

spatio-temporal is

paper

spatio-temporal

illustrations,

model,

Our

for spatio-

lanordi-

relational spatial,

model

[GC93]

Details

of

ticularly

and

our

the

parametric

dimensions

Object

in

of our

a user

approach

to

mix

2.5

[Da89].

[CGN93]2.

A

of its

on

ORParaSQL

different

expressions tually

to

object

values

an

object

iderztitg

and

and

( oid),

invisible

which

TRUE

to the

Suppose

persists

as long

instant

as the

(U),

elements.

and

a universal subsets

intersection

(=).

For

time

(fl),

elements

elements spatial

the

R the

unions If

and

If the

under

domain

is

the

then

then

is

are called

domain

is

the

%:rpe~

A parametric into

the

erty

function

junction

domain

is a mapping A

supertypes

and We

functions must

have

from

its

object,

our To

of object

ype(s).

this

value

model

an the

aliasing.

An

represent

the

of a subtype

same

supertypes,

it will

be

an

instant

the

alias

object

real

relationship

the

and

It

one

poral

and

Dimension

tlhat

in each

is symmetric

soil

of amd

transitive.

Parametric The

o,

parametric

[P(o)],

is

parametric model: o.

of a set for

all

striction: must of the

is the for

supertype(s)

every of

property o in

of the

of

P of the

an

There

domain parametric

an

property object T,

of type

IO]

, is the

is a type of an object domain

[o],,

ORParaDB

is of type

(Object-Relational

Parametric

any

clay

[seIect

of

from

re-

where from

view

of

tem-

and

embedded

into

syntactic

changes. about

soybean which

maximum

the wells,

is grown the

d/g

allowable

[CROP-NAME(P)

crops

soils

and concon-

above are

[TEXTURE(S)

= clay

loam]

s] >

epas

e

CHEM-NAME(e) =

=

atrazine)j

atrazine]

c query,

the

oDerators .

with

spatial,

and

When

= soybean]

p]

MAX(e)

well-chems the

intersection

289

of space.

in users

as follows.

n ~cHEM-NAME(c)

temporal.

where

s

(select

operands

reg n

x p),

CROP-NAME(p)

n ED/G-CONC(C)

database).

of

element

c

from

alias(m)

our

existing

and for the

system

the

example

where

exceeds

In

by

universe

the information loam,

types.

T) (R

seamless For

our nec-

expression

x

R is the

region

in

dimensions

The

as (reg

be mixed

restricted-to

[WD92].

and

becomes

missing

can

find

features

p be a spatial

without

be expressed

n [select

is

the

reuse.

the

from

2In [CGN93] we termed our query language 00 ParaDB (ObJectOriented Parametric Database) Now we have renamed it more accuto

in

in

restricted-to

of a subtype of its

query

of atrazine

do-

union

inheritance

ParaExp

done

reg and

and

queries queries

can

in our

T,

functions;

parametric

to true

query

centration

In

rately

allows

object

parametric

sets

statement

alignment

respectively.

leads

centration

P of an object

The

of

system

of time,

1. The

corresponding

is assumed

P of T.

O of type O.

parametric

be a subset

domain

for

domain any

a property

Homogeneity

same

of objects

instants the

as the P(o).

parametric

[P(o)],

main [o]

defined

of

a mix

by the

restricted.to

domain

function [P(o)]

The

then

domain.

union

also

select

interesting

Such

let

spatial

texture

an

spaces

are located

select

2.4

01

of sets of objects;

is automatically

alignment

Example which

is

element

also

of property

whole

spatio-temporal

both

then

OZ are the

Sets is list

example,

universe

data.

Note

the

be treated

t.

simply

T,

alignment.

querying

For

objet

(or

of type

intersection

ORParaSQL.

a temporal

p will

so are f

expression.

alignment

padding

T is the

notion

at p.

when

model,

each

the

alias(es)

essary

for

p, if they

world

have

key ypes

of only

alias

language

operands.

list

Object

alignment

query

by

key functions

we define

always

any

value

domain

su-

supert

by another

o is an

in the

one

its

property

have

the

only

parametric wiU

not

inherit

be taken

object

from some

or indirect)

takes can

entity

and

does

its

functicms.

functions

isa relationship,

o’ in

an object its

and

object

capture

of an object

(direct

specifying

have

Dimension

parametric

01

ORParaSQL

is the

Dimension

A prop-

property

type

its

cannot

by

of

each

A key

into

defined

If a type

then

key functions

supert and

alias)

own,

is

property

that

value.

In

is a boolean

2.6

a para-element

an object

signatures

inherit

require

of its

In

of

as key functions.

function

type.

t~pe

a list

from

(attribute)

from

parametric

of subtype

pertypes.

property

then

[Key]

SelectList

boolExp

type and type hi-

is a mapping

of the

functions. Objects

parametric

p ~ v is a boolean

expressions

boolExp

Here

function,

v are par a,u.

ParaExp

is a para-expression;

2.3

If p and

ObjectSets

where

elements.

e are

an object

form.

Select List

from

R we

and

T.

following

functions,

then

boolean

are K,

o and

f.

OZ,

restricted-to

spatial

2’ x

the

p, P,,

n v, p — v and

p

OZ are sets of objects

of type

in short)

property

mu-

boolean

respectively.

~e], where

respectively.

g are

not

difference

select

ternporcd

domain

elements

has

of

para-

and

so are p u v,

g and

and

01

of objects,

v are para-expressions,

of objects

set

the

called

parametric

parametric

Oz,

[o] element,

If f and

If 01

P.

union

complementation

of intervals

the

domain

closed

{0,1 ,...,NOW},

parametric

[CGN93].

sprbt%o-ternporal

(–)

=

GY88].

[Ga88,

P,

parametric

[O,NOW]

are finite

domain

elements get

if

2’ =

parametric of

subtraction

example

instants

metric

are

sets

are

elements,

(para-expression

set expression,

or g, f and

we are given

and

0P2(O)],

parametric

expression.

elements

and

boolean

expressions

to parametric

expressions

If p and

Parametric

expressions

expressions,

These

evaluate

or FALSE,

expressions,

Parametric

and

[PI(O)

constant

user.

of parametric

set expressions.

recursive,

[PI(o)],

is

exists.

2.2

consists

and

Parametric by its

boolean

is dimension

queries

values

internal

is unique

Parametric expressions, set expressions.

par-

effortlessly.

is identified

independent oid

allows

of OODAPLEX

found

identity.

An object

object

be

feature

which

2.1

structure

can

noteworthy

alignment,

An

type

model

evaluating

restricted-to four the the

clause

oDerands. re&ining system

has

The two will

three

first are

align

two

spatiothe

first

two

operands

third

and

to

the

spatio-temporal

fourth

to

match

them

with

AT(12/31/90)

the

As

we will

shortly,

3

The pattern In

for

this

section

matching

language

we present

a pattern

spatio-temporal

pattern

databases.

matching

of a model

presented

the

big

In this

also

be used

In the

context

guage

extends

(Note

that

sical vides

we only in

construct

~PJ (o)t?Pz

backward

the

allowing

B>’.)

As

the

to the

the

cursor examined,

in

the

cursor

The

In

the

spatio-temporal

proposed ral

language

patterns

either

spatial

patterns,

version

of OR-

migrating

Pattern tion

of patterns

semantics).

(the

Before

to understand

model

will

need

of two

syntax)

and

pattern

to

We

The-

the the

matching

if

of spatiofrom

In

other

matching

The pattern There

are

two

spatio-temporal tial ing

time

temporal

on

the

pattern

cursor,

the

cursor object

case,

Temporal of

values

pattern

time

line

in

fied

pattern.

cursor.

A

which To

time

instant

on

time

instant

that

time

an

processes

achieve

pattern

matching

is based

spatial

pattern

of

done

the

unit

at

we need

simply

cursor

of

the

a time.

zone

Spatio-

to the of

to

match

end

the

to

cursor

step

the

matching

advance

as specified cursor

of the let

pattern

us consider

Example 50K

2.

on 1/1/91

just

matched.

a simple The

the to

each

the

) To

will

(In

following

illustrate

a

the

time.

The one

pattern

salary

an

is SALARY. the

attribute =

40K

be 40K

after

(the

=

at the

next

cur-

is set to one

the

No

system

cursor of”

first

Now

takes

the

SALARY

if it is 40K.

to

salary

is 50K,

day.

checks

movement

AT.”

moves

1/1/91.

If this

Similarly

the

is

at the

pattern

matches

1/2/94.

matching

the

was

raised

as follows.

than

and

pattern a binary

this

case

prop-

spatial

inner

ones.

Let

can

50 miles

within

where

do-

pat t ems

us consider

of earth

quake

the population

be expressed

as follows.

may

den-

(Also

see

ADJACENT

also be formed

tial

region

CIRCLE

by

matching, region,

region

region,

the say

regl. say

regz

is checked

ance

parameters.

On

regs, if it

one

of the

a built-in region

where

spatial

another

within

system

the

where other

where is adjacent

pat-

first

times

In

pattern

function. It

takes

In a spa-

=hlgh

as its

input

50 miles

of the

input

=

high.

it

is area

hand,

the

to reg3,

followed

A spatial built-in

=

a spa-

pattern.

computes

POPULDENS

(0)

pattern

function.

EARTH-QUAKE reg2,

spatial

spatial

EARTH-QUAKE(o)

spatial

say regl,

Many

an operator.

by using

specified

500.

one

then

is such

is such

the

by

and

in the

CIRCLE(EARTH-QUAKE >=

be formed

50)

500)

embedded

= high,

operator

case

the

>=

POPULDENS(0)

this

the

high,

=

subpatterns

may

of the

290

outer

(POPULDENS(0)

are three

by

default

l(a).)

area

(EARTH-QUAKE(0)

tial

domain

to

the

of the

or more

be nested,

to the area

500

50)

the

JOK

pattern

high,

putes

see Figure

can

then

is adjacent

EARTH-QUAKE(O)

the

from

(Also

pat t ems and

3. The

When

mechanism,

of one

l(b).)

region,

If

is an examination

positions

spatial

tern:

match-

example.

can be expressed

is

50K

by a sequence

should

granularity

matching

first

and returns region.

options. can be

automatically

options.

instant,

call

are examined.

cursor

cursor

the

to

right,

in pattern

of variables

then

by

moves

In

values

succeeds,

case

the

the

time

movement

variables. and

of

cursor left

stored

object

the

a speci-

We

setting cursor encountered

in program

if

example.

There

of

concept

line.

is from

nature

the

can be altered by certain information

the

only

dependent

called

to determine

to

relative

Since

higher

Figure

an examination to

and its resolution As patterns match ing,

=

attribute

values

semantics

pattern

the

which

sity

the

is a pointer

time

points

The

40K

“SALARY(0)

pattern,

if the

pattern

and

Example

match-

regions.

the

cursor)

cursor

time

ADJACENT

is made

l-dimensional

the

movement

is be-

if and

followed the

pattern

cursor

cursor

Spatial

a simple

spa-

by interleaving

beginning

this, (or

pattern

attribute

= 50 K”,

is 12/31/90.

advances

are evaluated

in

and

is basically

the

attempt

cursor

time default

from

= An

immediately

entire

by the

the

cursor

mains.

matching

matching

of objects

50K

o is checked

then

cursor

erties

matching

is then

pattern

place

case

The

the

time

CIRCLE

Temporal

this

attribute

the

of the

3.1.2

processes.

3.1.1

says

(the

it is necessary

matching

positions

matching

this

take

SAT.ARY(0)

by “4oK

that

as specified

and

pattern while

relative

(We

simply

process.

pattern

TemporsJ

of time

pattern. It

When

will

pattern.’ In

and

matching

current

process

temporal

matching.

concept

is based

two

different

model:

pattern

on the

matching

)

time).

Spatial

3.1

/90.”

of an attribute

that

place, the

construc-

process

language,

pattern

says

assume

When

tempo-

model

the

pattern.

subpat-

=5oK”.

independent

match

pattern.

cursor

be rewritten

elements:

of two

=4oK

is 12/31/90.

is followed

50K”

generalization.

consists we introduce

the

cases

be seamless.

queries

a spatio-temporal

matching

Since

are special

or spatial

to

varieties.

to be introduced

a tem-

two.

to spatio-temporal

or spatial

no temporal

when

patterns

be

of the

“SALARY(0)

dependent

follow-up

as “select

can

a mix

all these

migration

temporal

words,

or

time

consists

This

of claspro-

a pattern

pattern

supports

and

temporal

model,

a spatial

consists

12/31

the

of comparisons.

sor

pattern,

rules

pattern

autonomous

is at

second

pattern

lan-

integration

previous

syntactic

use

matching

such

an

“the

of ORParaSQL.

queries

it

ing

patterns

of “A9B”

the and

we

ParaSQL. poral

=50K

is an attribute

term

attribute

pattern

a result,

compatibility

will

databases.

is counterpart

databases

of

fits

databases;

~Pl (o)OPZ (o)]

(o)]

A
=

using

spatial

then

com-

50 miles computes

500. certain

Finally toler-

SALARY = ~~ i’ime line

4(K

50K +

12/31/90

1/2/91

1/1/91

(a) The temporal pattern described in Example 2,

(b) The spatial pattern described in Example 3

&q----------p1

(c) The spatio-temporal Figure

3.1.3 In

Spatio-temporal the

spatial

spatial-temporal

plane

matching at

each

instead

is like

was

the

4.

pattern value

that

there

emporal

matching,

pattern

pattern

ago can

earth

may

is a

pat tern

except be

comparison.

quake

be expressed

described

in Section

other

that

examined

Now

let

us

example.

The

10 years

Spatio-t

a spatial

a attribute

a simple

we view

instant.

temporal

patterns

matching

context, time

instant,

of just

Example it

at each

time

consider

Figure

pattern

1: Various

pattern described in Example 4.

area

is larger

as follows.

(Also

than :see

the

spatial two

In

pattern

= high)

ARB(9) ((EARTH-QUAKE

(o)

= high)

PROPER-CONTAIN The tial

spatial-temporal

pattern

followed

quake-area)

(A

Once

a spatial

then

be treated

variable

spatial

can

temporal

be viewed pattern

as one and

then

spaan-

side the

case,

it

to

the

starts

is used

the

“=:” the

program

with

is

spatial variable

an underscore.) the

pattern.

In

as a spatial

and spatizd

operator aasigns

is defined/assigned, spatial

pattern are

variable this

pattern

can

case

in the

the sec-

pattern. the

cursor Then

more

years.

year,

operator

Now

first

=

the

the

cursor

contains

the

the

it

default

is then

spatial in

the

cursor

spatial cursor

region

the

resolution

advanced the

at the stored

the

stores

advances

computes

EARTH-QuAKE=high

properly

and

that

ARJ3(9) system

computes

high,

Assuming

is one the

where

if it

system

EARTH-QUAKE

-quake-area.

of the

291

always

as another

matching,

year.

checks

this

=high)

variable

temporal

right

pattern,

In

variable

where

say regl,

and

spatial

quake-area

variable

-quake-area)

pattern by one

=:

first

is the

left

(EARTH-QUAKE(o)

region (o)

its

operator.

-quake-area.

ond

ARB(g)

on

the

an assignment

When

((EARTH-QUAKE

pattern.

patterns

patterns.

l(c).)

3.1

by

1

by

9

region, time

and

_quake-area.

3.2

Construction In

ing

this

section

we

spatio-temporal

spatial will

mat ched

by

cursor

at the

the

will

the

cases.

current

pattern

be

last

for

and

returned.

time

the

After

instant

[


I

{[{}]



pattern>}}

I

{< SpTemp

pattern>}

cursor. after

the

from

left

right.

cursor

cursor

first

There ifies the

indep

of the

variable>

ARB

time

the

until the

are

several

right

cursor

to left,

specifies or user

the

logical

the

how

autonomous

defined.

]

following

be.

it

pat tern

followup

not

comparison

are patterns

attribute dependent other is the temporal

can

the

have

the

not

time

cursor

to )



comparison

constant>



I

I

to

attribute

rNTERVAL~AST specified

I

I . . .

instant>

I LAST

where

>

respectively.

indep

FIRST stants

::=

constant

lNTERVAL-LAST

AT, with

the

I . . .

first

and

is defined. the

interval

first where

the

last

time

INTERVAL31RST

and

the

the

last

time

attribute

inand

instants

is defined.

)

I . . .

3.2.2

Spatial

pattern



::=

suppressOperand

..— ..—

or assignment> of constants>)

I I

must

will

OR specifies

and

both

INTERVALllRST

a pattern.

will one.

After

instant

FIRST

is such pattern.

cursor

point.

that

< attr

attributes.

the

plus

For

operands

domains

cursor

is set to the indep



cause

domain.

I

must

both of their

be returned.

specifies

advance.

a match.

opposite

time instant, comparison

>

matching,

cursor

spec-

that

of AND,

resulting



intersection

operands

independent)

::=

that



operands

independent

much

is specified,

,-PUNCTION,HOURS

LINEAR)

8,

above Nevada

We have

j

the

s /*

clause, = very

be

HOURS(24))

matching

=

and

#

specifies

5/1/94)

(w)

spatio-temporal

AND

the

dimension.

(TEMPERATURE

[cITY(w)=”

(12:OOam

energy

regions

the

suppres-

pe-

5/1/94)

weatherin-Iowa

Example

the

operator

[CIRCLE((EARTH_QUAKE(S) low

for

These

(_FUNCTION

can

of”

list

low

[STATE(S)

ple/object

[AT

AT(12:ol)am

the

ma-

as follows.

states

where

EVoL(#)

to find

:(-FUNCTION=LINEAR))

tern

from

value

specifies

same

had

EVOL

be

the

resulting

minimal

suppressOperand

afpat-

previous

=

them

attempts

cursorJump

where

and

Furthermore,

CONTAINED-IN

PRESSURE(w)

from

resources

s

of

The

one

LOCATION(e)

be matched Jump

)

query

very

be expressed

very

as follows.

select

that in the

having

and

of the

AT(FIRST)

The

restricted_to

instead

pattern.

9.

select

as in

pattern.

The

Des

the

between

temperature

expressed

have

indicating included

Nevada,

flooding

specifies

beginning

is to put

in

is true

same

approach,

in

cursor of the

be the

beginning,

operator

is the AT(BEGIN)

equivalent

condition

must

query

must

be greater

same

AND

occurrence

time

at the

must

The

time.

household operations.

subpatterns

are not

in

can

clause

LOCATION

=EVOL(

Suggest Documents