Docsity

Semistructured Data and Object Exchange Model (OEM) - Prof. Kien Hua, Study notes of Computer Science

Partial preview of the text

Download Semistructured Data and Object Exchange Model (OEM) - Prof. Kien Hua and more Study notes Computer Science in PDF only on Docsity!

Semistructured Data

Semistructured Data

• Semistructured data is data that hassome structure, but it may be irregularand incomplete and does not necessarilyconform to a fixed schema

  • World-Wide Web • Integration of data from heterogeneoussources.

OEM - Definition

An OEM database is a 4-tupleO=(N,A,v,r), where:

– N is a set of object identifiers; – A is a set of labeled, directed arcs

(p,l,c)

where

p,c

N and

l is a string;

– v is a function that maps each node

n^ ∈

N

to an atomic value or the reserved value

C;

and – r is a distinguished node in

N called the

root of the database.

Lorel Example 1

Select

Guide.restaurant

where

guide.restaurant.price < 20.

-^ The result of the query is a singleton set containingthe restaurant object for “Bangkok Cuisine.” •^ Lorel coerces the values to a common same typebefore making the comparisons.

Basic Change Operations

  • creNode(n,v) : creates a new object. Theidentifier n must be new. • updNode(n,v) : changes the value of object

n,

where v is an atomic value or the special symbol

C.

Object n must be either an atomic object or acomplex object without subobjects. • addArc(p,l,c) : adds an arc labeled

l from object

p

to object

c. The new arc must not already exist.

  • remArc(p,l,c) : removes an arc

(p,l,c).

Valid Change Sequence

  • We say that a sequence L = u

, u 1

, …, u 2

ofn^

basic change operations is

valid for an OEM

database

O if

u^ i^

is valid for

O^ i-

for all

i = 1,

n, where

Oo

= O, and

O^ i^

= u

(Oi^

-1), fori^

i =

n.

  • We use

L(O) to denote the OEM database

obtained by applying the entire

L to

O.

OEM History

•^ OEM history

is a sequence H = (t

, U 1

…, (t

, Un

), where Un^

is a set of basici^

change operations and t

is ai

timestamp, for

i = 1, …, n, and

t

< ti^

i+

for

i = 1, …, n-1.

•^

We say

H^

is

valid

for an OEM

database

O if, for all

i^ = 1, …,

n,

U^ i

is

valid for

Oi-

, where

Oo

O, and

O^ i

U^ i

(O

) fori-^

i^

= 1, …, n.

OEM History Example

-^ We have the history H = ((t

, U 1

), (t 1

, U 2

),(t 2

, U 3

)), where 3

t= 1Jan97, t^1

= 5Jan97, t 2

= 8Jan97. 3

  • U

= { 1

updNode(n

,20), creNode(n 1

,C), creNode(n 2

,” Hakata 3

”),

addArc(n

,” restaurant 4

”,n^2

), addArc(n

,” name 2

”, n

) } 3

  • U

= { 2

creNode(n

, “ need info 5

”) addArc(n

, “ comment 2

”, n

) } 5

  • U

= { 3

remArc(n

, “ parking 6

”, n

) } 7

OEM graph with Annotations

DOEM Database

  • The set of all possible node annotations isdenoted by

node-annot

, and the set of all

possible arc annotations is denoted by

arc-

annot. • A

DOEM database

is a triple

D = (

O,

fN

,f A

where

O = (

N, A, v, r) is an OEM database,

fN

maps each node in

N to a finite subset of

node-

annot, and

fA^

maps each arc in

A to a finite

subset of

arc-annot.

Chorel Example 1

QUERY

: Find the names of all restaurants whose price ratings were updated on or after January 1st, 1997to a value greater than 15, together with the time ofthe update and the new price. Select

N, T, NV

from

guide.restaurant.price <

upd at

T to

NV >,

guide.restaurant.name N

where

T >= 1Jan97 and

NV > 15

Answer

name “Bangkok Cuisine”^ new-value 20^ update-time 1Jan

Chorel Example 2

QUERY

: Find the names of restaurants to which a “moderate” price subobject was added sinceJanuary 1st, 1997. Select

N

from

guide.restaurant R, R.name N

where

R. <

add at

T> price = “moderate” and

T >= 1Jan