Database Reference
In-Depth Information
Furthermore, assume that the relationship between R
2
and the new target schema R
3
is
given by a mapping
M
23
specified by the following st-tgds:
SERVES
(
airl
,
city
,
country
,
phone
)
−→
∃
yearINFO AIRLINE
(
airl
,
city
,
country
,
phone
,
year
)
ROUTES
(
f
#
,
src
,
dest
)
−→
INFO JOURNEY
(
f
#
,
src
,
dep
,
dest
,
arr
,
airl
)
.
∧
INFO FLIGHT
(
f
#
,
dep
,
arr
,
airl
)
Given that R
2
has to be replaced by the new target schema R
3
, the mapping
M
12
from
schema R
1
into schema R
2
also has to be replaced by a new mapping
M
13
, which specifies
how to translate data from R
1
into the new target schema R
3
. Thus, the problem in this
scenario is to compute a new mapping
M
13
that represents the application of mapping
M
12
followed by the application of mapping
M
23
. But given that mappings are binary
relations from a semantic point of view, this problem corresponds to the computation of
the composition of mappings
M
23
. In fact, the composition operator for schema
mappings exactly computes this, and in this particular example returns a mapping
M
12
and
M
13
specified by the following st-tgds:
FLIGHT
(
src
,
dest
,
airl
,
dep
)
−→
∃
f
#
∃
arrINFO JOURNEY
(
f
#
,
src
,
dep
,
dest
,
arr
,
airl
)
FLIGHT
(
city
,
dest
,
airl
,
dep
)
−→
∃
phone
∃
yearINFO AIRLINE
(
airl
,
city
,
country
,
phone
,
year
)
FLIGHT
(
src
,
city
,
airl
,
dep
)
∧
GEO
(
city
,
country
,
popul
)
−→
∃
phone
∃
yearINFO AIRLINE
(
airl
,
city
,
country
,
phone
,
year
)
.
∧
GEO
(
city
,
country
,
popul
)
As we can see from this example, the composition operator is essential to handle schema
evolution. If a schema evolves first from R
1
to R
2
, as specified by a mapping
M
12
,and
then the target schema R
2
further evolves to R
3
, as specified by a mapping
23
, we do not
want to create an intermediate instance of schema R
2
to translate data structured under R
1
into R
3
: instead we want a composition mapping
M
M
13
that translates directly from R
1
to
R
3
.
Another operator that appears in this context is the
inverse
operator. Assume that we
have two schemas, R
1
and R
2
, and a mapping
M
12
between them. But now suppose it is
the source schema R
1
that evolves to R
0
, and this is specified by a mapping
M
10
.How
can we now go directly from R
0
to R
2
? The idea is to
undo
the transformation done by
M
10
and then apply the mapping
M
12
. In other words, we invert the mapping
M
10
,toget
M
−
1
10
M
−
1
a mapping
M
12
.
This explains why the operators of composition and inverse are crucial for the develop-
ment of a metadata management framework. We study the composition operator in
Chapter
19
, and the inverse operator in
Chapter 20
.
going from R
0
to R
1
, and then compose
10
with