Pal gov.tutorial1.session5.subtyperelationsandotherconstraints
-
Upload
mustafa-jarrar -
Category
Education
-
view
429 -
download
1
description
Transcript of Pal gov.tutorial1.session5.subtyperelationsandotherconstraints
1PalGov © 2011
أكاديمية الحكومة اإللكترونية الفلسطينية
The Palestinian eGovernment Academy
www.egovacademy.ps
Session 5
Subtype Relations and Other Constraints
Tutorial 1: Data and Business Process Modeling
Prof. Mustafa Jarrar
Sina Institute, University of Birzeit
www.jarrar.info
Reviewed by
Prof. Marco Ronchetti, Trento University, Italy
2PalGov © 2011
About
This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the
Commission of the European Communities, grant agreement 511159-TEMPUS-1-
2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps
University of Trento, Italy
University of Namur, Belgium
Vrije Universiteit Brussel, Belgium
TrueTrust, UK
Birzeit University, Palestine
(Coordinator )
Palestine Polytechnic University, Palestine
Palestine Technical University, PalestineUniversité de Savoie, France
Ministry of Local Government, Palestine
Ministry of Telecom and IT, Palestine
Ministry of Interior, Palestine
Project Consortium:
Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 [email protected]
3PalGov © 2011
© Copyright Notes
this material, or part of it, but should properly useEveryone is encouraged to
(logo and website), and the author of that part. cite the project
in any form or by any reproduced or modified No part of this tutorial may be
from the project, who have the full written permissionmeans, without prior
copyrights on the material.
Attribution-NonCommercial-ShareAlike
CC-BY-NC-SA
This license lets others remix, tweak, and build upon your work non-
commercially, as long as they credit you and license their new creations
under the identical terms.
4PalGov © 2011
Tutorial Map
Topic Time
Module I: Conceptual Data Modeling
Session 0: Outline and Introduction
Session 1.1: Information Modeling 1
Session 1.2: Conceptual Data Modeling using ORM 1
Session 1.3: Conceptual Analyses 1
Session 2: Lab- Conceptual Analyses 3
Session 3.1: Uniqueness Rules 1.5
Session 3.2: Mandatory Rules 1.5
Session 4: Lab- Uniqueness & Mandatory Rules 3
Session 5: Subtypes and Other Rules 3
Session 6: Lab- Subtypes and Other Rules 3
Session 7.1: Schema Equivalence &Optimization 1.5
Session 7.2: Rules Check &Schema Engineering 1.5
Session 8: Lab- National Student Registry 3
Module II: Business Process Modeling
Session 9: BP Management and BPMN: An Overview 3
Session 10: Lab - BP Management 3
Session 11: BPMN Fundamentals 3
Session 12: Lab - BPMN Fundamentals 3
Session 13: Modeling with BPMN 3
Session 14: Lab- Modeling with BPMN 3
Session 15: BP Management & Reengineering 3
Session 16: Lab- BP Management & Reengineering 3
Intended Learning ObjectivesModule 1 (Conceptual Date Modeling)
A: Knowledge and Understanding
11a1: Demonstrate knowledge of conceptual modeling notations and concepts
11a2: Demonstrate knowledge of Object Role Modeling (ORM) methodology.
11a3: Explain and demonstrate the concepts of data integrity & business rules
B: Intellectual Skills
11b1: Analyze application and domain requirements at the conceptual level,
and formalize it using ORM.
11b2: Analyze entity identity at the application and domain levels.
11b4: Optimize, transform, and (re)engineer conceptual models.
11b5: Detect &resolve contradictions & implications at the conceptual level.
C: Professional and Practical Skills
11c1: Using ORM modeling tools (Conceptual Modeling Tools).
Module 2 (Business Process Modeling)
A: Knowledge and Understanding
12a1: Demonstrate knowledge of business process modeling notations and concepts.
12a2: Demonstrate knowledge of business process modeling and mapping.12a3: Demonstrate understand of business process optimization and re-engineering.
B: Intellectual Skills
12b1: Identify business processes.
12b2: Model and map business processes.
12b3: Optimize and re-engineer business processes.
C: Professional and Practical Skills
12c1: Using business process modeling tools, such as MS Visio.
5PalGov © 2011
Session ILOs
After completing this session students will be able to:
11a3: Explain and demonstrate the concepts of data integrity and
business rules.
11b1: Analyze application and domain requirements at the
conceptual level, and formalize it using ORM.
11b2: Analyze entity identity at the application and domain levels.
6PalGov © 2011
Conceptual Schema Design Steps
1. From examples to elementary facts
2. Draw fact types and apply population check
3. Combine entity types
4. Add uniqueness constraints
5. Add mandatory constraints
6. Add subtype relations and other constraints
7. Final checks, & schema engineering issues
7PalGov © 2011
Outline
• Quick Math background
• Value Constraints
• Set Constrains
o Subset
o Equality
o Exclusion
• Subtype relations
• Frequency constraints
8PalGov © 2011
Mathematical Background
Hypothetical Euler diagrams for set comparisons.
9PalGov © 2011
Mathematical Background
Venn diagrams for three set-forming operations.
10PalGov © 2011
Mathematical Background
Venn diagrams for (a) A is a proper subset of B and (b) four sets.
11PalGov © 2011
Outline
• Quick Math background
• Value Constraints
• Set Constrains
o Subset
o Equality
o Exclusion
• Subtype relations
• Frequency constraints
12PalGov © 2011
Value Constraint
Called Value Constraint
A set of values, from
which the value of
the MedalKind is
limited to
13PalGov © 2011
Value Constraint
The value of sex should be one of {„M‟, „F‟}
14PalGov © 2011
Value Constraint
Value constraints may list the possible values of a value type.
Who can give more examples?
15PalGov © 2011
Outline
• Quick Math background
• Value Constraints
• Set Constrains
o Subset
o Equality
o Exclusion
• Subtype relations
• Frequency constraints
16PalGov © 2011
Role subset/equality constraint
Subset constraint:
Every Member booked an Hour
should play sport.
Equality constraint:
Every Member „has‟ ReactionTime
should „has‟ HeartRate, and every
Member „has‟ HeartRate should
„has‟ ReactionTime.
17PalGov © 2011
Role subset constraint
Notice that this subset constraint is
implied, and should be removed.
That is, there is no need to say that every A
playing r2 must also play r1 (subset), because the
mandatory constraint here means that every A
must play r1 (the Mandatory implies the subset).
18PalGov © 2011
Role equality constraint
Also this quality constraint is implied,
and should be removed.
19PalGov © 2011
Implication
Who can explain the difference?
The two constraints in the first model say: each A must play r1 or r2 (or
both), and that if A plays r2 then it must play r1. This means that r1 must
be always played (which is the second model)
20PalGov © 2011
Role Exclusion Constraint
Exclusion constraint:
Every Employee is allocated a
ParkingSpace should not claim
MoneyAmt.
21PalGov © 2011
Role Exclusion Constraint
22PalGov © 2011
Role Exclusion Constraint
Each partner must be either a husband
or wife (but not both at the same time).
Called “Exclusive-or”
23PalGov © 2011
Exclusive-or (another example)
Each Account must be
OwnedBy a Person or a
Company, but not both.
24PalGov © 2011
Role Exclusion Constraint
Each person has at most one of three vices. i.e., from 0 to 3 vices.
It can be written also as
25PalGov © 2011
Pair Exclusion Constraint
How can we restrict that a
person can drive a car only if
he owns that car.
26PalGov © 2011
Pair-subset constraint
An example of a tuple-subset constraint between sequences of three roles.
27PalGov © 2011
Equality Constraint
28PalGov © 2011
Pair Exclusion Constraint
Can the same person „own‟ and „wants to buy‟ the same car?
29PalGov © 2011
What is Wrong?
Implies
ImpliesImplies
30PalGov © 2011
Outline
• Quick Math background
• Value Constraints
• Set Constrains
o Subset
o Equality
o Exclusion
• Subtype relations
• Frequency constraints
31PalGov © 2011
Subtypes
Person
Male Female
• Generalization/Specialization hierarchy.
• A subtype inherits the properties of its supertype.
32PalGov © 2011
Subtypes
Person
Australian Female
Female
Australian
*
* The indirect subtype connection is implied, so it should be omitted
33PalGov © 2011
Subtypes
34PalGov © 2011
Subtypes
Person
Male Female
There is no person that
can be Male and Female
at the same time.
Person
Male Female
Every person must be a
Male or a female.Every person must be
either a Male or a Female
Person
Male Female
35PalGov © 2011
Subtypes
What is
Inherited?
36PalGov © 2011
What is Wrong?
37PalGov © 2011
Outline
• Quick Math background
• Value Constraints
• Set Constrains
o Subset
o Equality
o Exclusion
• Subtype relations
• Frequency constraints also called “Occurrence constraints”
38PalGov © 2011
Frequency constraints
To indicate that each entry in a fact column must occur there exactly ntimes, the number n is written beside the role.
Each city in the first
column must occur
three times.each drive kind in the
Second column must
appear there twice
A compound transaction is needed to initially populate this fact type
requiring at least six facts to be added.
39PalGov © 2011
Frequency constraints
Each member of pop(r) occurs there exactly n times.
n must be a positive integer.
A r
n
A r
1
A r
If n = 1, this is equivalent to a uniqueness constraint
40PalGov © 2011
Compound Frequency Constraint
The values of (Year and City) must occur exactly three times
41PalGov © 2011
Ranged Frequency Constraint
Examples of minimum and maximum frequency constraints.
Each name of panel must occur at least 4
and at most 7 times. That is, each panel
must include 4 to 7 experts
Each expert can referee 5 papers
Each paper can be refereed by at least two experts.
42PalGov © 2011
Discussion
Summarize what you learned? And what you think about it?
Compare what you learned with EER and UML?
Questions & Suggestions?
43PalGov © 2011
References
1. Information Modeling and Relational Databases: From Conceptual Analysis to Logical Design, Terry Halpin (ISBN 1-55860-672-6) – Chapter 6.