Diego Calvanese, Maurizio Lenzerini, Daniele Nardi
Dipartimento di Informatica e Sistemistica
Università di Roma ``La Sapienza''
Via Salaria 113, I-00198 Roma, Italy
{calvanese, lenzerini,
nardi}@dis.uniroma1.it
In many fields of computer science we find formalisms for the representation of objects and classes [65]. Generally speaking, an object denotes an element of the domain of interest, and a class denotes a set of objects with common characteristics. We use the term ``class-based representation formalism'' to refer to a formalism that allows one to express several kinds of relationships and constraints (e.g., subclass constraints) holding among the classes that are meaningful in a set of applications. Moreover, class-based formalisms aim at taking advantage of the class structure in order to provide various information, such as whether a class is consistent, i.e., it admits at least one object, whether a class is a subclass of another class, and more generally, whether a given constraint holds between a given set of classes. From the above characterization, it should be clear that the formalisms referred to in this paper deal only with the structural aspects of objects and classes, and do not include any features for the specification of behavioral properties of objects.
Three main families of class-based formalisms are identified in this paper. The first one comes from knowledge representation and in particular from the work on semantic networks and frames (see for example [61,71]). The second one originates in the field of databases and in particular from the work on semantic data models (see for example [52]). The third one arises from the work on types in programming languages and object-oriented systems (see for example [58]).
In the past there have been several attempts to establish relationships among the various families of class-based formalisms (see Section 6 for a brief survey). The proposed solutions are not fully general and a formalism capturing both the modeling constructs and the reasoning techniques for all the above families is still missing. In this paper we address this problem by proposing a class-based representation formalism, based on description logics [17,70,43], and by using it for comparing other formalisms.
In description logics, structured knowledge is described by means of so called
concepts and roles, which denote unary and binary predicates,
respectively. Starting from a set of atomic symbols one can build complex
concept and role expressions by applying suitable constructors which
characterize a description logic. Formally, concepts are interpreted as
subsets of a domain and roles as binary relations over that domain, and all
constructs are equipped with a precise set-theoretic semantics. The most
common constructs include boolean operations on concepts, and quantification
over roles. For example, the concept
,
denotes
the set of individuals that are instances of the concept
Person and are
connected through the role
child only to instances of the concept Male,
while the concept
denotes all individuals that are connected
through the role
child to some individual. Further constructs that have been
considered important include more general forms of quantification, number
restrictions, which allow one to state limits on the number of connections that
an individual may have via a certain role, and constructs on roles, such as
intersection, concatenation and inverse.
A description logic knowledge base, expressing the intensional knowledge about
the modeled domain, is built by stating inclusion assertions between concepts,
which have to be satisfied by the models of the knowledge base. The assertions
are used to specify necessary and/or necessary and sufficient conditions for
individuals to be instances of certain concepts.
Reasoning on such knowledge bases includes the detection of inconsistencies in
the knowledge base itself, determining whether a concept can be populated in a
model of the knowledge base, and checking subsumption, i.e., whether all
instances of a concept are necessarily also instances of another concept in all
models of the knowledge base.
In this paper we propose a description logic called ALUNI, which is quite expressive and includes a novel combination of constructs, including number restrictions, inverse roles, and inclusion assertions with no restrictions on cycles. Such features make ALUNI powerful enough to provide a unified framework for frame systems, object-oriented languages, and semantic data models. We show this by establishing a precise correspondence with a frame-based language in the style of the one proposed by [46], with the Entity-Relationship model [35], and with an object-oriented language in the style of the one introduced by [2]. More specifically, we identify the most relevant features to model classes in each of the cited settings and show that a specification in any of those class-based formalisms can be equivalently expressed as a knowledge base in ALUNI. In this way, we are able to identify which are the commonalities among the families and which are the specificities of each family. Therefore, even though there are specific features of every family that are not addressed by ALUNI, we are able to show that the formalism proposed in this paper provides important features that are currently missing in each family, although their relevance has often been stressed. In this sense, our unifying framework points out possible developments for the languages belonging to all the three families.
One fundamental reason for regarding ALUNI as a unifying framework for class-based representation formalisms is that reasoning in ALUNI is hard, but nonetheless decidable, as shown by [29,25]. Consequently, the language features arising from different frameworks to build class-based representations are not just given a common semantic account, but are combined in a more expressive setting where one retains the capability of solving reasoning tasks. The combination of constructs included in the language makes it necessary to distinguish between reasoning with respect to finite models, i.e., models with a finite domain, and reasoning with respect to unrestricted models. [25] devises suitable techniques for both unrestricted and finite model reasoning, that enable for reasoning in the different contexts arising from assuming a finite domain, as it is often the case in the field of databases, or assuming that a domain can also be infinite. In the paper, we discuss the results on reasoning in ALUNI, and compare them with other results on reasoning in class-based representation formalisms.
Summarizing, our framework provides an adequate expressive power to account for the most significant features of the major families of class-based formalisms. Moreover, it is equipped with suitable techniques for reasoning in both finite and unrestricted models. Therefore, we believe that ALUNI captures the essential core of the class-based representation formalisms belonging to all three families mentioned above.
The paper is organized as follows. In the next section we present our formalism and in Sections 3, 4, and 5 we discuss three families of class-based formalisms, namely, frame languages, semantic data models, and object-oriented data models, showing that their basic features are captured by knowledge bases in ALUNI. The final sections contain a review of related work, including a discussion of reasoning in ALUNI and class-based formalism, and some concluding remarks.
In this section, we present ALUNI, a class-based formalism in the style of description logics (DLs) [17,70,43,41]. In DLs the domain of interest is modeled by means of concepts and roles, which denote classes and binary relations, respectively. Generally speaking, a DL is formed by three basic components:
|
In the description language of ALUNI, called
,
concepts and
roles are formed according to the syntax shown in Table 1,
where A denotes an atomic concept, P an atomic role, C an arbitrary
concept expression, R an arbitrary role expression, and n a nonnegative
integer.
To increase readability of concept expressions, we also introduce the following
abbreviations:
Concepts are interpreted as subsets of a domain and roles as binary relations
over that domain. Intuitively,
represents the negation of an
atomic concept, and is interpreted as the complement with respect to the domain
of interpretation.
represents the conjunction of two
concepts and is interpreted as set intersection, while
represents
disjunction and is interpreted as set union. Consequently,
represents the whole domain, and
the empty set.
is called
universal quantification over roles and is used to denote those elements
of the interpretation domain that are connected through role R only to
instances of the concept C.
and
are called
number restrictions, and impose on their instances restrictions on the
minimum and maximum number of objects they are connected to through role R.
P-, called the inverse of role P, represents the inverse of the
binary relation denoted by P.
More formally, an interpretation
consists of an
interpretation domain
and an interpretation
function
that maps every concept C to a subset
of
and every role R to a subset
of
according to
the semantic rules specified in Table 1. The sets
and
are called the extensions of C and R respectively.
An ALUNI knowledge base, which expresses the knowledge about classes and
relations of the modeled domain, is formally defined as a triple
,
where
is a finite set of atomic concepts,
is a
finite set of atomic roles, and
is a finite set of so called
inclusion assertions. Each such assertion has the form
In ALUNI no restrictions are imposed on the form that the inclusion assertions may assume. In particular we do not rule out cyclic assertions, i.e., assertions in which the concept expression on the right hand side refers, either directly or indirectly via other assertions, to the atomic concept on the left hand side. In the presence of cyclic assertions different semantics may be adopted [66]. The one defined above, called descriptive semantics, accepts all interpretations that satisfy the assertions in the knowledge base, and hence interprets assertions as constraints on the domain to be modeled. For inclusion assertions, descriptive semantics has been claimed to provide the most intuitive results [21]. Alternative semantics which have been proposed are based on fixpoint constructions [66,69,39], and hence allow to define in a unique way the interpretation of concepts.
In general, cycles in the knowledge base increase the complexity of reasoning [66,8,24] and require a special treatment by reasoning procedures [7,22]. For this reason, many DL based systems assume the knowledge base to be acyclic [19,20]. However, this assumption is unrealistic in practice, and cycles are definitely necessary for a correct modeling in many application domains. Indeed, the use of cycles is allowed in all data models used in databases, and, as shown in the following sections, in order to capture their semantics in ALUNI the possibility of using cyclic assertions is fundamental.
Besides inclusion assertions, some DL based systems also make use of equivalence assertions [22], which express both necessary and sufficient conditions for an object to be an instance of a concept. Although this possibility is ruled out in ALUNI, this does not limit its ability of capturing both frame based systems and database models, where the constraints that can be expressed correspond naturally to inclusion assertions.
The basic tasks we consider when reasoning over an ALUNI knowledge base are concept consistency and concept subsumption:
The inclusion of number restrictions and inverse roles in
and the
ability in ALUNI of using arbitrary, possibly cyclic inclusion assertions
allows one to construct a knowledge base in which a certain concept is consistent but has
necessarily an empty extension in all finite models of the knowledge base. Similarly, a
subsumption relation between two concepts may hold only if infinite models of
the knowledge base are ruled out and only finite models are considered.
The example above shows that ALUNI does not have the finite model
property, which states that if a concept is consistent in a knowledge base
then the knowledge base admits a finite model in which the concept has a
nonempty extension. Therefore, it is important to distinguish between
reasoning with respect to unrestricted models and reasoning with respect to
finite models. We call (unrestricted) concept consistency (written as
)
and (unrestricted) concept subsumption (written
as
)
the reasoning tasks as described above, i.e., carried
out without restricting the attention to finite models. The corresponding
reasoning tasks carried out by considering finite models only, are called
finite concept consistency (written as
)
and
finite concept subsumption (written as
).
A distinguishing feature of ALUNI is that reasoning both in the finite and in the unrestricted case is decidable. In particular, unrestricted concept satisfiability and concept subsumption are decidable in deterministic exponential time [38,29], and since reasoning in strict sublanguages of ALUNI is already EXPTIME-hard [25], the known algorithms are computationally optimal. Finite concept consistency in ALUNI is also decidable in deterministic exponential time while finite concept subsumption (in the general case) is decidable in deterministic double exponential time [25]. A more precise discussion on the methods for reasoning in ALUNI is provided in Section 6.2, while a detailed account of the adopted algorithms and an analysis of their computational complexity is presented by [25].
In the next sections we show how the two forms of reasoning with respect to unrestricted and finite models, capture the reasoning tasks that are typically considered in different formalisms for the structured representation of knowledge.
Frame languages are based on the idea of expressing knowledge by means of frames, which are structures representing classes of objects in terms of the properties that their instances must satisfy. Such properties are defined by the frame slots, that constitute the items of a frame definition. Since the 70s a large number of frame systems have been developed, with different goals and different features. DLs bear a close relationship with the KL-ONE family of frame systems [76]. However, here we would like to consider frame systems from a more general perspective, as discussed for example by [53,54], and establish the correspondence with ALUNI knowledge bases in this context.
We remark that we are restricting our attention to those aspects that are related to the taxonomic structure. Moreover, as discussed below, we consider assertional knowledge bases, where intensional knowledge is characterized in terms of inclusion assertions rather than definitions. In addition, we do not consider those features that cannot be captured in a first-order framework, such as default values in the slots, attached procedures, and the specification of overriding inheritance policies. Some of the issues concerning the modeling of these aspects in DLs are addressed by [42,44], within a modal nonmonotonic extension of DLs.
To make the correspondence precise, we need to fix syntax and semantics for the frame systems we consider. Unfortunately, there is no accepted standard and we have chosen to use here basically the notation adopted by [46], which is used also in the KEE 2 system.
For readers that are familiar with the KEE system, we point out that we omit the specification of the sub-classes for a frame present in KEE, since it can be directly derived from the specification of the super-classes.
To give semantics to a set of frame definitions we resort to their interpretation in terms of first-order predicate calculus [49]. According to such interpretation, frame names are treated as unary predicates, while slots are considered binary predicates.
A frame expression E is interpreted as a predicate logic formula E(x),
which has one free variable, and consists of the conjunction of sentences,
obtained from the super-class specification and from each slot specification.
In particular, for the super-classes
we have:
Here we regard frame definitions as necessary conditions, which is commonplace in the frame systems known as assertional frame systems, as opposed to definitional systems, where frame definitions are interpreted as necessary and sufficient conditions.
In order to enable the comparison with our formalisms for representing structured knowledge we restrict our attention to the reasoning tasks that involve the frame knowledge base, independently of the assertional knowledge, i.e., the frames instances. [46] mention several reasoning services associated with frames, such as:
These reasoning services are formalized in the first-order semantics as follows.
The first-order semantics given above allows us to establish a straightforward relationship between frame languages and ALUNI. Indeed, we now present a translation from frame knowledge bases to ALUNI knowledge bases.
We first define the function
that maps each frame expression into
an
concept expression as follows:
The correctness of the translation follows from the correspondence between the set-theoretic semantics of ALUNI and the first-order interpretation of frames (see for example [49,15,43]). We can observe that inverse roles are in fact not necessary for the formalization of frames. Indeed, the possibility of referring to the inverse of a slot has been rarely considered in frame knowledge representation systems (Some exceptions are reported in [53]). Due to the absence of inverse roles the distinction between reasoning in finite and unrestricted models is not necessary 3. Consequently, all the above mentioned forms of reasoning are captured by unrestricted concept consistency and concept subsumption in ALUNI knowledge bases. This is summarized in the following theorem.
Proof. The claim directly follows from the semantics of frame knowledge bases and the
translation into DLs that we have adopted.
By Theorem 3.6 it becomes possible to exploit the methods for unrestricted reasoning on ALUNI knowledge bases in order to reason on frame knowledge bases. Since the problem of reasoning, e.g., in KEE is already EXPTIME-complete, we do not pay in terms of computational complexity for the expressiveness added by the constructs of ALUNI. In fact, by resorting to the correspondence with ALUNI it becomes possible to add to frame systems useful features, such as the possibility of specifying the inverse of a slot [53], and still retain the ability to reason in EXPTIME.
Semantic data models were introduced primarily as formalisms for database schema design. They provide a means to model databases in a much richer way than traditional data models supported by Database Management Systems, and are becoming more and more important because they are adopted in most of the recent database design methodologies and Computer Aided Software Engineering tools.
The most widespread semantic data model is the Entity-Relationship (ER) model introduced by [35]. It has by now become a standard, extensively used in the design phase of commercial applications. In the commonly accepted ER notation, classes are called entities and are represented as boxes, whereas relationships between entities are represented as diamonds. Arrows between entities, called ISA relationships, represent inclusion assertions. The links between entities and relationships represent the ER-roles, to which number restrictions are associated. Dashed links are used whenever such restrictions are refined for more specific entities. Finally, elementary properties of entities are modeled by attributes, whose values belong to one of several predefined domains, such as Integer, String, or Boolean.
The ER model does not provide constructs for expressing explicit disjointness or disjunction of entities, but extensions of the model allow for the use of generalization hierarchies which represent a combination of these two constructs. In order to keep the presentation simple, we do not consider generalization hierarchies in the formalization we provide, although their addition would be straightforward. Similarly, we omit attributes of relations.
We now show that all relevant aspects of the ER model can be captured in ALUNI, and thus that reasoning on an ER schema can be reduced to reasoning on the corresponding ALUNI knowledge base. Since ALUNI is equipped with capabilities to reason on knowledge bases, both with respect to finite and unrestricted models (see Section 6.2), the reduction shows that reasoning on the ER model, and more generally on semantic data models, is decidable.
As in the case of frame-based systems, we restrict our attention to those aspects that constitute the core of the ER model. For this reason we do not consider some features, such as keys and weak entities, that have been introduced in the literature [35], but appear only in some of the formalizations of the ER model and the methodologies for conceptual modeling based on the model. A proposal for the treatment of keys in description logics is presented by [16].
In order to establish the correspondence between the ER model and ALUNI, we present formal syntax and semantics of ER schemata.
Although the ER model has by now become an industrial standard, several variants and extensions have been introduced, which differ in minor aspects in expressiveness and in notation [35,72,9,73,74]. Also, ER schemata are usually defined using a graphical notation which is particularly useful for an easy visualization of the data dependencies, but which is not well suited for our purposes. Therefore we have chosen a formalization of the ER model which abstracts with respect to the most important characteristics and allows us to develop the correspondence to ALUNI.
In the following, for two finite sets X and Y we call a function from a
subset of X to Y an X-labeled tuple over Y. The labeled tuple
T that maps
to
,
for
,
is denoted
.
We also write T[xi] to denote yi.
Before specifying the formal semantics of ER schemata we give an intuitive
description of the components of a schema.
The relation
models the ISA-relationship between entities. We do not
need to make any special assumption on the form of
such as acyclicity
or injectivity.
The function
is used to model attributes of entities. If for example
associates the
-labeled tuple
to an entity E, then E has two
attributes A1,A2 whose values are integers and strings respectively. For
simplicity we assume attributes to be single-valued and mandatory, but we could
easily handle also multi-valued attributes with associated cardinalities.
The function
associates a set of roles to each relationship symbol
R, determining implicitly also the arity of R, and for each role U in
such set a distinguished entity, called the primary entity for U in
R. In a database satisfying the schema only instances of the primary entity
are allowed to participate in the relationship via the role U.
The function
specifies cardinality constraints, i.e.,
constraints on the minimum and maximum number of times an instance of an entity
may participate in a relationship via some role. Since such constraints are
meaningful only if the entity can effectively participate in the relationship,
the function is defined only for the sub-entities of the primary entity. The
special value
is used when no restriction is posed on the maximum
cardinality. Such constraints can be used to specify both existence
dependencies and functionality of relations [36]. They are often used
only in a restricted form, where the minimum cardinality is either 0 or 1
and the maximum cardinality is either 1 or
.
Cardinality constraints
in the form considered here have been introduced already by [3] and
subsequently studied by [48,63,45,77,73].
The semantics of an ER schema can be given by specifying which database states are
consistent with the information structure represented by the schema. Formally,
a database state
corresponding to an ER schema
is
constituted by a nonempty finite set
,
assumed to be disjoint
from all basic domains, and a function
that maps
A database state is considered acceptable if it satisfies all integrity constraints that are part of the schema. This is captured by the definition of legal database state.
Notice that the definition of database state reflects the usual assumption in databases that database states are finite structures (see also [37]). In fact, the
basic domains are not required to be finite, but for each legal database state for
a schema, only a finite set of values from the basic domains are actually of
interest. We define the active domain
of a database state
as
the set of all elements of the basic domains
,
,
that
effectively appear as values of attributes in
.
More formally:
Reasoning in the ER model includes verifying entity satisfiability and deducing inheritance. Entity satisfiability amounts to checking whether a given entity can be populated in some legal database state [6,63,40], and corresponds to the notion of concept consistency in DLs. Deducing inheritance amounts to verifying whether in all databases that are legal for the schema, every instance of an entity is also an instance of another entity. Such implied ISA relationships can arise for different reasons. Either trivially, through the transitive closure of the explicit ISA relationships present in the schema, or in more subtle ways, through specific patterns of cardinality restrictions along cycles in the schema and the requirement of the database state to be finite [63,37].
We now show that the different forms of reasoning on ER schemata are captured
by finite concept consistency and finite concept subsumption in ALUNI. The
correspondence between the two formalisms is established by defining a
translation
from ER schemata to ALUNI knowledge bases, and then proving
that there is a correspondence between legal database states and finite models of
the derived knowledge base.
The translation makes use of both inverse attributes and number restrictions to capture the semantics of ER schemata. We observe that, by means of the inverse constructor, a binary relationship could be treated in a simpler way by choosing a traversal direction and mapping the relationship directly to a role. Notice also that the assumption of acyclicity of the resulting knowledge base is unrealistic in this case, and in order to exploit the correspondence for reasoning in the ER model, we need techniques that can deal with inverse attributes, number restrictions, and cycles together. As shown in Example 2.3, the combination of these factors causes the finite model property to fail to hold, and we need to resort to reasoning methods for finite models.
In fact, we can reduce reasoning in the ER model to finite model reasoning in ALUNI knowledge bases. For this purpose we define a mapping between database states corresponding to an ER schema and finite interpretations of the knowledge base derived from it. Due to the possible presence of relations with arity greater than 2, this mapping is however not one-to-one and we first need to characterize those interpretations of the knowledge base that directly correspond to database states.
Intuitively, the extension of a relationship in a database state is a set of labeled tuples, and such a set does not contain the same element twice. Therefore it is implicit in the semantics of the ER model that there cannot be two labeled tuples connected through all roles of the relationship to exactly the same elements of the domain. In a model of the ALUNI knowledge base corresponding to the ER schema, on the other hand, each tuple is represented by a new individual, and the above condition is not implicit anymore. It also cannot be imposed in ALUNI by suitable assertions. The following lemma, however, shows that we do not need such an explicit condition, when we are interested in reasoning on an ALUNI knowledge base corresponding to an ER schema. This is due to the fact that we can always restrict ourselves to considering only relation-descriptive models.
Proof. Let
be a finite model of
such that
.
We can
build a finite relation-descriptive model
by starting from
and
applying the following construction once for each relationship in
.
Let
be the model obtained in the previous step and let
with
be the next relationship to which we apply the
construction. We construct from
a model
such that
condition 8 is satisfied for
relationship R.
Given an individual
,
we denote by Ui(d),
the (unique) individual e such that
.
For
,
we define
.
We call conflict-set a set
with more than one element.
From each conflict-set
we randomly choose one
individual r, and we say that the others induce a conflict on
.
We call
the (finite) set of all objects
inducing a conflict on some
.
We define an interpretation
as the disjoint union of
copies of
,
one copy, denoted by
,
for every
set
.
We denote by
the copy in
of the
individual d in
.
Since the disjoint union of two models of an ALUNI knowledge base is again a model,
is a model of
.
Let
and
be two copies of
in
.
We call
exchanging
with
the operation on
consisting of replacing in
the
pair
with
and, at the same time,
replacing in
the pair
with
.
Intuitively, by exchanging
with
,
the individuals
and
do not induce conflicts
anymore.
We construct now from
an interpretation
as follows:
For each
and for each
such that
,
we
exchange
with
.
It is possible to
show that all conflicts are thus eliminated while no new conflict is created.
Hence, in
,
condition 8 for R is
satisfied.
We still have to show that
is a model of
in which
.
Indeed, it is straightforward to check by induction
that for every concept expression C' appearing in
,
for all
,
if and only if
.
Thus all
assertions of
are still satisfied in
and
.
With this result, the following correspondence between legal database states for an ER schema and relation-descriptive models of the resulting ALUNI knowledge base can be established.
Proof. (1) Given a database state ,
we define the interpretation
of
as follows:
(2) Let
be a finite relation-descriptive interpretation of
.
For
each basic domain
,
let
be a function from
to
that is one-to-one and onto. Since
is finite and each
basic domain contains a countable number of elements, such a function always
exists. In order to define
we first specify a mapping
that associates to each individual
an element as follows:
If
is a model of
the above rules define
for every
.
Indeed, by assertions 7, each
can be an instance of at most one atomic concept corresponding to a
relationship or basic domain, and if this is the case it is not an instance of
any atomic concept corresponding to an entity. Moreover, if
for some relationship
with
,
then by
assertions 3, for each
there
is exactly one element
such that
.
If
is not a model of
and for some
,
is not
uniquely determined, then we choose nondeterministically one possible value.
We can now define the database state
corresponding to
:
The following theorem allows us to reduce reasoning on ER schemata to finite model reasoning on ALUNI knowledge bases.
Proof. (1)
Let
be a legal database state with
.
By part 1 of
Proposition 4.9,
is a finite
model of
in which
.
Let
be finitely consistent in
.
By Lemma 4.8 there is a finite
relation-descriptive model
of
with
.
By part 2 of Proposition 4.9,
is a database state legal for
in which
.
(2)
Let
.
Then
is finitely consistent in
.
By Lemma 4.8 there is a finite
relation-descriptive model
of
with
and
,
for some
.
By part 2 of Proposition 4.9,
is a database
state legal for
in which
and
.
Therefore E does not inherit from E'.
Assume E does not inherit from E'. Then there is a database state
legal for
where for an instance
we have
.
By part 1 of Proposition 4.9,
is a
finite model of
in which
and
.
Therefore
.
Theorem 4.10 allows us to effectively exploit the reasoning methods that have been developed for ALUNI in order to reason on ER schemas. The complexity of the resulting method for reasoning on ER schemata is exponential. Observe however, that the known algorithms for reasoning on ER schemata are also exponential [28], and that the precise computational complexity of the problem is still open.
Moreover, by exploiting the correspondence with ALUNI, it becomes possible to add to the ER model (and more in general to semantic data models) several features and modeling primitives that are currently missing, and which have been considered important, and fully take them into account when reasoning over schemata. Such additional features include for example the possibility to specify and use arbitrary boolean combinations of entities, and to refine properties of entities along ISA hierarchies.
Object-oriented data models have been proposed with the goal of devising database formalisms that could be integrated with object-oriented programming systems [57]. They are the subject of an active area of research in the database field, and are based on the following features:
As in the previous section, we present the common basis of object-oriented data models with other class-based formalisms by introducing a language for specifying object-oriented schemata and show that such schemata can be correctly represented as ALUNI knowledge bases. In our analysis, we concentrate our attention on the structural aspects of object-oriented data models. One of the characteristics of the object-oriented approach is to provide mechanisms for specifying also the dynamic properties of classes and objects, typically through the definition of methods associated to the classes. Those aspects are outside the scope of our investigations. Nevertheless, we argue that general techniques for schema level reasoning, in particular, type consistency and type inference, can be profitably exploited for restricted forms of reasoning on methods [1].
Below we define a simple object-oriented language in the style of most popular models featuring complex objects and object identity. Although we do not refer to any specific formalism, our model is inspired by the ones presented by [2,52].
Each class declaration imposes constraints on the instances of the class it refers to. The is-a part of a class declaration allows one to specify inclusion between the sets of instances of the involved classes, while the type-is part specifies through a type expression the structure assigned to the objects that are instances of the class.
The meaning of an object-oriented schema is given by specifying the characteristics of an instance of the schema. The definition of instance makes use of the notions of object identifier and value.
Let us first characterize the set of values that can be constructed from a set
of symbols, called object identifiers. Given a finite set
of
symbols denoting real world objects, the set
of values over
is inductively defined as follows:
The interpretation of type expressions in
is defined through an
interpretation function
that assigns to each type
expression a subset of
such that the following conditions are
satisfied:
In order to characterize object-oriented data models we consider the instances that are admissible for the schema.
Therefore, for a legal database instance, the type expressions that are present in the schema determine the (finite) set of active values that must be considered. The construction of such values is limited by the depth of type expressions.
We establish now a relationship between ALUNI and the object-oriented language
presented above. This is done by providing a mapping from object-oriented schemata into
ALUNI knowledge bases. Since the interpretation domain for ALUNI knowledge bases consists of
atomic objects, whereas each instance of an object-oriented schema is assigned a possibly
structured value (see the definition of
), we need to explicitly represent
some of the notions that underlie the object-oriented language. In particular, while
there is a correspondence between concepts and classes, one must explicitly
account for the type structure of each class. This can be accomplished by
introducing in ALUNI concepts AbstractClass, to represent the classes, and
RecType and SetType to represent the corresponding types. The associations
between classes and types induced by the class declarations, as well as the
basic characteristics of types, are modeled by means of roles: the (functional)
role value models the association between classes and types, and the role
member is used for specifying the type of the elements of a set. Moreover,
the concepts representing types are assumed to be mutually disjoint, and
disjoint from the concepts representing classes. These constraints are
expressed by adequate inclusion assertions that will be part of the knowledge base we are
going to define.
We first define the function
that maps each type expression into an
concept expression as follows:
Using
we define the ALUNI knowledge base corresponding to an object-oriented schema.
From the above translation we can observe that inverse roles are not necessary for the formalization of object-oriented data models. Indeed, the possibility of referring to the inverse of an attribute is generally ruled out in such models. However, this strongly limits the expressive power of the data model, as pointed out in recent papers (see for example [4,32]). Note also that the use of number restrictions is limited to the value 1, which corresponds to existence constraints and functionality, whereas union is used in a more general form than for example in the KEE system.
Below we discuss the effectiveness of the translation .
First of
all observe that the ALUNI knowledge base
resulting from the translation
of an object-oriented schema
may admit models that do not have a direct counterpart
among legal database instances of
.
More precisely, both an interpretation of
and a database instance of
can be viewed as a directed labeled graph: In the case of an interpretation,
the nodes are domain individuals and the arcs are labeled with roles. In the
case of a database instance, the nodes are either object identifiers or active
values, and an arc either connects an object identifier to its associated value
(in which case it is labeled with value), or is part of the sub-structure
representing a set or record value (in which case it is labeled with member or with an attribute, in accordance with the type of the value).
In a legal database instance of
,
a value v is represented by a
sub-structure that has the form of a finite tree with v as root, set and
record values as intermediate nodes, and objects identifiers as leaves.
Clearly, such a substructure does not contain cycles.
Conversely, in a model of
,
there may be cycles involving only nodes that
are instances of SetType and RecType and in which all roles are different
from value. We call such cycles bad. A model containing bad cycles
cannot be put directly in correspondence with a legal database instance. Also,
due to the open semantics of records one cannot adopt a different translation
for which bad cycles in the model are ruled out.
We can nevertheless establish a correspondence from finite models of
possibly containing bad cycles to legal instances of the object-oriented schema
.
This can be achieved by unfolding the bad cycles in a model of
to
infinite trees. Obviously, the unfolding of a cycle into an infinite tree,
generates an infinite number of nodes, which would correspond to an infinite
database state. However, we can restrict the duplication of individuals to
those that represent set and record values, and thus are instances of SetType
and RecType. The instances of AbstractClass, instead, are not duplicated in
the process of unfolding, and therefore their number remains finite. Moreover,
since the set of possible active values associated with each object identifier
is bound by the depth of the schema, we can in fact block the unfolding of bad
cycles to the finite tree of depth equal to the depth of the schema.
Let us first formally define the depth of an object-oriented schema .
We can now introduce the notion of unfolding of an ALUNI interpretation.
The correctness of
is sanctioned by the following proposition.
Proof. 351
(1) Given a database instance
we define an interpretation
of
as follows:
We prove that for each type T and each
,
if and
only if
.
The first part of the
thesis then follows from the definition of
.
The proof is by
induction on the structure of the type expression.
Base case: T=C (i.e., T is a class name). If
then
,
and
vice-versa if
then
.
Inductive case:
and
.
We assume that
iff
,
for
,
and show
that
iff
.
Suppose that
,
i.e.,
with
and
for
.
By induction hypothesis
,
for
,
and by
definition of
,
,
for
,
and all roles
corresponding to attribute names
are functional. Therefore,
.
Conversely, suppose that
.
Then,
for each
there is exactly one
such
that
,
and moreover
.
By definition of
we have
,
with
and
,
for
.
By induction hypothesis
,
for
,
and therefore
.
The cases for
and
can be treated analogously.
(2) Given a finite model
of
of depth m, we define a legal database
instance
as follows:
We first prove that for each concept ,
which is the translation of a
type expression T of
,
and each
,
if
and only if
.
The proof is by induction on
the structure of the concept expression. Again for the inductive part we
restrict our attention to the case of record types.
Base case: T=C (i.e.,
is an atomic concept). If
then
,
and
vice-versa if
then
.
Inductive case:
and
.
We assume that
iff
,
for
,
and show that
iff
.
Suppose that
.
Then
and for each
there is an individual di such that
and
.
By construction
for some
.
Moreover, by induction
hypothesis
and therefore
.
Conversely, suppose that
,
i.e.,
with
and
for
.
By induction hypothesis
,
for
,
and by
definition of
,
and
,
for
.
Since all roles
corresponding to attribute names are functional,
.
It remains to show that for each declaration
(a) follows from the fact that
contains the assertion
and from the definition of
.
(b) follows from what we have shown above and from the fact that
still satisfies the assertion
.
In fact, for some
let d' be the unique individual such
that
.
Since
is a model of
,
.
We argue that also
.
If d' is not part of a bad cycle in
,
then
and
coincide on
the sub-structure rooted at d' and formed by the individuals reached via
member and roles corresponding to attributes, and we are done.
Otherwise, in
such sub-structure is expanded into a finite tree.
Since by construction the depth of this tree is at least
,
and the
connections between individuals in
are preserved in
,
it follows
that
.
The basic reasoning services considered in object-oriented databases are subtyping (check whether a type denotes a subset of another type in every legal instance) and type consistency (check whether a type is consistent in a legal instance). Based on Proposition 5.11, we can show that these forms of reasoning are fully captured by finite concept consistency and finite concept subsumption in ALUNI knowledge bases.
Proof. The proof is analogous to the proof of Theorem 4.10,
but it makes use of Proposition 5.11 instead of
Proposition 4.9.
Again, the correspondence with ALUNI established by Theorem 5.12 allows us to make use of the reasoning techniques developed for ALUNI to reason on object-oriented schemas. Observe that reasoning in object-oriented models is already PSPACE-hard [10] and thus the known algorithms are exponential. However, by resorting to ALUNI, it becomes possible to take into account for reasoning also various extensions of the object-oriented formalism. Such extensions are useful for conceptual modeling and have already been proposed in the literature [33]. First of all, the same considerations developed for the ER model with regard to the use of arbitrary boolean constructs on classes can be applied also in the object-oriented setting, which provides disjunction but does not admit any form of negation. Additional features that can be added to object oriented models are inverses of attributes, cardinality constraints on set-valued attributes, and more general forms of restrictions on the values of attributes.
In this section we briefly discuss recent results on the correspondence between class-based formalisms and on techniques for reasoning in ALUNI and in class-based representation formalisms.
In the past there have been several attempts to establish relationships among class-based formalisms. [12,62] carry out a comparative analysis of class-based languages and attempt to provide a unified view. The analysis makes it clear that several difficulties arise in identifying a common framework for the formalisms developed in different areas. Some recent papers address this problem. For example, an analysis of the relationships between frame-based languages and types in programming languages has been carried out by [13], while [11,67] use frame-based languages to enrich the deductive capabilities of semantic and object-oriented data models.
[5] study reasoning in object-oriented data models by presenting a translation to DLs in the style of the one discussed in Section 5. However, the proposed translation is applicable only in the case where the shema contains no recursive class declarations. This limitation is not present in the work by [10], where a formalism derived from DLs is used to model complex objects and an algorithm for computing subsumption between classes is provided.
A recent survey on the application of DLs to the problem of data management has been presented by [14] . The application to the task of data modeling of reasoning techniques derived from the correspondences presented in Sections 4 and 5 is discussed in more detail by [30].
Recently, there have also been proposals to integrate the object-oriented and the logic programming paradigms [56,55]. These proposals are however not directly related to the present work, since they aim at providing mechanisms for computing with structured objects, rather than means for reasoning over a conceptual (object-oriented) representation of the domain of interest.
ALUNI is equipped with techniques to reason both with respect to unrestricted and with respect to finite models. We briefly sketch the main ideas underlying reasoning in both contexts. A detailed account of the reasoning techniques has been carried out by [25].
We remind that reasoning on a knowledge base with respect to unrestricted models amounts to check either concept consistency, i.e., determine whether the knowledge base admits a (possibly infinite) model in which a given concept has a nonempty extension, or concept subsumption, i.e., determine whether the extension of one concept is contained in the extension of another concept in every model (including the infinite ones) of the knowledge base.
The method to reason in ALUNI with respect to unrestricted models exploits a
well known correspondence between DLs and Propositional Dynamic Logics (PDLs)
[59], which are a class of logics specifically designed to reason
about programs. The correspondence, which has first been pointed out by
[68], relies on a substantial similarity of the interpretative
structures of both formalisms, and allows one to exploit the reasoning
techniques developed for PDLs to reason in the corresponding DLs. In
particular, since
,
the description language of ALUNI, includes the
construct for inverse roles, for the correspondence one has to resort to
converse-PDL, a variant of PDL that includes converse programs
[59]. However, because of the presence of number restrictions in
which have no direct correspondence in PDLs, we cannot rely on
traditional techniques for reasoning in PDLs. Recently, encoding techniques
have been developed, which allow one to eliminate number restrictions from a
knowledge base while preserving concept consistency and concept subsumption
[38]. The encoding is applicable to knowledge bases formulated in
expressive variants of DLs, and in particular it can be used to reduce
unrestricted model reasoning on ALUNI knowledge bases (both concept
consistency and concept subsumption) to deciding satisfiability of a formula of
converse-PDL. Reasoning in converse-PDL is decidable in EXPTIME [59],
and since the encoding is polynomial [38] we obtain an EXPTIME
decision procedure for unrestricted concept consistency and concept subsumption
in ALUNI knowledge bases. A simplified form of the encoding, which can be
applied to decide unrestricted concept consistency in ALUNI has also been
presented by [29].
We remind that reasoning on a knowledge base with respect to finite models amounts to check either finite concept consistency or finite concept subsumption, for which only the finite models of the knowledge base must be considered.
For finite model reasoning, the techniques based on a reduction to reasoning in PDLs are not applicable. Indeed, the PDL formula corresponding to an ALUNI knowledge base contains constructs both for converse programs (corresponding to inverse roles) and for functionality of direct and inverse programs, and thus is a formula of a variant of PDL which does not have the finite model property [75]. However, after encoding functionality, one obtains a converse-PDL formula, and since converse-PDL has the finite model property [47], this formula is satisfiable if and only if it is finitely satisfiable. This shows that the encoding of number restrictions (and in particular the encoding of functionality), while preserving unrestricted satisfiability does not preserve finite satisfiability [38].
For finite model reasoning in ALUNI one can adopt a different technique, which is based on the idea of separating the reasoning process in two distinct phases (see [25] for full details). The first phase deals with all constructs except number restrictions, and builds an ``expanded knowledge base'' in which these constructs are embedded implicitly in the concepts and roles. In the second phase the assertions involving number restrictions are used to derive from this expanded knowledge base a system of linear inequalities. The system is defined in such a way that its solutions of a certain type (acceptable solutions) are directly related to the finite models of the original knowledge base. In particular, from each acceptable solution one can directly deduce the cardinalities of the extensions of all concepts and roles in a possible finite model. The proposed method allows one to establish for ALUNI EXPTIME decidability for finite concept consistency and for special cases of finite concept subsumption. By resorting to a more complicated encoding one can obtain a 2EXPTIME decision procedure for finite concept subsumption in ALUNI in general [23,25].
Reasoning with respect to finite models has also been investigated in the context of dependency theory in databases. As shown by [31] for the relational model, when functional and inclusion dependencies interact, the dependency implication problem in the finite case differs from the one in the unrestricted case. While the implication problem for arbitrary functional and inclusion dependencies is undecidable [34,64], for functional and unary inclusion dependencies it is solvable in polynomial time, both in the finite and the unrestricted case [37].
Consistency with respect to finite models of schemata expressed in an enriched Entity-Relationship model with cardinality constraints has been shown decidable in polynomial time by [63]. [28] extend the decidability result to include also ISA relationships, and [27] show EXPTIME decidability of reasoning in an expressive object-oriented model. An algorithm for computing a refinement ordering for types (the analogue to a concept hierarchy) in the framework of the O2 object oriented model in discussed by [60].
Reasoning in the strict sublanguage of ALUNI obtained by omitting inverse roles and number restrictions is already EXPTIME-hard [24]. Therefore, the known algorithms for deciding unrestricted concept consistency and subsumption and finite concept consistency are essentially optimal.
We have presented a unified framework for representing information about class structures and reasoning about them. We have pursued this goal by looking at various class-based formalisms proposed in different fields of computer science, namely frame based systems used in knowledge representation, and semantic and object-oriented data models used in databases, and rephrasing them in the framework of description logics. The resulting description logic, called ALUNI includes a combination of constructs that was not addressed before, although all of the constructs had previously been considered separately.
The major achievement of the paper is the demonstration that class-based formalisms can be given a precise characterization by means of a powerful fragment of first-order logic, which thus can be regarded as the essential core of the class-based representation formalisms belonging to all three families mentioned above. This has several consequences.
First of all, any of the formalisms considered in the paper can be enriched with constructs originating from other formalisms and treated in the general framework. In this sense, the work reported here not only provides a common powerful representation formalism, but may also contribute to significant developments for the languages belonging to all the three families. For example, the usage of inverse roles in concept languages greatly enhances the expressivity of roles, while the combination of ISA, number restrictions, and union enriches the reasoning capabilities available in semantic data models.
Secondly, the comparison of class-based formalisms from the fields of knowledge representation and conceptual data modeling makes it feasible to address the development of reasoning tools to support conceptual modeling [30]. In fact, reasoning capabilities become especially important in complex scenarios such as those arising in heterogenous database applications and Data Warehousing. This line of work was among the motivations for developing systems based on expressive description logics [50,51], and has lead to further extending the language of description logics to support Information Integration and, more specifically, the conceptual modeling of Data Warehouses [26].