Tree Tuples II - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Tree Tuples II

Description:

Lecturer : Dr. Pavle Mogin. COMP 442 Issues in Databases and Information ... A tree tuple t is a function that assigns a value in Vert Str { } to each path in D ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 23
Provided by: depts158
Category:
Tags: tree | tuples | vert

less

Transcript and Presenter's Notes

Title: Tree Tuples II


1
Tree Tuples II
  • Lecturer Dr. Pavle Mogin

2
Plan for the Tree Tuples II Topic
  • Maximal tree tuples
  • Tree subsumption
  • Constructing a document tree using a set of
    maximal tree tuples
  • Reading
  • M. Arenas, L. Lipkin A Normal Form for XML, in
    Proceedings of ACM PODS 02

3
An XML Tree as A Set of Tuples
  • To represent an XML tree as a set of tree tuples,
    we need to introduce the notion of subsumption
    that disregards the tree ordering
  • Given two XML trees T1 (V1, lab1, ele1, att1,
    root1) and T2 (V2, lab2, ele2, att2, root2), T1
    is subsumed by T2, denoted T1 ? T2 if
  • V1 ? V2
  • root1 root2
  • lab2V1 lab1
  • att2V1?Att att1
  • For all v?V1, ele1(v) is a sublist of a
    permutation of ele2(v)

4
Comments on Subsumption
  • lab is a set of pairs (v, e)
  • Projection of lab onto the set of vertices V ,
    denoted labV is a subset of lab pairs having
    elements from V as the first component
  • In the definition we request that each vertex v
    from V1 maps into the same element e as does the
    vertex v from V2
  • att is a set of pairs ((v, a), s)
  • Projection of att onto V?Att, denoted attV?Att
    is a subset of att pairs having (v,a) from V?Att
    as the first component
  • In the definition we request that each pair (v,a)
    from V1?Att maps into the same string s as does
    the pair (v,a) from V2?Att
  • Also, we request that if v is in V1, and (v, a)
    is defined in T2, it is also defined in T1

5
XML Tree as a Set of Tuples (tuplesD(T))
  • Given a DTD D and an XML tree T such that T ? D,
    tuplesD(T ) is defined to be the set of tree
    tuples t such that for each t, treeD(t) is
    subsumed by T
  • t??(D) ? treeD(t) ? T

6
A Class Document Tree
CLASS
1
_at_name
COMP442
LECTURER
2
_at_lecId
STUDENT
STUDENT
4
Pavle
8
ASSIGNMENT
111
NAME
_at_no_of_pts
_at_origin
_at_origin
_at_no_of_pts
9
6
5
7
NAME
Bad Student
Domestic
_at_no
20.0
International
Ahmed
_at_no
10.0
0.0
10.0
1
2
7
t1 Tuple as An XML Tree
CLASS
1
_at_name
COMP442
LECTURER
STUDENT
4
2
ASSIGNMENT
Pavle
_at_lecid
_at_no_of_pts
_at_origin
6
5
NAME
111
20.0
International
Ahmed
_at_no
10.0
1
8
t2 Tuple as An XML Tree
CLASS
1
_at_name
_at_no_of_pts
COMP442
31
AUDITOR
LECTURER
STUDENT
4
3
2
ASSIGNMENT
Pavle
_at_lecid
Sharon
_at_no_of_pts
_at_origin
6
5
NAME
111
20.0
International
Ahmed
_at_no
10.0
2
9
Functions lab of the Class Tree
  • V 1, 2, 4, 5, 6, 7, 8, 9
  • root 1
  • lab (1, CLASS), (2, LECTURER), (4,
    STUDENT), (5, NAME), (6, ASSIGNMENT),
  • (7, ASSIGNMENT), (8, STUDENT), (9, NAME)

10
Functions ele and att of the Class Tree
  • ele(1) (2, 3, 4, 8), ele(2) Pavle,
    ele(4) (5, 6, 7), ele(5) Ahmed, ele(6)
    10, ele(7) 10, ele(8) (9), ele(9) Bad
    Student
  • att ((1, _at_name), COMP442), ((2, _at_lecid),
    111), ((4, _at_no_of_pts), 20.0), ((4, _at_origin),
    International), ((6, _at_no), 1), ((7, _at_no), 2),
    ((8, _at_no_of_pts), 0.0), ((8, _at_origin),
    Domestic)

11
The Class Tree and Tuples t1, t2
  • Now, we check whether T1 ? T2 holds for
  • T1?treeD(t1), treeD(t2) and the Class tree as
    T2
  • treeD(t1) is subsumed by the Class tree
  • treeD(t2) is not subsumed by the Class tree,
    since
  • The condition V1 ? V2 is violated (the vertex 3
    is in V1 but not in V2)
  • The condition for all v?V1, ele1(v) is a sublist
    of a permutation of ele2(v) is violated
    (ele1(1) (2, 3, 4), but ele2(1) (2, 4,
    8), hence ele1(1) is not a sublist of ele2(1))
  • The condition att2V1?Att att1 is violated (the
    element
  • ((1, _at_no_of_std), 31) is in att1 but not in
    att2)

