Database Reference
In-Depth Information
Definition 12
AOT for a database query-answering system, for a given instance-
database
A
, is a pair
(S,Σ
AOT
)
such that:
1. The carrier set
S
L
A
,
Υ
)
of the sorts where
X
A
is a hidden sort (a set
of states of this database system),
=
(X
A
,
L
A
is an input sort (a set of the unions of
conjunctive queries over
A
), and
Υ
is the set of all finitary relations for a given
universe
.
2. The signature
Σ
AOT
={
U
Next, Out
}
is a set of operations:
2.1. A
method
Next
:
X
A
×
L
A
→
X
A
that corresponds to an execution of a
next query
q(
x
)
∈
L
A
in a current state
s
∈
X
A
of a database
A
such that a
database
A
passes to the next state; and
2.2. An
attribute
Out
:
X
A
×
L
A
→
Υ
such that for each
s
∈
X
A
,
q(
x
)
∈
L
A
,
Out(s,q(
x
))
is a relation computed by a query
q(
x
)
.
The Data Object Type for a query-answering system is given by a coalgebra:
X
L
A
×
Υ
L
A
of the polynomial endofunctor
(
_
)
L
A
:
X
A
→
×
3.
λNext,λOut
Υ
L
A
:
Set
→
Set
, where
λ
is the currying operator for functions.
In an object-oriented terminology, the coalgebras are expressive enough in order
to specify the parametric methods and the attributes for a database (conjunctive)
query answering systems. In a transition system terminology, such coalgebras can
model a deterministic, non-terminating, transition system with inputs and outputs.
In [
4
], a complete equational calculus for such coalgebras of restricted class of poly-
nomial functors has been defined.
Here we will consider only the database query-answering systems without the
side effects. That is, the obtained results (views)
will not be materialized
as a new
relation of this database
A
but only visualized. Thus, when a database answers to a
query, it remains in the same initial state. Thus, the set
X
A
is a singleton
for a
given database
A
and, consequently, it is isomorphic to the terminal object 1 in the
Set
category. As a consequence, from 1
L
A
{
A
}
1, we obtain that a method
Next
is just
an identity function
id
:
1
→
1. Thus, the only interesting part of this AOT is the
attribute part
Out
:
X
A
×
L
A
→
Υ
, with the fact that
X
A
×
L
A
={
A
}×
L
A
L
A
.
Consequently, we obtain an attribute mapping
Out
:
L
A
→
Υ
, whose graph is
TA
, introduced in
equal to the query-evaluation surjective mapping
ev
A
:
L
A
Sect.
1.4.1
.
This mapping
ev
A
:
L
A
TA
will be used as a semantic foundation for the
database mappings.
Corollary 5
A canonical method for the construction of the power-view database
TA can be obtained by an Abstract Data-Object Type (S,Σ
AOT
) for a query-
answering system without side-effects as follows
:
TA
Out
q
i
(
x
)
|
q
i
(
x
)
∈
L
A
.
Proof
In fact, from the reduction of
Out
to
ev
A
(for an AOT without side-effects),
for a given database instance
A
,
{
Out(q
i
(
x
))
|
q
i
(
x
)
∈
L
A
}={
ev
A
(q
i
(
x
))
|
q
i
(
x
)
∈
L
A
}=
TA
, from the fact that (in Sect.
1.4.1
)
ev
A
is a surjective function.