Database Reference
In-Depth Information
of the morphisms of the
DB
category and hence each morphism in
DB
would be a
set
of terms of this
database-mapping algebra
. However, such a database-mapping al-
gebra would also have other operations which are introduced by existentially quan-
tified functional symbols in the SOtgds and are used in the right-hand sides of the
tgds implication as the terms with variables (i.e., the attributes of the relations in the
left-hand side of the tgds material implication).
Proposition 27
For any given schema mapping
M
AB
:
A
→
B
,
each of its operads
q
i
∈
M
AB
) can be equivalently represented by
atermt
R
of the relational Σ
RE
algebra in Definition
31
such that if the extension
of r
B
before this mapping was R
B
=
O(r
1
,...,r
k
,r
B
) in MakeOperads(
α
∗
(
α(r
B
)
∈
B
=
B
) then
,
after the execution
of this mapping
,
its extension is R
B
=
α
1
(r
B
)
=
R
B
∪
t
R
#
(
for the assignment
_
:R→
Υ
in Definition
31
such that for each r
∈
A
,
r
=
α(r)
).
Proof
Let
φ
Ai
(
x
)
f
(Ψ )
(where
Ψ
is an FOL formula, i.e., a conjunction of a number of such implica-
tions) of a mapping
⇒
r
B
(
t
)
be an implication
χ
in the normalized SOtgd
∃
M
AB
:
A
→
B
, and
t
be a tuple of terms with variables
in
x
=
x
1
,...,x
m
and functional symbols in
f
(at least one, as in Example
16
,
Sect.
2.5
). Let
q
i
∈
M
AB
)
be an operad's operation obtained by al-
gorithm
MakeOperads
from this implication and equal to the expression
((e
MakeOperads(
∧
⇒
C)
∈
(
_
)(
t
))
O(r
1
,...,r
k
,r
B
)
where
C
is a condition (as in Example
16
), where
q
i
=
v
i
·
q
A,i
with
q
A,i
∈
O(r
1
,...,r
k
,r
q
)
and
v
i
∈
O(r
q
,r
B
)
are such that for a
new relational symbol
r
q
,
n
=
ar(r
q
)
=
ar(r
B
)
, so that the tuple of terms on the
right-hand side of implication is
t
=
(t
1
,...,t
n
)
and its sublist of terms with func-
tional symbols
t
1
=
(t
i
1
,...t
i
m
)
⊆
t
,
m
≤
n
.
From Definition
11
in Sect.
2.4.1
, for an R-algebra
α
we obtain a mapping-
interpretation
α(v
i
)
α(r
B
)
which is an
injective
function (when a schema-
mapping is satisfied), with the
k
-ary operation (a
k
-ary function):
:
α(r
q
)
→
α(q
A,i
)
:
R
1
×···×
R
k
→
α(r
q
),
ar(r
i
)
where for each 1
≤
i
≤
k
,
R
i
=
U
\
α(r
i
)
(i.e., the complement of the relation
α(r
i
)
) if the place symbol
(
_
)
i
∈
e
is preceded by negation operator
¬
;
α(r
i
)
oth-
erwise. Thus, the mapping
α(q
i
)
=
α(v
i
)
·
α(q
A,i
)
:
R
1
×···×
R
k
→
R
B
, where
R
B
=
α(r
B
)
, is equivalent to the following
Σ
RE
-algebra term
t
R
:
]
EXTEND
...
EXTEND
t
R
WHERE
C
C
ADD
a
N
+
1
, name
N
+
1
,t
i
1
...
ADD
a
N
+
m
, name
N
+
m
,t
i
m
,
[
S
∧
where
1.
N
=
ar(r
k
)
;
2. The Cartesian product of the relations
t
R
=
t
1
⊗···⊗
t
k
, where for each 1
ar(r
1
)
+···+
≤
i
≤
k
,
ar(r
i
)
t
i
=
((
r
∞
⊗···⊗
r
)
MINUS
r
i
)
, if the place symbol
(
_
)
i
∈
e
is preceded by
∞
negation operator
¬
;
r
i
otherwise;