Database Reference
In-Depth Information
M
, Q )
Algorithm 15.6 I NL C ERT A NSW (
Require: S is a source document.
Ensure: The returned set of tuples is certain M ( Q , S ).
S r := I NL D OC ( S , D s )
M r := I NL M AP (
)
Q r := I NL Q UERY ( Q , D t )
Compute the canonical universal solution T r for S r under
M
M r .
Compute Q r ( T r );
Discard tuples with nulls from Q r ( T r );
return Q r ( T r );
mapping
M
query Q
certain M ( Q , S )
source S
univ. sol. T
I NL D OC ( S , D s )
I NL D OC ( T , D t )
M r = I NL M AP ( M )
Q r = I NL Q UERY ( Q , D t )
certain M r ( Q r , T r )
S r
T r
Figure 15.4 XML data exchange via relations: solution
in SM nr (
Example 15.13 We now specify a complete XML schema mapping
, =).
As the source DTD D s ,wetaketheDTD D used in all other examples in the chapter, and
as the source source tree S we take the tree in Figure 15.2 .ThetargetDTD D t has two
productions
M
r writer
writer :@ name
writer work
work :@ title , @ year .
Suppose we have a single dependency in
Σ st :
r / book ( x ) / author / name ( y ) →∃ z r / writer ( y ) / work ( x , z ) ,
restructuring book-author pairs into writer-works pairs, with a null z introduced for
the unknown attribute @year . We denote r / book ( x ) / author / name ( y ) by
( x , y ) and
π
r / writer ( y ) / work ( x , z ) by
π ( x , y , z ).
The inlining schema I NL S CHEMA ( D t ) is given by
R r ( rID )
R writer ( writerID,rID,@name )
R work ( workID,writerID,@title,@year )
with keys underlined, as well as two foreign keys: R writer ( rID )
FK R r ( rID ) and
R work ( writerID )
FK R writer ( writerID ).
 
Search WWH ::




Custom Search