SlideShare a Scribd company logo
‫أكاديمية الحكومة اإللكترونية الفلسطينية‬
         The Palestinian eGovernment Academy
                          www.egovacademy.ps



 Tutorial 1: Data and Business Process Modeling

                         Session 7.1
Schema Equivalence and Optimization

                  Prof. Mustafa Jarrar
                Sina Institute, University of Birzeit
                        mjarrar@birzeit.edu
                           www.jarrar.info


                           Reviewed by
            Prof. Marco Ronchetti, Trento University, Italy
                            PalGov © 2011                         1
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
Project Consortium:

             Birzeit University, Palestine
                                                           University of Trento, Italy
             (Coordinator )


             Palestine Polytechnic University, Palestine   Vrije Universiteit Brussel, Belgium


             Palestine Technical University, Palestine
                                                           Université de Savoie, France

             Ministry of Telecom and IT, Palestine
                                                           University of Namur, Belgium
             Ministry of Interior, Palestine
                                                           TrueTrust, UK
             Ministry of Local Government, Palestine


Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011
                                                                                                 2
© Copyright Notes
Everyone is encouraged to use this material, or part of it, but should properly
cite the project (logo and website), and the author of that part.


No part of this tutorial may be reproduced or modified in any form or by any
means, without prior written permission from the project, who have the full
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.

                                    PalGov © 2011                                 3
Tutorial Map


                       Intended Learning Objectives
                                                                                                                      Topic                       Time
Module 1 (Conceptual Date Modeling)
                                                                                               Module I: Conceptual Data Modeling
A: Knowledge and Understanding
11a1: Demonstrate knowledge of conceptual modeling notations and concepts                       Session 0: Outline and Introduction
11a2: Demonstrate knowledge of Object Role Modeling (ORM) methodology.                          Session 1.1: Information Modeling                 1
11a3: Explain and demonstrate the concepts of data integrity & business rules                   Session 1.2: Conceptual Data Modeling using ORM   1
B: Intellectual Skills                                                                          Session 1.3: Conceptual Analyses                  1
11b1: Analyze application and domain requirements at the conceptual level,                      Session 2: Lab- Conceptual Analyses               3
and formalize it using ORM.                                                                     Session 3.1: Uniqueness Rules                     1.5
11b2: Analyze entity identity at the application and domain levels.                             Session 3.2: Mandatory Rules                      1.5
11b4: Optimize, transform, and (re)engineer conceptual models.                                  Session 4: Lab- Uniqueness & Mandatory Rules      3
11b5: Detect &resolve contradictions & implications at the conceptual level.                    Session 5: Subtypes and Other Rules               3
C: Professional and Practical Skills                                                            Session 6: Lab- Subtypes and Other Rules          3
11c1: Using ORM modeling tools (Conceptual Modeling Tools).                                     Session 7.1: Schema Equivalence &Optimization     1.5
Module 2 (Business Process Modeling)                                                            Session 7.2: Rules Check &Schema Engineering      1.5
A: Knowledge and Understanding                                                                  Session 8: Lab- National Student Registry         3
12a1: Demonstrate knowledge of business process modeling notations and concepts.
                                                                                               Module II: Business Process Modeling
12a2: Demonstrate knowledge of business process modeling and mapping.
12a3: Demonstrate understand of business process optimization and re-engineering.               Session 9: BP Management and BPMN: An Overview    3
B: Intellectual Skills                                                                          Session 10: Lab - BP Management                   3
12b1: Identify business processes.                                                              Session 11: BPMN Fundamentals                     3
12b2: Model and map business processes.                                                         Session 12: Lab - BPMN Fundamentals               3
12b3: Optimize and re-engineer business processes.                                              Session 13: Modeling with BPMN                    3
C: Professional and Practical Skills                                                            Session 14: Lab- Modeling with BPMN               3
12c1: Using business process modeling tools, such as MS Visio.                                  Session 15: BP Management & Reengineering         3
                                                                                                Session 16: Lab- BP Management & Reengineering    3

                                                                               PalGov © 2011                                                             4
Session ILOs

After completing this session students will be able to:

   11a3: Explain and demonstrate the concepts of data integrity and
   business rules.


   11b5: Detect and resolve contradictions and implications at the
   conceptual level.


   11b4: Optimize, transform, and (re)engineer conceptual models.




                               PalGov © 2011                          5
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
                   PalGov © 2011                6
