26
1 Jarrar © 2018 Conceptual Analyses Conceptual Schema Design Steps (Chapter 3) Mustafa Jarrar: Lecture Notes on Conceptual Analyses and Design Steps. University of Birzeit, Palestine, 2018 Version 4 Mustafa Jarrar Birzeit University [email protected] www.jarrar.info

Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

1Jarrar © 2018

Conceptual AnalysesConceptual Schema Design Steps

(Chapter 3)

Mustafa Jarrar: Lecture Notes on Conceptual Analyses and Design Steps.University of Birzeit, Palestine, 2018

Version 4

Mustafa JarrarBirzeit [email protected]

Page 2: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

2Jarrar © 2018

Some diagrams in this lecture are based on [1]

Watch this lecture and download the slides

Online Courses : http://www.jarrar.info/courses/

Course Page: http://www.jarrar.info/courses/ORM/Jarrar.LectureNotes.ConceptualAnalyses.pdf

Page 3: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

3Jarrar © 2018

§ Part 1: Conceptual Analyses Steps

§ Part 2: Basic ORM Constructs and Syntax

§ Part 3: Use case (ID Card)

§ Part 4: Use case (University Programs)

Conceptual AnalysesConceptual Schema Design Steps

Mustafa Jarrar: Lecture Notes on Conceptual Analyses and design Steps.University of Birzeit, Palestine, 2018

Page 4: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

4Jarrar © 2018

Conceptual Analyses

Given an application domain, e.g. hospital, and three information modelers, what steps do you suggest them to start with, to build the hospital’s conceptual model?

There is no strict or perfect modeling process or procedure!

You may start with any step you think suitable, taking into account the complexity of the domain, available resources, modelers’ prior knowledge about the domain, etc.

It is recommended that you modularize the domain into sub-domains, build a conceptual schema for each sub-domain , then integrate all sub-schemes into one conceptual schema.

The following procedure (7 steps) is to help you model a sub-domain, but you don’t have to strictly follow these steps.

Page 5: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

5Jarrar © 2018

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 6: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

6Jarrar © 2018

Elementary Facts and Fact Types

– Person smokes.– Person drives car.– Person was born in a city.– Person smokes and drives car.– If a Person was born in a city and this City is part of a

country, then this person was born in that country.

What is a fact type?

What is a fact?– Rami smokes.– Rami drives car.– Rabab was born in Ramallah.– Rami smokes and drives car.– If Rabab was born in Ramallah and Ramallah is part of

Palestine, then Rabab was born in Palestine.

è A fact must be either true or false

Page 7: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

7Jarrar © 2018

Elementary Facts and Fact Types

– Person smokes.– Person drives car.– Person was born in a city.– Person smokes and drives car.– If a Person was born in a city and this City is part of

a country, then this person was born in that country.

What is an elementary fact type?

û

üû

üü

à An elementary fact type cannot be spited.

Page 8: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

8Jarrar © 2018

1. From examples to elementary facts

Conceptual Schema Design Steps

Page 9: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

9Jarrar © 2018

1. Make elementary facts from examples

Mustafa teaches Knowledge Engineering.Rami is enrolled in Knowledge Engineering.Knowledge Engineering is offered by the University of Birzeit.

v The Person (ID4514) that has the name Mustafa teaches the course (SC242)that has the title Knowledge Engineering.

v The Person (ID123) Rami is enrolled in the course (CS242) that has the has the title Knowledge Engineering.

v The course (CS242) that has the title Knowledge Engineering is offered by the university that has the name University of Birzeit.

Ø The Person that has the name Mustafa teaches the course that has the title Knowledge Engineering.

Ø The Person Rami is enrolled in the course that has the title Knowledge Engineering.

Ø The course that has the title Knowledge Engineering is offered by the university that has the name University of Birzeit.

More precise

From examples to fact types

Page 10: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

10Jarrar © 2018

1. From examples to elementary facts

2. Draw fact types and apply population check

Conceptual Schema Design Steps

