Database Reference
In-Depth Information
Another difference is methodological. In fact, the logics for relational databases
are based on different kinds of First-Order Logic (FOL) sublanguages as, for exam-
ple, Description Logic, Relational Database logic, DATALOG, etc. Consequently,
the previous work on categorical semantics for the database theory strictly follows
an earlier well-developed research for categorial FOL on the predicates with types
(many-sorted FOL) where each attribute of a given predicate has a particular sort
with a given set of values (domain). Thus, the fibred semantics for predicates is as-
sumed for such a typed logic, where other basic operations as negation, conjunction
and FOL quantifiers (that are algebraically connected with the Galois connection
of their types, traduced by left and right adjunction of their functors in categorical
translation) are defined algebraically in such a fibrational formulation. This alge-
braic method, applied in order to translate the FOL in a categorical language, is suc-
cessively and directly applied to the database theory seen as a sublanguage of the
FOL. Consequently, there are no particularly important new results, from the previ-
ous developed for the FOL, in this simple translation of DB-theory into a categori-
cal framework. No new particular base category is defined for databases (different
from Set ), as it happened in the cases, for example, of the Cartesian Closed Cate-
gories (CCC) for typed λ -calculus, Bicartesian Closed Poset Categories for Heyting
algebras, or the elementary topos (with the subobject classifier diagrams) for the
intuitionistic logic [ 26 , 71 ]. Basically, all previously works use the Set category as
the base denotational semantics category, without considering the question if such a
topos is also a necessary requirement for the database-mapping theory.
This manuscript, which is a result of more than ten years of my personal but not
always continuative research, begins with my initial collaboration with Maurizio
Lenzerini [ 3 , 39 , 40 ] and from the start its methodological approach was coalge-
braic , that is, based on an observational point of view for the databases. Such a
coalgebraic approach was previously adopted in 2003 for logic programming [ 48 ]
and for the databases with preorders [ 47 ] and here it is briefly exposed.
In our case, we are working with Relational Databases (RDB), and consequently
with Structured Query Language (SQL), which is an extension of Codd's “Select-
Project-Join+Union” (SPJRU) relational algebra [ 1 , 13 ]. We assume aview of a
database A as an observation on this database, presented as a relation (a set of tuples)
obtained by a query q( x ) (SPJRU term with a list of free variables in x ), where x
is a list of attributes of this view. Let
L A be the set of all such queries over A and
L A /
be the quotient term algebra obtained by introducing the equivalence relation
such that q( x ) q ( x ) if both queries return with the same relation (view). Thus,
a view can be equivalently considered as a term of this quotient-term algebra
L A /
with a carrier set of relations in A and a finite arity of their SPRJU operators whose
computation returns a set of tuples of this view. If this query is a finite term of this
algebra then it is called a “finitary view” (a finitary view can have an infinite number
of tuples as well).
In this coalgebraic methodological approach to databases, we consider a database
instance A of a given database schema
(i.e., the set of relations that satisfy all in-
tegrity constraints of a given database schema) as a black box and any view (the
response to a given query) is considered as an observation . Thus, in this framework
A
Search WWH ::




Custom Search