Gottlob ICDE 2011

Post on 22-Nov-2014

725 views 2 download

description

 

Transcript of Gottlob ICDE 2011

Georg Gottlob

Computing Laboratory

Department of Computer Science

University of Oxford

Joint work with

G. Orsi and A. Pieris

D

reports(john,ann)

reports(ann,tom)

reports(X,Y) employee(X)

reports(X,Y) employee(Y)

reports(X,Y) manager(Y,X)

manager(X,Y),manager(Y,Z) manager(X,Z)

Intensional DB

reports(john,ann) reports(ann,tom)

employee(john) employee(ann)

employee(tom) manager(ann,john)

manager(tom,ann) manager(tom,john)

Q = XYZ employee(X),manager(X,Y),manager(Y,Z)

D

reports(john,ann)

reports(ann,tom)

Intensional DB

reports(john,ann) reports(ann,tom)

employee(john) employee(ann)

employee(tom) manager(ann,john)

manager(tom,ann) manager(tom,john)

Unique

Least Herbrand Model

for

D υ

Q = XYZ employee(X),manager(X,Y),manager(Y,Z)

reports(X,Y) employee(X)

reports(X,Y) employee(Y)

reports(X,Y) manager(Y,X)

manager(X,Y),manager(Y,Z) manager(X,Z)

employee v supervisedBy

supervisedBy v employee

employee supervisedBy

employee v supervises-

supervises v employee

employee v supervises-

supervises v employee

?:- supervises(X,John), employee(X)

employee v supervises-

supervises v employee

?:- supervises(X,John), employee(X)

employee v supervises-

supervises v employee

?:- supervises(John,X)

employee v supervises-

supervises v employee

?:- supervises(John,X)

Usually done with tableaux algorithms

employee v supervises-

supervises v employee

DL axiom Datalog rule

Concept Inclusion

employee v person employee(X) person(X)

(Inverse) Role Inclusion

reports¡ v manager reports(X,Y) manager(Y,X)

Role Transitivity

trans(manager) manager(X,Y),manager(Y,Z) manager(X,Z)

Participation

employee v report employee(X) Y report(X,Y)

Disjointness

employee v :customer employee(X),customer(X)

Functionality

funct(reports) reports(X,Y),reports(X,Z) Y = Z

DL axiom Datalog(?) rule

D

Q = X (X)

D

B ( (B D [ ) B ² Q) D [ ² Q ,

B ¶ D Æ B ²

Q = X (X)

D

B ( (B ² D[) B ² Q) D [ ² Q ,

B ¶ D Æ B ²

DLs (DL-Lite, EL, Flogic Lite)

Datalog

DB

technology

+

constraints

υ

υ

dom(D) = {a,b,c,d}

chase(D, ) = ?

D

D dom(D) = {a,b,c,d}

chase(D, ) = D υ { r(b,z0)

D dom(D) = {a,b,c,d}

chase(D, ) = D υ { r(b,z0), r(d,z1)

D dom(D) = {a,b,c,d}

chase(D, ) = D υ { r(b,z0), r(d,z1)

z0 = z1

D dom(D) = {a,b,c,d}

chase(D, ) = D υ { r(b,z1), r(d,z1) }

see, e.g.,

Deutsch, Nash & Remmel

PODS 08

D

. . .

chase(D,)

M1

M2

h1 h2

D

. . .

chase(D,)

M1

M2

h1 h2

Q h

D υ ² Q , chase(D,) ² Q

Σ Σ Σ ΣΣ

Guarded

Linear

DL-Lite Sticky-join

EL

FO-rewritable

PTIME

Guarded

Linear

DL-Lite Sticky-join

EL

Linear

FO-rewritable

PTIME

Guarded

Linear

DL-Lite Sticky-join

EL

We focus on the linear fragment:

• first-order rewriting

• semantic query optimizations

Q

Q

Q

Q Q*

D

Q

Q Q*

DL-Lite: Popular family of DLs with highly tractable data complexity

DL-Lite TBox Datalog Representation

DL-Litecore

promoter v dealsWith

promoter v customer

DL-LiteR

promotes¡ v isAdvertised

DL-LiteF

funct( supervises- )

professor(X) Y teachesTo(X,Y)

professor(X),student(X)

promotes(X,Y) isAdvertised(Y,X)

supervises(Y,X),supervises Y,X Y = Z

D Q

D Q

Q

Q

Q

Q

Q

Q

Q

Q

Q

Q

Q

Q

Q

SELECT promoter

FROM promotesTo PT, customer C

WHERE PT.promoted = C.name

UNION

SELECT promoter

FROM promotesTo PT1, promotesTo PT2

WHERE PT1.promoted = PT2.promoted

UNION

SELECT name

FROM promoter

Schema

Execute Q over D:

D

SELECT promoter

FROM promotesTo PT, customer C

WHERE PT.promoted = C.name

UNION

SELECT promoter

FROM promotesTo PT1, promotesTo PT2

WHERE PT1.promoted = PT2.promoted

UNION

SELECT name

FROM promoter

Schema

:

:

:

:

:

:

:

Q:

:

:

8-

EL: Popular DL for complex systems modelling (e.g., biology)

EL TBox Datalog Representation

v

u v

9

elephant(E),mouse(M) biggerThan(E,M)

person v 9father¡

9father v person

?:- 9father.{John} u person

person v 9father¡

9father v person

?:- 9father.{John} u person

?:- 9father¡ u 9father.{John} u person

person v 9father¡

9father v person

?:- 9father.{John} u person

?:- 9father¡ u 9father.{John} u person

9father¡, 9father.{John}, person

person v 9father¡

9father v person

?:- 9father.{John} u person

?:- 9father¡ u 9father.{John} u person

9father¡, 9father.{John}, person

father

person v 9father¡

9father v person

?:- 9father.{John} u person

?:- 9father¡ u 9father.{John} u person

9father¡, 9father.{John}, person

father

father

person v 9father¡

9father v person

?:- 9father.{John} u person

true:- 9father¡ u 9father.{John} u person

9father¡, 9father.{John}, person

father

father

Model

T

E

T , E

T

E

T , E

T

E

T , E