Data and Process Modelling Lab 3. Relational Mapping in NORMA Marco - - PowerPoint PPT Presentation

data and process modelling
SMART_READER_LITE
LIVE PREVIEW

Data and Process Modelling Lab 3. Relational Mapping in NORMA Marco - - PowerPoint PPT Presentation

Data and Process Modelling Lab 3. Relational Mapping in NORMA Marco Montali KRDB Research Centre for Knowledge and Data Faculty of Computer Science Free University of Bozen-Bolzano A.Y. 2015/2016 Marco Montali (unibz) DPM - Lab3.RMap A.Y.


slide-1
SLIDE 1

Data and Process Modelling

Lab 3. Relational Mapping in NORMA Marco Montali

KRDB Research Centre for Knowledge and Data Faculty of Computer Science Free University of Bozen-Bolzano

A.Y. 2015/2016

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 1 / 14

slide-2
SLIDE 2

E-R: Abstract Representation of Data

  • Introduced by Peter Chen (1976).
  • The most widely used approach to data modeling.
  • Key notions:

◮ entities, relationships, attributes; ◮ identification and multiplicity constraints.

  • Independent from the target software platform.
  • Lack of dynamic modeling.
  • Close to relational database schemas → logical relational modeling!
  • Different notations/dialects:

◮ Chen, Barker, IE, IDEF1X, EXPRESS . . . Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 2 / 14

slide-3
SLIDE 3

Barker Notation

  • Proposed by Richard Barker in 1990.
  • Used by Oracle in its CASE tools (together with UML).
  • Entity types represented as rounded rectangles.
  • Attributes compactly modeled inside the entity types.
  • Annotations are attached to attributes to model their participation: ∗

for mandatory, ◦ for optional, # for stating that the attribute is part

  • f the entity’s PK.
  • Relationships restricted to binaries (not the case for all E-R dialects).
  • Constraints on roles modeled by graphical elements on the

relationships.

◮ Participation: solid half-line for mandatory, dotted half-line for optional. ◮ Cardinality: crow’s foot (fork) for many, absence of crow’s foot for one.

  • Verbalization of relationship R between A and B:

Each A (must | may) be R (one and only one B | one or more B-plural-form)

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 3 / 14

slide-4
SLIDE 4

Simple Example

Room Employee

  • ccupies / is occupied by

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 4 / 14

slide-5
SLIDE 5

Simple Example

Room Employee

  • ccupies / is occupied by

Room Employee

an occupier of

  • ccupied by

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 4 / 14

slide-6
SLIDE 6

ORM-Barker Correspondences

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 5 / 14

slide-7
SLIDE 7

ORM-Barker Correspondences

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 6 / 14

slide-8
SLIDE 8

Identification Bars

  • Used in Barker notation to denote that the relationship is a

component of the PK for the entity type at that end.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 7 / 14

slide-9
SLIDE 9

Subtyping

  • Barker notation only supports partitions.
  • Exclusive subtyping is implicitly supported by adding a further

subtype to represent “other” cases.

  • No support for overlapping subtypes.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 8 / 14

slide-10
SLIDE 10

Exclusion Constraints

Modeled in Barker notation by connecting the half-lines of the involved relationships. In case of exclusive-or (exclusion + disjunctive inclusion), then the half-lines are depicted as solid lines, and then connected as before.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 9 / 14

slide-11
SLIDE 11

Topics

  • Learn how to obtain an E-R representation starting from an ORM

conceptual schema.

  • Learn how to obtain the vertical layout modeling the relational

schema resulting from the application of Rmap to an ORM conceptual schema (see tutorial 8 on ormfoundation.net for details).

  • Learn how to obtain the corresponding SQL code

(see tutorial 1 on ormfoundation.net for details).

  • Apply these techniques to different examples, possibly with

hierarchies.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 10 / 14

slide-12
SLIDE 12

Key Points

  • To map an ORM schema to a corresponding E-R diagram in Barker

notation, then just enable the “Barker Notation” view in the extension manager (right click in the main panel).

  • Similarly for relational mapping.
  • Observe that some constraints are “lost” in the translation process.
  • To define different strategies for relational mapping of ORM

hierarchies, then just click on the subtype and change the AbsorptionChoice property.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 11 / 14

slide-13
SLIDE 13

CD Shop ORM Conceptual Schema

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 12 / 14

slide-14
SLIDE 14

Skaters Schema

Problem

Build a relational schema corresponding to the ORM schema, following the Rmap procedure and adopting the partition strategy to deal with

  • hierarchies. For each relation schema, highlight the primary key,

alternative keys, mandatory and optional attributes. Furthermore, depict all relevant constraints, paying particular attention to foreign keys.

Task

Start by circling the elements of the schema that collapse into a unique

  • table. For each relation schema that you produce, highlight the primary

key, alternative keys, mandatory and optional attributes. Depict all relevant constraints, paying particular attention to foreign keys.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 13 / 14

slide-15
SLIDE 15

Skaters Schema

Problem

Build a relational schema corresponding to the ORM schema, following the Rmap procedure and adopting the partition strategy to deal with

  • hierarchies. For each relation schema, highlight the primary key,

alternative keys, mandatory and optional attributes. Furthermore, depict all relevant constraints, paying particular attention to foreign keys.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 13 / 14

slide-16
SLIDE 16

Program Committee Schema

Problem

Build a relational schema corresponding to the ORM schema, following the Rmap procedure and adopting:

  • the partition strategy to deal with the PC Member hierarchy;
  • the absorption strategy to deal with the Paper hierarchy.

Task

Start by circling the elements of the schema that collapse into a unique

  • table. For each relation schema that you produce, highlight the primary

key, alternative keys, mandatory and optional attributes. Depict all relevant constraints, paying particular attention to foreign keys.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 14 / 14

slide-17
SLIDE 17

Program Committee Schema

Problem

Build a relational schema corresponding to the ORM schema, following the Rmap procedure and adopting:

  • the partition strategy to deal with the PC Member hierarchy;
  • the absorption strategy to deal with the Paper hierarchy.

Marco Montali (unibz) DPM - Lab3.RMap A.Y. 2015/2016 14 / 14