Schema Equivalence and Optimization


• It is not surprising that people often come up with different ways (i.e.,
  deferent conceptual models) of describing the same reality.

• Two conceptual schemas are equivalent if and only if whatever UoD
  state or transition can be modeled in one can also be modeled in the
  other.

• What is the difference between these two schemes:




   The act of reshaping two equivalent schemes like this is said to
    be a conceptual schema transformation.
                             PalGov © 2011                                7
Schema Equivalence and Optimization

• Skills of schema transformations helps us to see what different
  design choices are possible.

• Moreover, if two independently developed schemas are to be either
  fully or partly integrated, we often need to resolve the differences in
  the ways that each schema models common UoD features.

• To do this, we need to know whether one representation can be
  transformed into the other, and if so, how.
• Another use of conceptual schema transformations is to reshape the
  original conceptual schema into one that maps directly to a more
  efficient implementation, or to more conceptually elegant schema.

• This process is known as conceptual schema optimization.

There are two class of schema transformations:
     Predicate Specialization, and Predicate Generalization
                             PalGov © 2011                                  8
Predicate Specialization and Generalization

   If two or more predicates may be thought of as special cases of a more
   general predicate, then we may replace them by the more general
   predicate, so long as the original distinction can be preserved in some way.




We generalize smoking and drinking into indulging in a vice, where vice has
two specific cases. If we transform in the opposite direction, we specialize
indulging in a vice into two predicates, one for each case.




                                  PalGov © 2011                                9
Predicate Specialization and Generalization

If two or more predicates may be thought of as special cases of a more
general predicate, then we may replace them by the more general
predicate, so long as the original distinction can be preserved in some way.


                                                         ?

Because there are exactly three kinds of medals, the ternary may be
specialized into three binaries, one for each medal kind,


                                                 Where m1, and each Si corresponds
                                                 to R where B = bi



  Theory: R may be specialized into S1..Sn by absorbing B.
                                 PalGov © 2011                                    10
Predicate Specialization and Generalization

The previous theorem always holds, but any constraint added to one of the
schemas must be translated into an equivalent, additional constraint on the
other schema.



                                                            Each Si corresponds to
                                                            R where B = bi




   The UC on the left is equivalent to the UCs on the right.


   If a UC in R spans a combination of B’s role and other roles, a UC
    spans the specialization of these other roles in S1,..,Sn, and conversely.


                                 PalGov © 2011                                   11
Predicate Specialization and Generalization


                                          ?
   The UC on the left is equivalent to the exclusion constraint on the right.


                                                ?
   The UC on the left is equivalent to the exclusion constraint on the right.

                                                              Where m1, and each
                                                              Si corresponds to R
                                                              where B = bi

   The UC on the left is equivalent to the exclusion constraint on the right.
If a UC spans all roles of R except for B’s role, then S1 .. Sn are mutually
exclusive, and conversely.
                                PalGov © 2011                                   12
Predicate Specialization and Generalization




                                                         ?

if any medal results are recorded for a country, all three medal results (gold, silver,
and bronze) are required. To express, we add an equality constraint between the
medal winning roles played by Country.


 If R is a ternary with a UC spanning just B’s role and one other role, then
  adding a frequency constraint of n to this other role is equivalent to adding an
  equality constraint over the specialized versions of that role.



                                       PalGov © 2011                                      13
Predicate Specialization and Generalization

  The impact of adding mandatory role and frequency constraints.



                                                         ?

                                                                      Each S corresponds
                                                                      to R where B = bi




 If A’s role (or role disjunction) in R is mandatory, then the disjunction of its
  specialized roles is mandatory, and conversely (1 i  m).
 If R is a ternary with a UC spanning just B’s role and one other role, then adding a
  mandatory role constraint and frequency constraint of n (the number of possible
  values for B) to this other role is equivalent to making each specialized version of that
  role mandatory.                     PalGov © 2011                                     14
Other Cases and Examples



                                               ?

Each car in the rally has two drivers (a main driver and a backup
driver), and each person drives exactly one car.


The drives predicate is specialized by absorbing Status.




                              PalGov © 2011                         15
