pal gov.tutorial1.session3 1.uniquenessrules
DESCRIPTION
TRANSCRIPT
![Page 1: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/1.jpg)
1PalGov © 2011
أكاديمية الحكومة اإللكترونية الفلسطينية
The Palestinian eGovernment Academy
www.egovacademy.ps
Session 3.1
Uniqueness Rules
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
![Page 2: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/2.jpg)
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]
![Page 3: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/3.jpg)
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.
![Page 4: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/4.jpg)
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.
![Page 5: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/5.jpg)
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.
![Page 6: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/6.jpg)
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 set, subtype, & frequency constraints
7. Final checks, & schema engineering issues
![Page 7: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/7.jpg)
7PalGov © 2011
Uniqueness Constraint
For each state taken individually, each person has at most one weight.
How can we record such information without redundancy?
![Page 8: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/8.jpg)
8PalGov © 2011
Uniqueness on Unary Fact Types
Is their any problem with this schema?
How can we prevent people from adding such redundant information?
![Page 9: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/9.jpg)
9PalGov © 2011
Uniqueness on Unary Fact Types
The uniqueness constraint
ensures entities are
unique (no duplicates)
![Page 10: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/10.jpg)
10PalGov © 2011
Uniqueness on Binary Fact Types
Each Politician was born
in at most one Country
Each Country has at
most one head Politician
Each Politician heads
government of at most
one Country
![Page 11: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/11.jpg)
11PalGov © 2011
Uniqueness on Binary Fact Types
Who can give more examples?
Means many to many
It is possible that the same Politician visited more than one Country
and that the same Country was visited by more than one Politician
![Page 12: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/12.jpg)
12PalGov © 2011
Uniqueness on Binary Fact Types
What is unique here?
![Page 13: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/13.jpg)
13PalGov © 2011
Uniqueness on Binary Fact Types
What is unique here?
![Page 14: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/14.jpg)
14PalGov © 2011
Uniqueness on Binary Fact Types
No duplicates are allowed in a's column
Each a R's at most one b
No duplicates are allowed in b's column
Each b is R'd by at most one a
Both the foregoing constraints apply
No duplicate (a,b) rows are allowed
Each a may R many bs and vice versa
The four uniqueness constraint patterns for a binary fact type:
![Page 15: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/15.jpg)
15PalGov © 2011
How to think about Uniqueness
Is the population significant?
Adding counterexamples
to test the constraints
![Page 16: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/16.jpg)
16PalGov © 2011
Uniqueness on Binary Fact Types
Which is more realistic?
![Page 17: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/17.jpg)
17PalGov © 2011
Uniqueness on Ternary Fact Types
What are the uniqueness constraints?
Each (Person, Subject) combination is unique.
![Page 18: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/18.jpg)
18PalGov © 2011
Uniqueness on Ternary Fact Types
Allowed basic uniqueness constraints for a ternary fact type:
![Page 19: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/19.jpg)
19PalGov © 2011
Uniqueness on Ternary Fact Types
What does this uniqueness mean?
![Page 20: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/20.jpg)
20PalGov © 2011
Uniqueness on Ternary Fact Types
Allowed uniqueness constraint combinations for a ternary fact type:
![Page 21: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/21.jpg)
21PalGov © 2011
Uniqueness on Ternary Fact Types
Which of these constraint patterns is illegal? Why?
![Page 22: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/22.jpg)
22PalGov © 2011
Example of Uniqueness on n-ary fact types
Each (a,c,d) combination occurs in at most one row.
![Page 23: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/23.jpg)
23PalGov © 2011
Uniqueness with Nested Fact Types
Explain what is unique
This constraint is particularly
important! Why?
![Page 24: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/24.jpg)
24PalGov © 2011
What is the difference between these?
Explain the joins
Do we need uniqueness?
![Page 25: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/25.jpg)
25PalGov © 2011
External Uniqueness constraints
What is missing?
u
![Page 26: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/26.jpg)
26PalGov © 2011
External Uniqueness constraints
The meaning of the External Uniqueness
Each (b,c) combination is paired with at most one a
Each population R join S has bc unique
(where “join” denotes “conceptual inner join”)
![Page 27: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/27.jpg)
27PalGov © 2011
Example with nest fact types
![Page 28: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/28.jpg)
28PalGov © 2011
Key Length Check
What is wrong?
Splits into
Each UC in an elementary n-ary relationship must
span at least n-1 roles
![Page 29: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/29.jpg)
29PalGov © 2011
Key Length Check
Splits into
What is wrong?
![Page 30: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/30.jpg)
30PalGov © 2011
Discussion
Summarize what you learnt until now?
Problems of uniqueness in your daily life?
Compare the uniqueness constraint in ORM
with the cardinality constraints in UML and EER?
![Page 31: Pal gov.tutorial1.session3 1.uniquenessrules](https://reader033.vdocuments.net/reader033/viewer/2022051610/5487b04ab4af9f640d8b5457/html5/thumbnails/31.jpg)
31PalGov © 2011
References
1. Information Modeling and Relational Databases: From Conceptual Analysis to Logical Design, Terry Halpin (ISBN 1-55860-672-6) – Chapter 4.