Database Reference
In-Depth Information
•
o
i
is a unary operation _
WHERE
C
.
Then α(q
A,
1
)
:
R
1
→
R is a func-
tion such that for any tuple
d
∈
R
1
,
α(q
A,
1
)(
d
)
=
d
if the condition C
holds for the values in
d
;
otherwise
.
•
o
i
is a unary operation _
DISJOINT
S
2
FROM
S
1
,
where S
1
=
nr
r
1
(i),
...,nr
r
1
(i
+
k)
and S
2
=
nr
r
1
(j),... , nr
r
1
(j
+
k)
for i
≥
1,
k
≥
0,
+
+
≤
:
R
1
→
j>i
k and j
k
ar(r
1
)
.
Then
,
α(q
A,
1
)
R is a function such
that for any tuple
d
=
d
1
,...,d
ar(r
1
)
∈
R
1
,
α(q
A,
1
)(
d
)
=
π
i,
···+
k
(
d
) if
d
∈
R
1
such that (d
i
=
d
j
)
∧···∧
(d
i
+
k
=
d
j
+
k
)
;
otherwise
.
By this functorial transformation
,
each atomic arrow o
i
in
RA
is mapped into an
atomic morphism in
DB
(
specified by Definition
18
).
∃
Proof
We have to show that for each atomic arrow
o
i
:
t
RA
→
o
i
(t
RA
)
in
RA
,the
:
→
morphism
Eval(o
i
)
Eval(o
i
(t
RA
))
is an
atomic
morphism (Defini-
tion
18
), that is, there is an atomic sketch's schema mapping
M
AB
:
A
→
B
Eval(t
RA
)
(Defi-
nition
17
) such that
α
∗
(
M
AB
)
=
Eval(o
i
)
.
In fact, for each case of an atomic arrow
o
i
we are able to make a simple sketch
Sch
(G)
, where a graph
G
is composed of two vertices (schemas)
A
=
(
{
r
1
}
,
∅
)
and
B
=
(
{
r
}
,
∅
)
introduced in this proposition for this arrow
o
i
:
t
RA
→
o
i
(t
RA
)
in
RA
, with an atomic inter-schema mapping
M
AB
={
Φ
}:
A
→
B
, where (w.r.t.
definitions in the proposition above):
1. For the case when
o
i
is a unary operation _ REDUCE
S
2
TO
S
1
, with the tuple of
variables
x
=
x
1
&
(x
i
,...,x
i
+
k
)
&
x
2
&
(x
j
,...,x
j
+
k
)
&
x
3
, the SOtgd
Φ
is equal
to:
∀
x
r
1
(
x
)
r
x
1
,(x
i
,...,x
i
+
k
),
x
2
,
x
2
∧
⇒
∧
∀
x
r
1
(
x
)
r
x
1
,(x
j
,...,x
j
+
k
),
x
2
,
x
2
.
⇒
2. For the case
o
i
is a unary operation _ RENAME
name
2
AS
name
1
, the logical
formula
Φ
is equal to the SOtgd (here
r
is equal to
r
1
)
∀
x
(r
1
(
x
)
⇒
r
1
(
x
))
.
3. For the case
o
i
is a unary operation _
[
S
]
with a tuple of indexes
=
nr
r
1
(i
1
),...,nr
r
1
(i
k
)
,
S
r(x
i
1
,...,x
i
k
))
.
4. For the case
o
i
is a unary operation _ WHERE
C
, the logical formula
Φ
is equal
to the SOtgd
the logical formula
Φ
is equal to the SOtgd
∀
x
(r
1
(
x
)
⇒
x
((r
1
(
x
)
∧
C(
x
))
⇒
r(
x
))
.
5. For the case when
o
i
is a unary operation _ DISJOINT
S
2
FROM
S
1
with
x
∀
=
x
1
&
(x
i
,...,x
i
+
k
)
&
x
2
&
(x
j
,...,x
j
+
k
)
&
x
3
and
y
y
1
&
(y
i
,...,y
i
+
k
)
&
y
2
&
(y
j
,...,y
j
+
k
)
&
y
3
, the logical formula
Φ
is equal to the SOtgd
=
y
r
1
(
x
)
∧
(x
i
=
y
j
+
k
)
∀
x
∀
∧
r
1
(
y
)
y
j
)
∨···∨
(x
i
+
k
=
r
x
1
,(x
i
,...,x
i
+
k
),
x
2
,
x
2
.
⇒