Database Reference
In-Depth Information
dependencies relating the two schemas. In the XML context, relational schemas are nat-
urally replaced by regular schemas and dependencies use patterns instead of conjunctive
queries.
Definition 11.10 (XML schema mapping) An XML schema mapping is a triple M =
(
S s ,
S t ,
Σ st ),where
S s is the source schema,
S t is the target schema, and
Σ st is a set of
st-tgds of the form
π ( x , z )
π
( x , y )
→∃
z
π are (generalized) patterns and
where
π
and
π
satisfies the safety condition (see
page 146 ).
M
S s ,
S t ,
Definition 11.11 (Semantics of mappings) Let
=(
Σ st ) be an XML schema
S
mapping. Given a tree S that conforms to
s (a source instance )andatree T that conforms
to
S
t (a target instance ), we say that T is a solution for S under
M
if ( S , T ) satisfy all the
π ( x , z ) in
st-tgds from
Σ
st , i.e., for every st-tgd
π
( x , y )
→∃
z
Σ
st ,
( a , b )=
π ( a , c ) for some tuple of data values c .
S |
=
π
T |
=
We denote the set of all solutions under
M
for S by S OL M ( S ).
The semantics of
M
is defined as a binary relation
= ( S , T ) S
S OL M ( S ) .
M
|
=
S s , T
|
=
S t , T
Just like for relational databases (see Section 2.3 ), the domain of data values V allowed
in the attributes of XML trees is partitioned into two disjoint and infinite sets:
the set C ONST of constants ,and
the set V AR of nulls , or variables.
We use the symbol
(with subscripts or superscripts) to denote nulls, and lowercase letters
or specific values to denote constants. Most of the time we shall assume that source trees
take data values from C ONST only. In target trees we use V AR for attribute values that are
not specified by the dependencies.
Example 11.12 Let
S s be the familiar DTD
country
country :@ name
europe
ruler
ruler :@ name
country
and let
S t be
ruler
ruler :@ name
rulers
successor :@ name
ruler
successor
Assuming the rulers are stored in chronological order on the source side, a natural schema
mapping
M
might be defined with the following st-tgd:
europe [ ruler ( x )
ruler ( y )]
−→ rulers / ruler ( x ) / successor ( y ) .
Search WWH ::




Custom Search