12
t3 Tuple as An XML Tree
CLASS
1
_at_name
COMP442
LECTURER
STUDENT
8
2
Pondy
_at_lecid
_at_no_of_pts
_at_origin
222
0.0
Domestic
13
The Class Tree and the Tuple t3
  • treeD(t3) is not subsumed by the Class tree,
    since
  • The condition for all v?V1, ele1(v) is a sublist
    of a permutation of ele2(v) is violated
  • Namely, both trees contain the vertex 2, but
    ele2(2) Pavle and ele1(2) Pondy, and Pondy
    is not a sublist of Pavle
  • The condition att2V1?Att att1 is also violated
  • Namely, (2, lecid) is defined in both T1 and T2,
    but (2, lecid) 222 in T2 and (2, lecid) 111
    in T1

14
Subsumption Example
  • Consider the XML tree given on the following
    slide and check whether the Class tree T2
    subsumes the next tree T1

15
XML Tree T1
CLASS
1
_at_name
COMP442
  • V1 1
  • root1 1
  • lab1 (1, CLASS)
  • att1 ((1, _at_name), COMP442)
  • ele(1) ? (empty list)

V1 ? V2 root1 root2 lab1 lab2 V1 att1 att2
V1xAtt ? (empty list) is a sublist of each list
16
A Question for You
  • How many tree tuples can be inferred from the
    Class XML tree T2
  • 3 tree tuples,
  • 33 tree tuples,
  • 125 tuples

17
Maximal Tree Tuples
  • Many tree tuples in a ?(D) associate a null value
    to a not null path in a tree T that is compatible
    with a DTD D (T ? D)
  • Also, many tree tuples with nulls are subsumed by
    such tree tuples from ?(D), which are also
    subsumed by T
  • We are interested only for those tree tuples
    that
  • Belong to ?(D),
  • Are subsumed by the tree T, and
  • Are not subsumed by any other tree tuple that is
    subsumed by T
  • Such tree tuples carry maximal information about
    the tree T (since they contain minimal number of
    null values)
  • The set of tree tuples that satisfy the three
    conditions above will be denoted by tuplesD(T )

18
Defining tuplesD(T)
  • Given a DTD D, an XML treeT, and a set of tuples
    tuplesD(T ), where T ? D
  • All tuples in tuplesD(T ) satisfy the following
    conditions
  • t??(D),
  • treeD(t ) ? T,
  • ?t1, t2 ?tuplesD(T )(treeD(t1 ) ? treeD(t2 ) ? t1
    t2 )

19
tuplesD(T) Example
  • Consider the Class DTD, the Class XML tree, and
    the following tuples
  • tx (1, COMP442, 31, ?, ?, ?, ?, ?, ?, ?, ?, ?,
    ?, ?, ?, ?),
  • ty (1, COMP442, 31, 2, 111, Pavle, ?, ?, 4,
    20.0, International, 5, Ahmed, 6, 1, 10.0),
  • tz (1, COMP442, 31, ?, ?, ?, ?, ?, 4, 20.0,
    International, 5, Ahmed, 6, 1, 10.0)
  • ty , tx, tz ? ?(D )
  • ty ?tuplesD (T )
  • tx?tuplesD (T ), since treeD(tx ) ? treeD(ty )
  • tz?tuplesD (T ), since treeD(tz ) ? treeD(ty )

20
Relationship Between T and tuplesD(T)
  • A tree made of a tree tuple t in tuplesD(T ) can
    be viewed as being extracted from T by taking a
    branch from the root to a leaf in the tree T for
    each path from the root to a leaf in paths(T )
    that ends with a S or an attribute
  • A tuple t in tuplesD(T ) is allowed to have null
    values only for paths in paths(D) \ paths(T )

21
A Question for You
  • How many maximal tree tuples can be inferred from
    the Class XML tree T2
  • 3 tree tuples,
  • 6 tree tuples,
  • 9 tree tuples,
  • other

22
Summary
  • A tree tuple t is a function that assigns a value
    in Vert ? Str ? ? to each path in D
  • A tree tuple t can be represented as an XML tree
    T
  • An XML tree T2 can subsume another XML tree T1
  • Tree tuples subsumed by the document tree only
    are called maximal tree
  • A document tree can be viewed as constructed
    using its maximal tuples from tuplesD(T ) (the
    set of maximal tree tuples)
Write a Comment
User Comments (0)
About PowerShow.com