Approximate Functional Dependencies for XML Data Fabio Fassetti, Bettina Fazzinga DEIS, University...

Post on 17-Dec-2015

215 views 1 download

Transcript of Approximate Functional Dependencies for XML Data Fabio Fassetti, Bettina Fazzinga DEIS, University...

Approximate Functional Dependencies for XML DataFabio Fassetti, Bettina Fazzinga

DEIS, University of Calabria, Italy

ADBIS 2007 - Varna (BUL), September 29 - October 3ADBIS 2007 - Varna (BUL), September 29 - October 3

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 2

Outline

Preliminaries Inference Problem Classical Approach Our Approach System Architecture Conclusions

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 3

Preliminaries:XML Functional Dependency

Left Part Right Part

{p1, p2,…pn} q

XML Paths…

course

name year

"DatabasesSystems"

"2005"

faculty

professor

"Robinson"

course

name year

"DatabasesSystems"

"2006"

professor

"Robinson"

course

name year

"Programming""2006"

professor

"Brown"

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

/faculty/course/name, /faculty/course/year /faculty/course/name, /faculty/course/year /faculty/course/professor /faculty/course/professor

XML Tree:XML Tree:

XFD:XFD:

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 4

Preliminaries:Tuples

{/faculty/course/name/#text, /faculty/course/professor/#text}

course

name year

"DatabasesSystems"

"2005"

faculty

professor

"Robinson"

course

name year

"DatabasesSystems"

"2006"

professor

"Robinson"

course

name year

"Programming""2006"

professor

"Brown"

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

course

name

faculty

professor

1

2

3 7

"DatabasesSystems"

4"Robinson"8

course

name

faculty

professor

1

9

10 14

"DatabasesSystems"

"Robinson"11 15

course

name

faculty

professor

1

16

17 21

"Programming" "Brown"18 22

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 5

Inference Problem

XMLDocument

XMLFunctional Dependencies

XMLDocument

XFD

Is it satisfied?

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 6

Classical Approach: XFD Satisfaction

XMLDocumen

t

XFD f: {p1, p2,…pn} q

Tuples {t1, t2, …, tm}

ti, tjAre ti, tj equal w.r.t.

the left part of f?

(ti, tj) satisfies f

yes

no

(ti, tj) does not satisfy f

yes

no

f is not satisfiedby the XML Document

f is satisfiedif and only if

each pair of tuplessatisfies f

Are ti, tj equal w.r.t.the right part of f?

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 7

Classical Approach: XFD Satisfaction

course

name year

"DatabasesSystems"

"2005"

faculty

professor

"Robinson"

course

name year

"DatabasesSystems"

"2006"

professor

"Robinson"

course

name year

"Programming""2006"

professor

"Brown"

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

/faculty/course/name/#text /faculty/course/name/#text /faculty/course/professor/#text /faculty/course/professor/#text ??

XML Tree:XML Tree:

course

name

faculty

professor

1

2

3 7

"DatabasesSystems"

4"Robinson"8

course

name

faculty

professor

1

9

10 14

"DatabasesSystems"

"Robinson"11 15

course

name

faculty

professor

1

16

17 21

"Programming" "Brown"18 22

XFD:XFD:

Tuples:Tuples:

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 8

Classical Approach: XFD Satisfaction/faculty/course/name/#text /faculty/course/name/#text /faculty/course/professor/#text /faculty/course/professor/#text

course

name

"DatabasesSystems"

"Robinson"

faculty

professor

1

2

3

4

7

8

course

name

"DatabasesSystems"

"Robinson"

faculty

professor

1

9

10

11

14

15

course

name

"Programming" "Brown"

faculty

professor

1

16

17

18

21

22

??Yes

1 2 3

(1,2): (1,3): (2,3):

= =≠ ≠

ok ok ok

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 9

Classical Approach: XFD Satisfaction/faculty/course/name /faculty/course/book ?YES!

1 2

3

=

==

=

(1,2): ok (1,3): ok (2,3): ok

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 10

Classical Approach: Flaw 1/faculty/course/name /faculty/course/book ?NO!

1 2

3

==

(1,3): no

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 11

Our Approach: approximation/faculty/course/name /faculty/course/book ?YES!

≈dist>

1 2

3

≈dist<

≈dist<≈dist>

(1,3): ok (1,2): ok (2,3): oksatisfied

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 12

Classical Approach: Flaw 2/faculty/course/professor /faculty/course/semester ?YES!

1 2

3

= =

= =

(1,2): ok (1,3): ok (2,3): ok

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 13

Our Approach: approximation/faculty/course/professor /faculty/course/semester ?NO!

1 2

3≈

(1,3): NO

Notsatisfied

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 14

Classical Approach: Flaw 3/faculty/course/name /faculty/course/credits ?NO!

1 2 3

4 5

(1,2): no (1,3): no (1,4): ok (1,5): ok

(2,3): ok (2,4): ok (2,5): ok (3,4): ok (3,5): ok (4,5): ok

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 15

Our Approach: approximation/faculty/course/name /faculty/course/credits ?NO!

1 2 3

4 5

(1,2): no (1,3): no (1,4): ok (1,5): ok

(2,3): ok (2,4): ok (2,5): ok (3,4): ok (3,5): ok (4,5): ok

≈ ≈Notsatisfied

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 16

Our Approach: approximation/faculty/course/name /faculty/course/credits ?YES!

1 2 3

4 5

(2,3): ok (2,4): ok (2,5): ok (3,4): ok (3,5): ok (4,5): ok

(1,2): no (1,3): no (1,4): ok (1,5): ok satisfied

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 17

YES!

Our Approach: approximation/faculty/course/name /faculty/course/credits

1 2 3

4 5

satisfiedSet of tuples: {1,2,3,4,5}

Maximal set of tuples-satisfying the XFD: {2,3,4,5}

4/5 >

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 18

Our Approach: Approximate Inference

XMLDocument XML

Functional Dependencies

XMLDocument

XFD

Is it ()-satisfied?

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 19

Our Approach:XFD Approximate Satisfaction

XMLDocumen

t

XFD f: {p1, p2,…pn} q

Tuples {t1, t2, …, tm}

ti, tjAre ti, tj similar

w.r.t. the left part of f?

(ti, tj) -satisfies f

yes

noyes

no(ti, tj) does not -satisfy f

THENf is not satisfied by the XML Document

Are ti, tj similarw.r.t. the right part of f?

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 20

Our Approach:XFD Approximate Satisfaction

XMLDocumen

t

XFD f: {p1, p2,…pn} q

Tuples {t1, t2, …, tm}

Is this size at leastthe % of the totalnumber of tuples?

yesno

f is ()-satisfied bythe XML document

Compute the size of the maximalset of tuples -satisfying f

f is not ()-satisfied bythe XML document

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 21

Fox System Architecture

XMLDoc

GraphicalUser Interface

XFD CheckerXFD GeneratorPreprocessing

Module

XFDsapprox

satisfied

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 22

Conclusions

The concept of approximate satisfaction of XFDs has been motivated and discussed

A system to infer such XFDs has been presented

September 29 - October 3, 2007 Varna (Bulgaria)

Approximate Functional Dependencies for XML 23