Other Cases and Examples

                                                                      Each Si corresponds
                                                                      to R where T is
                                                                      restricted to B = bi




    Theory: R may be specialized into S1..Sn by absorbing B.

 Corollary 1: If s roles are mandatory in the left-hand schema, the disjunction of s
  roles in the right-hand schema is mandatory, and conversely.
 Corollary 2: If an external UC spans the roles of and in the left-hand schema, then a
  UC applies to each of s roles in the right-hand schema, and conversely.
 Corollary 3: If s role in the left-hand schema is mandatory, then each of s roles in
  the right-hand schema is mandatory, and conversely.
 Corollary 4: An equality constraint over s roles in the RHS is equivalent to a
  frequency constraint of on s role in the left-hand schema; this constraint is
  strengthened to if a UC exists on each of s roles in the right-hand schema.
                                       PalGov © 2011                                     16
Other Cases and Examples

                 Can the predicate be specialized?



                                ?               ?




• Transforming from the original schema to one of those strengthens the
  schema by adding information.
• Transforming in the opposite direction weakens the schema by losing
  information.
 Any such transformations that add or lose information should be the result
  of conscious decisions that are acceptable to the client (for which the
  business domain is being modeled).
                                PalGov © 2011                             17
Other Cases and Examples



                                                                  Each Si corresponds to
                                                                  one instance of R




     Theory: The left-hand schema implies the right-hand schema.


Corollary 1:If an equality constraint applies over s roles in the left-hand schema, then
the frequency constraint in the right-hand schema is strengthened to , and conversely.

Corollary 2: Adding a UC to role in the right-hand schema is equivalent in the left-
hand schema to adding UCs to s roles (making the S 1:1) and strengthening the
exclusion constraint to an exclusion constraint over s roles.
                                       PalGov © 2011                                       18
References

1. Information Modeling and Relational Databases: From
   Conceptual Analysis to Logical Design, Terry Halpin (ISBN 1-
   55860-672-6) – Chapter 12.




                               PalGov © 2011                      19

More Related Content

PDF
Pal gov.tutorial1.session3 2.mandatoryrules
PDF
Pal gov.tutorial1.session5.subtyperelationsandotherconstraints
PDF
Pal gov.tutorial1.session1 3.conceptualschemadesignsteps
PDF
Pal gov.tutorial1.session3 1.uniquenessrules
PDF
Pal gov.tutorial1.session7 2.finalcheckandschemaengineeringissues
PDF
Pal gov.tutorial1.session1 1.informationmodeling
PDF
Pal gov.tutorial1.session1 2.conceptualdatamodelingusingorm
PDF
Pal gov.tutorial1.session13 14
Pal gov.tutorial1.session3 2.mandatoryrules
Pal gov.tutorial1.session5.subtyperelationsandotherconstraints
Pal gov.tutorial1.session1 3.conceptualschemadesignsteps
Pal gov.tutorial1.session3 1.uniquenessrules
Pal gov.tutorial1.session7 2.finalcheckandschemaengineeringissues
Pal gov.tutorial1.session1 1.informationmodeling
Pal gov.tutorial1.session1 2.conceptualdatamodelingusingorm
Pal gov.tutorial1.session13 14

Similar to Pal gov.tutorial1.session7 1.schema equivalence and optimization (20)

