Database Reference
In-Depth Information
Based on Example
12
, for each egd (PK) for a relation
r
in
G
, we obtain the
n
−
k
operators
{
q
1
,...,q
n
−
k
}⊆
k
,
q
i
=
(
_
)
1
(
y
)
∧
(
_
)
2
(
z
)
∧
(y
1
1
=
z
1
1
)
∧···∧
(y
1
k
=
z
1
k
)
∧
(y
j
1
=
T
GA
such that for any 1
≤
i
≤
n
−
z
l
n
−
k
)
⇒
z
l
1
)
∨···∨
(y
j
n
−
k
=
(
_
)(
0
,
1
).
For a given set of
k
foreign-key constraints, represented by tgds (FK)
f
i
∀
x
i
r
i,
1
(
x
i
)
r
i,
2
(
t
i
)
,i
∃
⇒
=
1
,...,k,
where
t
i
is a tuple of terms with variables in
x
i
and functional sy
mbol
s in
f
i
,we
obtain
q
i
∈
O(r
i,
1
,r
i,
2
,r
)
, with
q
i
=
∧¬
⇒
(
_
)(
0
,
1
)
.
Let us consider the foreign-key constraints (FK) in a global schema
((
_
)
1
(
x
i
)
(
_
)
2
(
t
i
))
G
given
by Example
27
(Sect.
4.2.4
). Suppose that we have two relations
r
and
s
in
G
,
both of arity 2 and having the first attribute as a key, and the following foreign key
constraints in
G
:
1.
π
2
(r)
⊆
π
1
(s)
,ofthetgd
∀
x
∀
y(r(x,y)
⇒
s(y,f
1
(x,y)))
, with
K
={
1
}
key in-
dexes of
s
, and
K
={
2
}
.
2.
π
1
(s)
⊆
π
1
(r)
,ofthetgd
∀
x
∀
z(s(x,z)
⇒
r(x,f
2
(x,z)))
, with
K
={
1
}
key in-
dexes of
r
, and
K
={
1
}
and
f
1
and
f
2
introduced by Skolemization of the exis-
tential quantifications.
That is,
G
=
(S
G
,Σ
G
)
with
S
G
={
r, s
}
,
ar(r)
=
ar(s)
=
2 and
Σ
tg
G
=
∀
y
r(x,y)
zs(y,z)
,
z
s(x,z)
yr(x,y)
.
x
∀
⇒∃
∀
x
∀
⇒∃
Thus, in this case we obtain the schema mapping
MakeOperads
{
}
:
G
→
A
,
T
GA
=
Φ
with SOtgd
Φ
equal to
f
1
,f
2
∀
x,y
r(x,y)
s
y,f
1
(x,y)
⇒
r
(
0
,
1
)
∃
∧¬
x,y
s(x,z)
r
x,f
2
(x,z)
⇒
r
(
0
,
1
)
.
∧∀
∧¬
α
∗
(
Consequently, we have to find an R-algebra
α
such that
can(
)
is
a
model
of this Data Integration system, that is, such
α
that satisfies the constraint
DB
-morphism
f
Σ
G
=
I
,D)
=
G
α
∗
(
T
GA
)
={
α(q
1
),α(q
2
),q
⊥
}
,for
(
_
)
2
y,f
1
(x,y)
⇒
q
1
=
v
1
·
q
G,
1
=
(
_
)
1
(x,y)
∧¬
(
_
)(
0
,
1
)
∈
O(r,s,r
),
with
q
G,
1
∈
O(r,s,r
q
1
)
,
v
1
∈
O(r
q
1
,r
)
, and for
(
_
)
2
x,f
2
(x,z)
⇒
q
2
=
v
2
·
q
G,
2
=
(
_
)
1
(x,z)
∧¬
(
_
)(
0
,
1
)
∈
O(s,r,r
),
with
q
G,
2
∈
O(s,r,r
q
2
)
,
v
2
∈
O(r
q
2
,r
)
.