|
Guided Tour: Conceptual Modelling with Extended
Entity-Relationship
Let us start with an example EER diagram, showing all the main
features of the conceptual modelling language provided by ICOM:
The above diagram states that mobile calls are a kind of calls (IsA
link between entities); that phone points are partitioned between
cell points and landline points (i.e., any phone point is either a
cell or a landline point, but not both: they form a covering and
disjoint IsA hierarchy); that home points are among phone points,
none of them being a cell point (i.e., the home point entity is
disjoint from the cell entity). Each call has at least one
destination phone point (mandatory participation of cell to origin),
while it has exactly one origin phone point. Mobile calls are
related to cells through the mOrigin relationship. Finally, the
binary relationship mOrigin is a included in the binary relationship
origin.
Which are the consequences of the above EER diagram? ICOM
automatically produces the following completed diagram:
It is stated that in the above scenario it is necessarily true
(green deduction) that any home point is
also a landline point, and that each mobile call may have an origin
from at most one cell point. In order to understand why this is
true, consider the following. The class of home points is a sub
class of all the phone points, and it is disjoint from the class of
cell points. Since any phone point is either a cell point or a
landline point, then any home point should necessarily be a landline
point. The mOrigin binary relationship is included in the
origin binary relationship, i.e., any pair in mOrigin is also among
the pairs in origin. Since each call participates exactly once as
first argument to the origin relationship, if I take a generic sub
class of calls, such as the class of mobile calls, and a sub
relationship of the origin relationship, such as mOrigin, then we
can conclude that necessarily each mobile call participates at most
once as first argument to the mOrigin relationship. Nothing can be
concluded about the minimum participation, since the mOrigin
relationship may not contain all calls in the Origin relationship.
Let us now add an IsA link to the original diagram, stating that each
cell point is among the landline points:
ICOM now concludes the following:
The cell entity is inconsistent, i.e., does not
have any instance, since the disjointness constraint in the IsA link
states that there is no element in common between cell and landline
phone points. The empty set denoted by the cell entity is the only set
which can be at the same time disjoint and a subset of another
set. Since the phone point entity is formed by the union of the cell
and landline entities, and the cell entity is inconsistent, the
landline entity becomes equivalent to the phone point entity.
Moreover, since there is no cell point, there is no pair in the
mOrigin relationship as well (i.e., it is inconsistent):
the diagram states that any second argument of the mOrigin
relationship should be of the cell type. The mobile call entity is
not inconsistent, since it may be populated by calls which have no
mOrigin at all (this is possible, since there is no mandatory
participation constraint).
Let us now add a cardinality constraint, stating that now each mobile
call should participate at least once to the mOrigin relationship
(i.e., a mandatory participation constraint):
Now, ICOM deduces that the mobile call entity is inconsistent as well:
If we force the landline point entity to be inconsistent as well (by adding an IsA link between
landline points and cell points), there will be a cascade effect. The
phone point entity becomes inconsistent, since
it is the union of two inconsistent classes. Therefore, the home point
entity will be inconsistent as well, since it
is a sub entity of an inconsistent entity. The destination and origin
relationships will be inconsistent, since there
is no phone point participating to them. Given the mandatory
participation constraint of the call entity to the destination (or
origin) relationship, we can conclude that the call entity is
necessarily inconsistent as well:
Let us now consider a different example diagram, showing some
reasoning involving attributes and domains:
We have a partition of employees between clerks and managers, plus two
more sub-entities of employee, namely rich employee and poor employee,
disjoint respectively from the clerk and the manager entities. All the
sub entities have the salary attribute restricted to a string of
length 8, with the exception of the clerk entity which has the salary
attribute restricted to be a string of length 5. Is is easy to see
that a necessary consequence of the above diagram is that rich
employees are managers and that poor employees are clerks:
However, since that salary attribute for clerks and poor employees
have incompatible domains, we can not have any poor employee in any
legal database, i.e., the poor employee entity is inconsistent.
As the last example, let us introduce a diagram where some entity and
some relationship are defined by means of views over other elements of
the schema.
The view language is the DLR description logic. The view language
includes two syntactic sorts: one for entities and one for
relationships. Full boolean operators are allowed for both entities
and relationship expressions, plus a selection operator
(selecting tuples in a relationship with a specific entity type in
some named role argument) and a unary projection operator
(projecting a relationship over a named role argument). A generalised
projection operator with cardinality restrictions is available as
well. The above diagram introduces NYPD policemen, each one of
them legally killed at least one drug dealer, and mafioso people, each
one of them illegally killed at least one drug dealer. Moreover, a
relation view has been defined as the relation having the "killed"
attribute selected to be of the drug dealer type (the view makes use
of the selection operator), and an entity view has been defined as the
entity obtained by projecting over the killer attribute the union of
the legally and illegally kills relationships.
As it is shown in the deduced diagram below, the relation view is a
relationship including both the legally and the illegally kills
relationships, while the entity view is clearly a super entity of both
the NYPD policeman and the mafioso entities:
In the next example, we introduce a UniversalClass, defined as the
union of a generic class and its complement, and an EmptyClass,
defined as the intersection of a generic class and its complement:
If the UniversalClass is declared as a subclass of the EmptyClass, the whole schema becomes inconsistent, in the sense that it is impossible to assume the existence of any object in the universe, since if it were existing it would contradict the schema:
|