Chapter 4
The Enhanced Entity–Relationship
(EER) Model
Group member :周奕均、吳宜珈
OUTLINE
4.0 Introduction
4.1 Subclasses, Superclasses, and Inheritance
4.2 Specialization and Generalization
4.3 Constraints and Characteristics of Specialization and
Generalization Hierarchies
4.4 Modeling of UNION Types Using Categories
4.5 A Sample UNIVERSITY EER Schema, Design Choices,
and Formal Definitions
4.6 Example of Other Notation: Representing Specialization
and Generalization in UML Class Diagrams
4.7 Data Abstraction, Knowledge Representation, and
Ontology Concepts
4.8 Summary 2
Introduction
This chapter continues from Chapter 3 and explores how to
expand the ER model by adding concepts from semantic
data models, forming the Enhanced ER (EER) model. These
extensions help meet the needs of more complex
applications, such as engineering design, manufacturing
(CAD/CAM), telecommunications, software systems, and
geographic information systems (GIS).
3
4.1
Subclasses, Superclasses, and Inheritance
Superclass/Subclass Relationship
The EER model extends the ER model by adding concepts like subclass
and superclass, as well as specialization/generalization. Additionally, the
EER model includes the concept of categories or union types.
Superclass: A general entity type that includes all the subclasses.
Subclass: A specific subset within the superclass.
Superclass/Subclass Relationship: Members of a subclass are also
members of the superclass.
5
Type Inheritance
Subclass inherits the attributes and relationships of the superclass:
Attribute Inheritance: A subclass inherits all the basic attributes of
the superclass.
Relationship Inheritance: A subclass inherits all the relationships of
the superclass.
Subclass Specific Attributes and Relationships: A subclass has its
own unique attributes and relationships and can be considered an
independent entity type.
6
EER diagram notation to represent subclasses and specialization
7
4.2
Specialization and Generalization
4.2.1 Specialization
Specialization is a process that breaks down a general entity type
(Superclass) into more specific Subclasses based on certain attributes or
characteristics.
(Example) Employee Specialization
Superclass: EMPLOYEE
Subclasses: {SECRETARY, ENGINEER, TECHNICIAN}
Distinguishing Feature: Job type of the employee.
9
Instances of Specialization
10
4.2.2 Generalization
Generalization is the opposite of specialization. It is the process of
combining multiple entity types (Superclass) that share common attributes
or characteristics into a more general superclass.
(Example) Employee Specialization
Superclass: EMPLOYEE
Subclasses: {SECRETARY, ENGINEER, TECHNICIAN}
Common Feature: All are employees of the company.
11
Instances of Generalization
12
4.3
Constraints and Characteristics of
Specialization and Generalization Hierarchies
4.3.1 Constraints on Specialization and Generalization
The main discussion focuses on the constraints applied to disjoint
specialization and generalization. It aims to more clearly define the
relationship between superclasses and subclasses, ensuring that the
database schema accurately reflects Real-world rules.
14
Main types of constraints
A. Predicate-Defined Subclasses:
• Definition: Subclasses are determined by setting conditions on certain
attributes of the superclass to decide which entities belong to each
subclass.
• Representation: Write the predicate condition next to the line
connecting the subclass and the specialization circle.
15
Main types of constraints
B. Attribute-Defined Specialization:
• Definition: If all subclasses in a specialization are defined based on
the value of the same attribute from the superclass, it is called
attribute-defined specialization.
• Representation: Place the attribute name next to the arc line from the
circle to the superclass.
C. User-Defined Subclasses:
• Definition: If there are no conditions to determine the membership of
a subclass, it is called a user-defined subclass.
16
Main types of constraints
D. Disjointness Constraint:
• Definition: Subclasses must be disjoint sets, meaning an entity can
belong to only one subclass at most.
• Representation: "d" inside the circle.
E. Overlapping Constraint:
• Definition: Subclass entity sets may overlap, meaning an entity can
belong to multiple subclasses.
• Representation: "d" inside the circle.
• Default: If no disjointness constraint is specified, the default is
overlapping. 17
Main types of constraints
F. Completeness/Totalness Constraint:
• Definition: Every entity in the superclass must belong to at least one
subclass.
• Representation: Use a double line to connect the superclass and the
circle.
G. Partial Constraint:
• Definition: Entities in the superclass may not belong to any subclass.
• Representation: Use a single line to connect the superclass and the
circle.
18
Possible constraint combinations
A. Disjoint and Total
B. Disjoint and Partial
C. Overlapping and Total
D. Overlapping and Partial
19
Insertion and Deletion Rules for Specialization
① When deleting an entity from the superclass, it is
automatically removed from all subclasses.
② When adding an entity to the superclass, it must also be
added to all relevant subclasses.
③ In totality of specialization, an entity in the superclass
must belong to at least one subclass.
20
EER diagram notationfor an attribute-definedspecialization
superclass
(Attributes)
subclasses
21
EER diagram notation for an overlapping specialization.
superclass
subclasses
o Overlapping Constraint
22
4.3.2 Specialization and Generalization Hierarchies and Lattice
This section discusses further defining subclasses to form a
specialization or generalization hierarchy or lattice.
Hierarchy: Single inheritance, where a subclass has only one superclass,
forming a tree structure.
Lattice: Multiple inheritance, where a subclass can have multiple
superclasses, forming a lattice structure.
23
A specialization lattice with shared subclass
ENGINEERING_MANAGER
superclass
EMPLOYEE’s subclasses
ENGINEER & MANAGER’s subclasses
24
A specialization lattice with multiple inheritance for a UNIVERSITY
database
25
4.3.3 Utilizing Specialization and Generalization in Refining
Conceptual Schemas
Specialization: A top-down conceptual refinement process that divides a
broad entity type(superclass) into more specific subclasses.
Generalization: A bottom-up conceptual synthesis process that groups
multiple specific subclasses into a broader entity type (superclass).
26
Utilizing Specialization in Refining Conceptual Schemas
27
Utilizing Generalization in Refining Conceptual Schemas
28
Comparison of Specialization and Generalization
• Result
The final design of the hierarchy or lattice produced by both processes may
be the same.
• Difference
The only difference is the order or way in which superclasses and
subclasses are created during the design process.
• Practical Application
In practice, a combination of both processes is often used.
29
4.4
Modeling of UNION Types Using Categories
Categories / Union Type
It classifies or combines entities from different types based on certain
common characteristics, and the subclass represents a subset of these entity
types.
31
Two categories: OWNER and REGISTERED_VEHICLE
OWNER Class
Superclasses:
PERSON, BANK, and COMPANY
Union subclass:
OWNER
REGISTERED_VEHICLE Class
Superclasses:
CAR and TRUCK
Union subclass:
REGISTERED_VEHICLE
32
Comparison of Class and Other Subclass/Superclass
Relationships
• Category:
Used to combine entities from different superclasses.
Has multiple superclass.
• Other Subclass/Superclass Relationships:
Each subclass has only one superclass.
33
4.5
A Sample UNIVERSITY EER Schema, Design
Choices, and Formal Definitions
4.5.1 A Different UNIVERSITY Database Example
In a university database, this database tracks students and their majors,
transcripts, and registration status, as well as the university's course
offerings. It also tracks faculty and graduate-funded research projects.
35
Two categories: OWNER and REGISTERED_VEHICLE
Main Features
•Personnel and Course Classification:
• "Person" is divided into "Faculty" and "Student,"
with "Student" further divided into "Graduate
Student."
• "Course" is classified as "Current Courses."
•Multiple Roles:
• A "Teaching Researcher" belongs to both
"Faculty" and "Graduate Student."
•Multiple Relationships:
• The diagram shows various relationships between
entities, such as teacher-student relationships and
department affiliations.
•Special Information:
• "Graduate Student" records multiple degrees.
• "Current Courses" only displays the courses for
the current term.
36
4.5.2 Design Choices for Specialization/Generalization
Conceptual Database Design should be seen as an iterative
refinement process, continuing until the most suitable design is
achieved.
The EER model process should:
Define only necessary subclasses.
Merge subclasses when appropriate.
Use union types cautiously.
Select constraints based on actual needs.
※Balance accuracy and simplicity.
37
A specialization lattice with shared subclass
ENGINEERING_MANAGER
EMPLOYEE’s subclasses
ENGINEER & MANAGER’s subclasses
38
4.5.3 Formal Definitions for the EER Model Concepts
Class:
• Represents a type of entity and the collection of entities of that type.
• It includes entity types, subclasses, superclasses, and the class itself.
Subclass:
• A subclass S is always a subset of its superclass C (S ⊆ C).
• The relationship between the superclass C and subclass S is denoted by
C/S (IS-A) relationship.
39
4.5.3 Formal Definitions for the EER Model Concepts
Specialization
• Z is a set of subclasses that all share the same superclass G. In other
words, for i = 1, 2, ..., n, G/Si represents a superclass/subclass
relationship.
• The superclass G is the generalization of the subclasses {S1, S2, ..., Sn}.
Totality of Specialization
• If the union of all subclasses equals the superclass :
= G, then Z is called complete
• Otherwise, Z is called partial. 40
4.5.3 Formal Definitions for the EER Model Concepts
Disjointness of Specialization:
• If there are no common entities between subclasses in a specialization,
meaning Si ∩ Sj = ∅ (empty set) for i ≠ j, then Z is disjoint.
• Otherwise, Z is overlapping.
Predicate-Defined Subclass:
• A subclass S of C is called predicate-defined if a predicate p is used on
C's attributes to specify which entities in C belong to S.
•In other words, S = C[p], where C[p] is the set of entities in C that satisfy
p.
41
4.5.3 Formal Definitions for the EER Model Concepts
Attribute-Defined Specialization:
•If a predicate (A = ci) is used to determine the membership of each subclass
Si in specialization Z (or generalization G), then Z is called attribute-defined
specialization.
•Here, A is an attribute of G, and ci is a constant value from the domain of
A.
Note:
If for i ≠ j, ci ≠ cj, and A is a single-valued attribute, then the
specialization is disjoint.
42
4.5.3 Formal Definitions for the EER Model Concepts
Category:
A category T is a subset of the union of n defining parent classes D1, D2, ...,
Dn, where n > 1. Formally, it is represented as:
T ⊆ (D1 ∪ D2 ∪ ... ∪ Dn)
•Entities that belong to T are its members.
•If a predicate is defined for each Di, we get:
T = (D1[p1] ∪ D2[p2] ∪ ... ∪ Dn[pn])
43
4.6
Example of Other Notation: Representing
Specialization and Generalization in UML
Class Diagrams
Core Entity (Entity)
PERSON serves as the fundamental category for all
individuals.
Generalization/Inheritance
EMPLOYEE (Employee) Classification
STUDENT (Student) Classification
STUDENT (Student) Classification
Has a one-to-many relationship with DEGREE
(Degree), meaning an alumnus may hold multiple degrees.
DEGREE (Degree)
STUDENT (Student)
Attribute: Major_dept (Major Department), with the
ability to change_major (Change Major).
45
Difference between Specialization and Generalization
Meaning of the triangle:
•Empty triangle:
Represents a disjoint constraint, meaning an instance of the superclass
can belong to at most one subclass.
•Filled triangle:
Represents an overlapping constraint, meaning an instance of the
superclass can belong to multiple subclasses simultaneously.
Base class and leaf class:
•Base class:
The root superclass in the inheritance structure.
•Leaf classes:
Subclasses (leaf nodes) of the inheritance structure. 46
Role of UML in database modeling
UML class diagrams can be used to correspond to the concepts
represented in the EER diagram. The focus is on UML concepts related to
ER and EER database modeling. It also mentions that the definition of
relationship types has been extended, allowing any class to participate in a
relationship.
47
Different types of UML classes
•Abstract classes:
Define attributes and operations but do not have corresponding object
instances. They are mainly used to specify characteristics that can be
inherited.
•Concrete classes:
Can have object instances. In database design, we mainly focus on
concrete classes because their object collections will be permanently stored
in the database.
•Template classes:
Define a template that can be further used to define other
48
4.
7
Data Abstraction, Knowledge Representation,
and Ontology Concepts
What is Knowledge Representation (KR)?
Definition:
Knowledge Representation (KR) refers to the techniques used to
describe the concepts of a domain and how these concepts are interrelated.
Goals:
• Accurately model knowledge of a domain.
• Create "ontologies" to store and manipulate knowledge.
• Used for reasoning, decision-making, or answering questions.
50
Semantic Data Models vs. Knowledge Representation
Similarities:
• Abstraction Process: Identifies common properties of objects while suppressing
irrelevant differences.
• Defining Data and Knowledge Structures: Includes concepts, relationships,
constraints, etc.
• Reasoning: Both can perform reasoning within a certain scope.
Differences:
• Knowledge representation (KR) has a broader scope than semantic data models,
including rules, temporal and spatial knowledge, and incomplete knowledge,
whereas semantic data models have a narrower scope.
• KR frameworks provide inference mechanisms that can derive new facts from
databases, supporting higher-level queries.
• Database systems, on the other hand, are limited to direct queries. 51
Challenges of Knowledge Representation
Complexity of KR Frameworks:
• Mixing Schema and Instances: KR often combines schema with specific
instances, allowing for flexible handling of exceptions but resulting in
lower implementation efficiency.
• Challenges of Data Scale:When large amounts of structured data need to
be stored, it can lead to performance issues.
52
Four Key Abstraction Concepts
A. Classification and Instantiation:
•Classification: Dividing entities into different categories.
•Instantiation: Assigning actual objects to a category.
•These two concepts are inverse operations.
B. Identification:
•Assigning a unique identifier to each object or instance within the
model.
53
Four Key Abstraction Concepts
C. Specialization and Generalization:
•Specialization: Creating more specific subclasses from a broader
category.
•Generalization: Unifying multiple specific classes into a more
general category.
•These two are inverse operations.
D. Aggregation and Association:
•Aggregation: Combining multiple objects into a higher-level
structure.
•Association: The relationship or interaction between objects.
•These two concepts are related but distinct.
54
4.7.1 Classification and Instantiation
Classification:
• Definition: Systematically assigns similar objects/entities to object classes/entity
types.
• Purpose: To describe or reason about classes, rather than individual objects;
simplifies property discovery.
• Key: Objects that share similar properties, relationships, and constraints are grouped
into classes.
• Classification Concepts in EER Model: Entity types, subclasses, classes, relationship
types.
• Classification Concept in UML: Class.
55
4.7.1 Classification and Instantiation
Instantiation:
• Definition: The reverse process of classification, generating and examining different
objects of a class.
• Relationship: Object instances are related to their classes via IS-AN-INSTANCE-OF
or IS-A-MEMBER-OF relationships.
• EER Diagram: Does not directly show instances.
• UML Diagram: Allows the display of individual objects.
56
4.7.2 Identification
Definition:
Identification is an abstract process in which classes and objects are uniquely identified
through some form of identifier.
Two Levels of Identification Needs:
• Distinguishing Database Objects and Classes:The need to distinguish
between database objects and their corresponding classes.
• Identifying Database Objects and Linking to Real-world
Entities:For example, a PERSON record and a STUDENT record might
represent the same person, requiring a mechanism to identify this
relationship. 57
4.7.2 Identification
Identification in the EER Model:
Schema Level:
• Each class (entity type, subclass, class, relationship type) must have a unique name.
• The attribute names of a specific class must also be distinct.
• In specialization or generalization structures, clear rules are required to identify
references to attribute names.
Object Level:
• The values of key attributes are used to distinguish entities of a specific entity type.
• For weak entity types, an entity is identified through a combination of its partial key
value and the key value of its related owner entity.
• The identification of relationship instances depends on the combination of the entities
involved and is influenced by the cardinality ratio.
58
4.7.3 Specialization and Generalization
Specialization:
• Definition: The process of classifying an object class into more specialized
subclasses.
• Essence: Refining a concept. We start with a broader class and divide it into more
specific subclasses based on particular characteristics or attributes.
Generalization:
• Definition: The inverse process of specialization, where several classes are
abstracted into a higher-level abstract class that contains the objects of all these
classes.
• Essence: Synthesizing concepts. We identify the common features between multiple
classes and abstract them into a more general parent class.
Specialization and generalization are inverse processes of each other. One is top-down
59
4.7.4 Aggregation and Association
Aggregation :
Definition: An abstract concept used to create composite objects from their constituent
objects.
Three cases related to the EER model:
• Aggregating attribute values to form a whole object.
• Representing an aggregation relationship as a regular relationship (not explicitly
provided in the EER model).
• Combining objects related through specific relationship instances into a higher-level
aggregated object.
IS-A-PART-OF / IS-A-COMPONENT-OF relationship: The relationship between
basic objects and their aggregated objects.
UML Support: UML provides support for all three types of aggregation.
60
4.7.4 Aggregation and Association
Association :
Definition: An abstraction used to relate objects from several independent classes.
Similarity to Aggregation: In some ways, it is similar to the second use of aggregation
(representing an aggregation relationship as a regular relationship).
Representation in the EER Model: Represented by a relationship type.
Representation in UML : Represented by an association.
IS-ASSOCIATED-WITH relationship: Used to describe this abstract relationship.
61
4.8
Summary
Using all those extra things like
superclasses and subclasses, and ways
to show them in diagrams, the EER
model can show tricky data stuff much
better. It helps people who design
databases make them more like the real
world.
63
Question 1
"What are Superclass and Subclass?"
(Answer)
• Superclass is a more generalized class that contains the common
attributes of all its subclasses.
• Subclass is a specialized class derived from a superclass,
inheriting the superclass's attributes and having its own
additional attributes.
64
Question 2
"What are the possible constraint combinations
in the EER model ?"
(Answer)
• Disjoint and Total
• Disjoint and Partial
• Overlapping and Total
• Overlapping and Partial
65
Question 3
"What is the differences between specialization
and generalization ?"
(Answer)
• The only difference is the order or way in which superclasses
and subclasses are created during the design process.
66
THIS
CONCLUDES
THE REPORT