Database Reference
In-Depth Information
3. (
Construct
SOtgd)
If
S
AB
={
is the set, where
χ
1
,...,χ
n
are all the implications from
the previous step, then SOtgd is the formula
χ
1
,...,χ
n
}
x
n
χ
n
, where the
variables in
x
i
are all the variables found in the implication
χ
i
,for1
∀
x
1
χ
1
∧···∧∀
≤
i
≤
n
.
Return
the SOtgd
∀
x
1
χ
1
∧···∧∀
x
n
χ
n
.
Example 4
Let us consider Example
2
with the relation
Student
(x
1
,x
2
)
in the
B
schema
and introduce the primary-key integrity constraint for the attribute
x
1
(i.e.,
the student's id) of this relation
Student
, expressed by the following egd:
x
3
Student
(x
1
,x
2
)
∧
Student
(x
1
,x
3
)
⇒
x
3
)
,
(x
2
.
∀
x
1
∀
x
2
∀
=
(
y
.
i.e., the egd
∀
x
(φ
A
(
x
)
⇒
=
z
))
with
x
=
(x
1
,x
2
,x
3
)
,
y
=
x
2
,
z
=
x
3
where
φ
A
(
x
)
is the conjunctive formula
Student
(x
1
,x
2
)
∧
Student
(x
1
,x
3
)
.
Then,
EgdsToSOtgd(
∀
x
3
Student
(x
1
,x
2
)
∧
Student
(x
1
,x
3
)
⇒
x
1
∀
x
2
∀
x
3
)
(x
2
.
=
x
3
Student
(x
1
,x
2
)
=
∀
x
1
∀
x
2
∀
(
x
3
)
⇒
(
0
,
1
)
.
∧
Student
(x
1
,x
3
)
∧
(x
2
=
r
2.3
New Algorithm for General Composition of SOtgds
First of all, we have to specify what is an
atomic
(or basic) schema mapping in
our framework, so that we can use them in the process of composition of other
(composed) mappings. We will use only these atomic mappings in order to define
a database mapping graphs
G
(V
G
,E
G
)
where the vertices (or nodes) in
V
G
are
the database schemas and the directed edges in
E
G
are the atomic mappings. The
mappings obtained by the composition of two consecutive directed edges of this
mapping graph are called
composed
mappings and hence, in what follows, we will
define a new algorithm for this composition.
=
Definition 7
An
atomic mapping
is:
1. An inter-schema mapping
where an SOtgd
Φ
is obtained
by the algorithm
TgdsToSOtgd
for a given set
S
of tgds from a source schema
M
AB
={
Φ
}:
A
→
B
A
B
;
2. An integrity-constraints mapping
to the target database schema
where
Φ
is ob-
tained by the algorithm
EgdsToSOtgd
for the set of egds
Σ
egd
A
M
AA
={
Φ
∧
Ψ
}:
A
→
A
and
Ψ
is ob-
tained by the algorithm
TgdToConSOtgd
for the set
Σ
tgd
A
of tgd-constraints of a
schema
A
.