Databases Reference
In-Depth Information
Select-Project-Join
The resulting union of
queries could then be forwarded
for execution to an RDBMS.
One can achieve the same result by using the tree-witness rewriting
q tw of
q
over H-complete ABoxes introduced in Section 3. An obvious way to
construct H-complete ABoxes is to take the composition of
and
T
M
and the inclusions
M T given by
in
T
, that is, a mapping
if A ( x )
= A
A ( x )
ϕ ( x,
z
) ,
ϕ ( x,
z
)
∈M
and
T|
A,
A ( x )
ϕ ( x, y,
z
) ,
if R ( x, y )
ϕ ( x, y,
z
)
∈M
and
T|
=
R
A,
P ( x, y )
ϕ ( x, y,
z
) ,
if R ( x, y )
ϕ ( x, y,
z
)
∈M
and
T|
= R
P.
(Recall that we do not distinguish between P ( y,x )and P ( x, y ).) Thus, for any
I
and any tuple
a
of individuals in
A I ,M ,wehave:
(
T
,
A I ,M )
|
=
q
(
a
)iff
A I ,M T |
=
q tw (
a
) .
(23)
So, to compute the answers to
q
over
T
linked by
M
to
I
, one can unfold the
tree-witness rewriting
q tw over H-complete ABoxes with the help of the compo-
M T . However, the resulting query will produce duplicating answers if the
ontology axioms express the same properties of the application domain as the in-
tegrity constraints of the database [58]. For example, the IMDb schema contains
a foreign key: movie ID in castinfo references movie ID in title , and therefore the
unfolded rewriting above will return the same movie many times—once from
title and once for each of the cast members of the movie in castinfo . Such a
duplication is clearly an undesirable feature of this straightforward approach.
For this reason, before applying
sition
M T to unfold the tree-witness rewriting,
Ontop
optimises the mapping using the database integrity constraints Σ .This
allows us to ( a ) reduce redundancy in answers, and ( b ) substantially shorten
the SQL queries, which makes the OBDA system more ecient. The process of
query rewriting and unfolding in
with all optimisations is shown in the
picture below (the dashed lines illustrate processes that do not take place):
Ontop
tw-rewriting ➊
unfolding
+
+
CQ q
UCQ q tw
SQL
completion ➋
SQO
ontology T
+
dependencies Σ
mapping M
T -mapping
ABox completion
+
+
ABox virtualisation
ABox A
+
ABox virtualisation
H-complete ABox A
data D
Search WWH ::




Custom Search