PDF
Pal gov.tutorial1.session9 10.bpmn-overview (mahmoud saheb's conflicted copy ...
PDF
Business Process Modeling Notation Fundamentals
PDF
Pal gov.tutorial1.session15 16
PDF
Pal gov.tutorial1.session8.national student registry
PDF
Pal gov.tutorial2.session16.lab rd-fa
PDF
Pal gov.tutorial2.session13 1.data schema integration
PDF
Pal gov.tutorial2.session13 2.gav and lav integration
PDF
Pal gov.tutorial2.session0.outline
PDF
Pal gov.tutorial2.session12 1.the problem of data integration
PDF
Pal gov.tutorial2.session15 1.linkeddata
PDF
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
PDF
Pal gov.tutorial1.session2.lab conceptual analyses
PDF
Pal gov.tutorial2.session5 2.rdfs_jarrar
PDF
Pal gov.tutorial2.session9.lab rdf-stores
PDF
Pal gov.tutorial2.session14.lab rdf-dataintegration
PDF
Pal gov.tutorial2.session4.lab xml document and schemas
PDF
Pal gov.tutorial2.session1.xml basics and namespaces
PDF
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
PDF
Pal gov.tutorial2.session10.sparql
PDF
Pal gov.tutorial2.session8.lab owl
Pal gov.tutorial1.session9 10.bpmn-overview (mahmoud saheb's conflicted copy ...
Business Process Modeling Notation Fundamentals
Pal gov.tutorial1.session15 16
Pal gov.tutorial1.session8.national student registry
Pal gov.tutorial2.session16.lab rd-fa
Pal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 2.gav and lav integration
Pal gov.tutorial2.session0.outline
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial1.session2.lab conceptual analyses
Pal gov.tutorial2.session5 2.rdfs_jarrar
Pal gov.tutorial2.session9.lab rdf-stores
Pal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session1.xml basics and namespaces
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session10.sparql
Pal gov.tutorial2.session8.lab owl
Ad

More from Mustafa Jarrar (20)

PPTX
Clustering Arabic Tweets for Sentiment Analysis
PPTX
Classifying Processes and Basic Formal Ontology
PPTX
Discrete Mathematics Course Outline
PPTX
Business Process Implementation
PPTX
Business Process Design and Re-engineering
PPTX
BPMN 2.0 Analytical Constructs
PPTX
BPMN 2.0 Descriptive Constructs
PPTX
Introduction to Business Process Management
PDF
Customer Complaint Ontology
PPTX
Subset, Equality, and Exclusion Rules
PPTX
Schema Modularization in ORM
PPTX
On Computer Science Trends and Priorities in Palestine
PPTX
Lessons from Class Recording & Publishing of Eight Online Courses
PPTX
Presentation curras paper-emnlp2014-final
PPTX
Jarrar: Future Internet in Horizon 2020 Calls
PPT
Habash: Arabic Natural Language Processing
PDF
Adnan: Introduction to Natural Language Processing
PPTX
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
PPTX
Bouquet: SIERA Workshop on The Pillars of Horizon2020
PPTX
Jarrar: Sparql Project
Clustering Arabic Tweets for Sentiment Analysis
Classifying Processes and Basic Formal Ontology
Discrete Mathematics Course Outline
Business Process Implementation
Business Process Design and Re-engineering
BPMN 2.0 Analytical Constructs
BPMN 2.0 Descriptive Constructs
Introduction to Business Process Management
Customer Complaint Ontology
Subset, Equality, and Exclusion Rules
Schema Modularization in ORM
On Computer Science Trends and Priorities in Palestine
Lessons from Class Recording & Publishing of Eight Online Courses
Presentation curras paper-emnlp2014-final
Jarrar: Future Internet in Horizon 2020 Calls
Habash: Arabic Natural Language Processing
Adnan: Introduction to Natural Language Processing
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Jarrar: Sparql Project
Ad

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Lesson notes of climatology university.
PDF
Classroom Observation Tools for Teachers
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Pharma ospi slides which help in ospi learning
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Insiders guide to clinical Medicine.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Institutional Correction lecture only . . .
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
Cell Types and Its function , kingdom of life
Microbial disease of the cardiovascular and lymphatic systems
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Lesson notes of climatology university.
Classroom Observation Tools for Teachers
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pharma ospi slides which help in ospi learning
Complications of Minimal Access Surgery at WLH
Final Presentation General Medicine 03-08-2024.pptx
Anesthesia in Laparoscopic Surgery in India
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Supply Chain Operations Speaking Notes -ICLT Program
Insiders guide to clinical Medicine.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

Pal gov.tutorial1.session7 1.schema equivalence and optimization

  • 1. ‫أكاديمية الحكومة اإللكترونية الفلسطينية‬ The Palestinian eGovernment Academy www.egovacademy.ps Tutorial 1: Data and Business Process Modeling Session 7.1 Schema Equivalence and Optimization Prof. Mustafa Jarrar Sina Institute, University of Birzeit mjarrar@birzeit.edu www.jarrar.info Reviewed by Prof. Marco Ronchetti, Trento University, Italy PalGov © 2011 1
  • 2. 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 Project Consortium: Birzeit University, Palestine University of Trento, Italy (Coordinator ) Palestine Polytechnic University, Palestine Vrije Universiteit Brussel, Belgium Palestine Technical University, Palestine Université de Savoie, France Ministry of Telecom and IT, Palestine University of Namur, Belgium Ministry of Interior, Palestine TrueTrust, UK Ministry of Local Government, Palestine Coordinator: Dr. Mustafa Jarrar Birzeit University, P.O.Box 14- Birzeit, Palestine Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011 2
  • 3. © Copyright Notes Everyone is encouraged to use this material, or part of it, but should properly cite the project (logo and website), and the author of that part. No part of this tutorial may be reproduced or modified in any form or by any means, without prior written permission from the project, who have the full 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. PalGov © 2011 3
  • 4. Tutorial Map Intended Learning Objectives Topic Time Module 1 (Conceptual Date Modeling) Module I: Conceptual Data Modeling A: Knowledge and Understanding 11a1: Demonstrate knowledge of conceptual modeling notations and concepts Session 0: Outline and Introduction 11a2: Demonstrate knowledge of Object Role Modeling (ORM) methodology. Session 1.1: Information Modeling 1 11a3: Explain and demonstrate the concepts of data integrity & business rules Session 1.2: Conceptual Data Modeling using ORM 1 B: Intellectual Skills Session 1.3: Conceptual Analyses 1 11b1: Analyze application and domain requirements at the conceptual level, Session 2: Lab- Conceptual Analyses 3 and formalize it using ORM. Session 3.1: Uniqueness Rules 1.5 11b2: Analyze entity identity at the application and domain levels. Session 3.2: Mandatory Rules 1.5 11b4: Optimize, transform, and (re)engineer conceptual models. Session 4: Lab- Uniqueness & Mandatory Rules 3 11b5: Detect &resolve contradictions & implications at the conceptual level. Session 5: Subtypes and Other Rules 3 C: Professional and Practical Skills Session 6: Lab- Subtypes and Other Rules 3 11c1: Using ORM modeling tools (Conceptual Modeling Tools). Session 7.1: Schema Equivalence &Optimization 1.5 Module 2 (Business Process Modeling) Session 7.2: Rules Check &Schema Engineering 1.5 A: Knowledge and Understanding Session 8: Lab- National Student Registry 3 12a1: Demonstrate knowledge of business process modeling notations and concepts. Module II: Business Process Modeling 12a2: Demonstrate knowledge of business process modeling and mapping. 12a3: Demonstrate understand of business process optimization and re-engineering. Session 9: BP Management and BPMN: An Overview 3 B: Intellectual Skills Session 10: Lab - BP Management 3 12b1: Identify business processes. Session 11: BPMN Fundamentals 3 12b2: Model and map business processes. Session 12: Lab - BPMN Fundamentals 3 12b3: Optimize and re-engineer business processes. Session 13: Modeling with BPMN 3 C: Professional and Practical Skills Session 14: Lab- Modeling with BPMN 3 12c1: Using business process modeling tools, such as MS Visio. Session 15: BP Management & Reengineering 3 Session 16: Lab- BP Management & Reengineering 3 PalGov © 2011 4
  • 5. Session ILOs After completing this session students will be able to: 11a3: Explain and demonstrate the concepts of data integrity and business rules. 11b5: Detect and resolve contradictions and implications at the conceptual level. 11b4: Optimize, transform, and (re)engineer conceptual models. PalGov © 2011 5
  • 6. 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 PalGov © 2011 6
  • 7. Schema Equivalence and Optimization • It is not surprising that people often come up with different ways (i.e., deferent conceptual models) of describing the same reality. • Two conceptual schemas are equivalent if and only if whatever UoD state or transition can be modeled in one can also be modeled in the other. • What is the difference between these two schemes:  The act of reshaping two equivalent schemes like this is said to be a conceptual schema transformation. PalGov © 2011 7
  • 8. Schema Equivalence and Optimization • Skills of schema transformations helps us to see what different design choices are possible. • Moreover, if two independently developed schemas are to be either fully or partly integrated, we often need to resolve the differences in the ways that each schema models common UoD features. • To do this, we need to know whether one representation can be transformed into the other, and if so, how. • Another use of conceptual schema transformations is to reshape the original conceptual schema into one that maps directly to a more efficient implementation, or to more conceptually elegant schema. • This process is known as conceptual schema optimization. There are two class of schema transformations: Predicate Specialization, and Predicate Generalization PalGov © 2011 8
  • 9. Predicate Specialization and Generalization If two or more predicates may be thought of as special cases of a more general predicate, then we may replace them by the more general predicate, so long as the original distinction can be preserved in some way. We generalize smoking and drinking into indulging in a vice, where vice has two specific cases. If we transform in the opposite direction, we specialize indulging in a vice into two predicates, one for each case. PalGov © 2011 9
  • 10. Predicate Specialization and Generalization If two or more predicates may be thought of as special cases of a more general predicate, then we may replace them by the more general predicate, so long as the original distinction can be preserved in some way. ? Because there are exactly three kinds of medals, the ternary may be specialized into three binaries, one for each medal kind, Where m1, and each Si corresponds to R where B = bi Theory: R may be specialized into S1..Sn by absorbing B. PalGov © 2011 10
  • 11. Predicate Specialization and Generalization The previous theorem always holds, but any constraint added to one of the schemas must be translated into an equivalent, additional constraint on the other schema. Each Si corresponds to R where B = bi The UC on the left is equivalent to the UCs on the right.  If a UC in R spans a combination of B’s role and other roles, a UC spans the specialization of these other roles in S1,..,Sn, and conversely. PalGov © 2011 11
  • 12. Predicate Specialization and Generalization ? The UC on the left is equivalent to the exclusion constraint on the right. ? The UC on the left is equivalent to the exclusion constraint on the right. Where m1, and each Si corresponds to R where B = bi The UC on the left is equivalent to the exclusion constraint on the right. If a UC spans all roles of R except for B’s role, then S1 .. Sn are mutually exclusive, and conversely. PalGov © 2011 12
  • 13. Predicate Specialization and Generalization ? if any medal results are recorded for a country, all three medal results (gold, silver, and bronze) are required. To express, we add an equality constraint between the medal winning roles played by Country.  If R is a ternary with a UC spanning just B’s role and one other role, then adding a frequency constraint of n to this other role is equivalent to adding an equality constraint over the specialized versions of that role. PalGov © 2011 13
  • 14. Predicate Specialization and Generalization The impact of adding mandatory role and frequency constraints. ? Each S corresponds to R where B = bi  If A’s role (or role disjunction) in R is mandatory, then the disjunction of its specialized roles is mandatory, and conversely (1 i  m).  If R is a ternary with a UC spanning just B’s role and one other role, then adding a mandatory role constraint and frequency constraint of n (the number of possible values for B) to this other role is equivalent to making each specialized version of that role mandatory. PalGov © 2011 14
  • 15. Other Cases and Examples ? Each car in the rally has two drivers (a main driver and a backup driver), and each person drives exactly one car. The drives predicate is specialized by absorbing Status. PalGov © 2011 15
  • 16. Other Cases and Examples Each Si corresponds to R where T is restricted to B = bi Theory: R may be specialized into S1..Sn by absorbing B.  Corollary 1: If s roles are mandatory in the left-hand schema, the disjunction of s roles in the right-hand schema is mandatory, and conversely.  Corollary 2: If an external UC spans the roles of and in the left-hand schema, then a UC applies to each of s roles in the right-hand schema, and conversely.  Corollary 3: If s role in the left-hand schema is mandatory, then each of s roles in the right-hand schema is mandatory, and conversely.  Corollary 4: An equality constraint over s roles in the RHS is equivalent to a frequency constraint of on s role in the left-hand schema; this constraint is strengthened to if a UC exists on each of s roles in the right-hand schema. PalGov © 2011 16
  • 17. Other Cases and Examples Can the predicate be specialized? ? ? • Transforming from the original schema to one of those strengthens the schema by adding information. • Transforming in the opposite direction weakens the schema by losing information.  Any such transformations that add or lose information should be the result of conscious decisions that are acceptable to the client (for which the business domain is being modeled). PalGov © 2011 17
  • 18. Other Cases and Examples Each Si corresponds to one instance of R Theory: The left-hand schema implies the right-hand schema. Corollary 1:If an equality constraint applies over s roles in the left-hand schema, then the frequency constraint in the right-hand schema is strengthened to , and conversely. Corollary 2: Adding a UC to role in the right-hand schema is equivalent in the left- hand schema to adding UCs to s roles (making the S 1:1) and strengthening the exclusion constraint to an exclusion constraint over s roles. PalGov © 2011 18
  • 19. References 1. Information Modeling and Relational Databases: From Conceptual Analysis to Logical Design, Terry Halpin (ISBN 1- 55860-672-6) – Chapter 12. PalGov © 2011 19