Page 11: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

11Jarrar © 2018

2. Draw fact types and apply population check

University(Name)

Person(nr)

Course(Code)

IsOf/Has

Name

TitleTeaches/

EnrolledIn/

Has/IsOf

OfferedBy /Offers

v The Person (ID4514) that has the name Mustafa teaches the course (SC242)that has the title Knowledge Engineering.

v The Person (ID123) Rami is enrolled in the course (CS242) that has the has the title Knowledge Engineering.

v The course (CS242) that has the title Knowledge Engineering is offered by the university that has the name University of Birzeit.

Draw Fact Types

Page 12: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

12Jarrar © 2018

2. Draw fact types and apply population check

Person(nr)

Course(Code)

IsOf/Has

Name

TitleTeaches/

EnrolledIn/

Has/IsOf

v The Person (ID4514) that has the name Mustafa teaches the course (SC242)that has the title Knowledge Engineering.

v The Person (ID123) Rami is enrolled in the course (CS242) that has the has the title Knowledge Engineering.

v The course (CS242) that has the title Knowledge Engineering is offered by the university that has the name University of Birzeit.

Test with population

Mustafa ID4154

Rami ID123

SC242 Knowledge Engineering

SC242 Birzeit University

ID4154 SC242

ID123 SC242

University(Name)

OfferedBy /Offers

Page 13: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

13Jarrar © 2018

§ Part 1: Conceptual Analyses Steps

§ Part 2: Basic ORM Constructs and Syntax

§ Part 3: Use case (ID Card)

§ Part 4: Use case (University Programs)

Conceptual AnalysesConceptual Schema Design Steps

Mustafa Jarrar: Lecture Notes on Conceptual Analyses and design Steps.University of Birzeit, Palestine, 2018

Page 14: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

14Jarrar © 2018

Basic ORM Constructs and Syntax

• Object and Value Types

• Roles and relations

• Unary relations

• Ternary relations

• Nested Fact Types

• Ring Fact Types

Page 15: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

15Jarrar © 2018

Object and Values Types

Person Car

Adams B 235PZN

Jones E 235PZN

Jones E 108AAQ

Person

has

PersonName

Car

RegNr

refers to

has

refers to

drives / is driven by

‘Adams B’‘Jones E’

‘235PZN’‘108AAQ’

drivesCarPerson

has has

PersonName RegNr

Value Type (lexical)It is always a value of an Object Type.

Object Type (non lexical)You cannot lexicalize, or refer to a person without using a value ofits properties.

Page 16: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

16Jarrar © 2018

Roles and Relations

Called Binary RelationIt consists of two roles

(“drives” and “is driven by”)

Called Rolewhich is part of a relation

Called Rolewhich is part of a relation

Page 17: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

17Jarrar © 2018

Unary Relations

Pat smokesLee smokesShir does not smoke

Called Unary Relationas it has one role

(“smokes”)

You can transform unary fact types into binary:

Page 18: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

18Jarrar © 2018

Ternary Relations

Called Ternary Relationas it has three roles

(“smokes”)

Page 19: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

19Jarrar © 2018

Nested Fact Types

Called Nested Fact TypeThe fact type “Student enrolled in

Subject” is objectified, i.e., the wholeFact type is seen as an Object Type

Page 20: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

20Jarrar © 2018

Ring Fact Types

Same object type is connected to two roles in the same relation

Page 21: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

21Jarrar © 2018

The ORM Syntax (Test)

An object type can be only connected with roles.Each role can be connected with only one object type.

û ü

ü

ü

üü

ü

û

û

û

ûû

Page 22: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

22Jarrar © 2018

§ Part 1: Conceptual Analyses Steps

§ Part 2: Basic ORM Constructs and Syntax

§ Part 3: Use case (ID Card)

§ Part 4: Use case (University Programs)

Conceptual AnalysesConceptual Schema Design Steps

Mustafa Jarrar: Lecture Notes on Conceptual Analyses and design Steps.University of Birzeit, Palestine, 2018

Page 23: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

23Jarrar © 2018

Use Case (ID Card)

Model the Information found in your ID Card, using ORM, for example:

Each Person has a ID Number, First Name, Father Name, Grandfather Name, BirthDate, Birth Place, Religion, Gender, and Address. A Person maybe a father/mother of one or more

persons, and wife/husband of another person. etc.

• Each student is expected to deliver (PDF and Hard copies) of his/her ORM model before (Deadline: 17/2/2015).

• Any ORM tool can be used. • Each student is expected to bring his laptop next lecture, so

to present his/her models to all students.

Page 24: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

24Jarrar © 2018

§ Part 1: Conceptual Analyses Steps

§ Part 2: Basic ORM Constructs and Syntax

§ Part 3: Use case (ID Card)

§ Part 4: Use case (University Programs)

Conceptual AnalysesConceptual Schema Design Steps

Mustafa Jarrar: Lecture Notes on Conceptual Analyses and design Steps.University of Birzeit, Palestine, 2018

Page 25: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

25Jarrar © 2018

Use Case (University Programs)

Model Information about University Programs, using ORM, for example: According to the Ministry of Higher Education:A University consists of a set of faculties, each faculty consists of departments, each department offers several Bachelor and Master programs. Each program consists of a set of courses. Same courses might not be offered by different programs. A course has number, title, description, etc.

• Each student is expected to deliver (PDF and Hard copies) of his/her ORM model before (Deadline: 19/2/2015).

• Any ORM tool can be used. • Each student is expected to bring his laptop next lecture, so

to present his/her models to all students.

Page 26: Conceptual Analyses and Design Steps - jarrar.info€¦ · §Part 1: Conceptual Analyses Steps §Part 2: Basic ORM Constructs and Syntax §Part 3: Use case (ID Card) §Part 4: Use

26Jarrar © 2018

References

1. Terry Halpin, Tony Morgan: Information Modeling and Relational Databases, Second Edition. 2nd

Edition. The Morgan Kaufmann Series in Data Management Systems. ISBN: 0123735688

2. Mustafa Jarrar and Stijn Heymans: Towards Pattern-Based Reasoning For Friendly Ontology Debugging. Journal of Artificial Intelligence Tools. Volume 17. No.4. World Scientific Publishing. Aug 2008.

3. Mustafa Jarrar: Mapping ORM Into The SHOIN/OWL Description Logic- Towards A Methodological And Expressive Graphical Notation For Ontology Engineering. In OTM 2007 workshops: Proceedings of the International Workshop on Object-Role Modeling (ORM'07). Pages (729-741), LNCS 4805, Springer. ISBN: 9783540768890. Portogal. November, 2007

4. Mustafa Jarrar: Towards Automated Reasoning On ORM Schemes. -Mapping ORM Into The DLR_idf Description Logic. In proceedings of the 26th International Conference on Conceptual Modeling (ER 2007). Pages (181-197). LNCS 4801, Springer. Auckland, New Zealand. ISBN 9783540755623. November 2007

5. Mustafa Jarrar and Stijn Heymans: Unsatisfiability Reasoning In ORM Conceptual Schemes. In Current Trends in Database Technology - EDBT 2006: Proceeding of the IFIP-2.6 International Conference on Semantics of a Networked. Pages (517-534). LNCS 4254, Springer. Munich, Germany. ISBN: 3540467882. March 2006.

6. Mustafa Jarrar, Maria Keet, and Paolo Dongilli: Multilingual Verbalization Of ORM Conceptual Models And Axiomatized Ontologies. Technical eport. STARLab, Vrije Universiteit Brussel, Feb 2006.

7. Mustafa Jarrar: Modularization And Automatic Composition Of Object-Role Modeling (ORM) Schemes. OTM 2005 Workshops: Proceedings of the Object-Role Modeling (ORM'05). Pages (613-625). LNCS 3762, Springer. Larnaca, Cyprus. ISBN: 3540297391. November 2005.