semi-structured data and xml in geographic data modeling...

75
Advanced Topics in Database Systems Emmanuel Stefanakis http://www2.unb.ca/~estef/ Stefanakis, E., 2014. Geographic Databases and Information Systems. CreateSpace Independent Publ. [In English], pp.386. Get a copy from Amazon Chapter 7

Upload: others

Post on 13-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Topics in Database Systems

Emmanuel Stefanakis

http://www2.unb.ca/~estef/

Stefanakis, E., 2014. Geographic Databases and Information Systems.

CreateSpace Independent Publ. [In English], pp.386.

Get a copy from Amazon

Chapter 7

Page 2: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Conceptual Modeling

Emmanuel Stefanakis

[email protected]

Page 3: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Database Design…

• Special Cases of ER Diagrams

• Enhanced ER-model

• UML

Topics

Page 4: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

4

Conceptual Schema Design

• Special cases of ER-diagrams

– Recursive relationships…

A

B

C

D

A

B

C

POLYGONS(entity type)

CONTAINS (bounds)(recursive relationship

type)

D

r1

r2

r3

r4

Page 5: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

5

Conceptual Schema Design

• Special cases of ER-diagrams

– Recursive relationships…

N

CONTAINS

AREA

PLID PERIMETER

POLYGONS

M

External (bounding)

Internal (bounded)

Page 6: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

6

Conceptual Schema Design

• Special cases of ER-diagrams

– Dependent entity/relationship types…

Page 7: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

7

Conceptual Schema Design

• Special cases of ER-diagrams

– Relationships of degree > 2

Page 8: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

8

Conceptual Schema Design

• Special cases of ER-diagrams

– Relationships of degree > 2

Page 9: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

9

Conceptual Schema Design

• Special cases of ER-diagrams

– Relationships of degree > 2

Page 10: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

10

vs

O2 client in both banks

Both banks mortgage P1

So …O2+B1+P1 wrong

Page 11: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

11

Conceptual Schema Design

• Special cases of ER-diagrams

– Relationships of degree > 2

Page 12: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Database Design…

• Special Cases of ER Diagrams

• Enhanced ER-model

• UML

Topics

Page 13: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

13

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– ER cannot support new technologies ...

• GIS, CAD/CAM, Graphics, Multimedia, etc.

– EER provides the additional concepts…

• class-subclass relationships

• class inheritance

• specialization/generalization

• category

Page 14: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

14

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Super-classes and Sub-classes

• entities of an entity type

can be further grouped

into other entity types,

e.g.,

Page 15: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

15

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Super-classes and Sub-classes

Page 16: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

16

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Class-Subclass Relationship vs 1:1 relationship

the same different

Page 17: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

17

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Class Inheritance

• the subclass inherits from its super-class …

– all attributes

– all relationship instances

• example...

Page 18: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

18

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

Page 19: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

19

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Specialization and Generalization

• two concepts closely related to the concept of

inheritance

• specialization …

– definition of subclasses for one class

• generalization …

– definition of a super-class for a set of classes

Page 20: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

20

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Specialization ...

Page 21: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

21

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– A specialization can be …

• overlapping

• disjoint

– A specialization can be …

• total

• partial

Page 22: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

22

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

superclass

d

subclass 1 subclass 2 ...

superclass

o

subclass 1 subclass 2 ...

superclass

d

subclass 1 subclass 2 ...

superclass

o

subclass 1 subclass 2 ...

total

disjoint

partial

overlapping

total

overlapping

partial

disjoint

Page 23: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

23

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– An example ...

or.. NGO

Page 24: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

24

Conceptual Schema Design

• Enhanced-ER Model (EER-model) – Generalization ...

Page 25: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

25

Conceptual Schema Design

• Enhanced-ER Model (EER-model) – Generalization ...

Page 26: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

26

Conceptual Schema Design

• Enhanced-ER Model

(EER-model)

– Specialization Network Example

Page 27: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

27

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Categories …

• a class-subclass relationship with more than one entity type in the role of the superclass

• a category can be …

– total

– partial

Page 28: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

28

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– Categories…

All FL & AS NBP Some B & P CE

Page 29: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

29

Conceptual Schema Design

• Enhanced-ER Model (EER-model)

– (total) category & its reverse specialization…

Page 30: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

30

Mapping ER to Relational schema

• Standard steps…

– Step 1: Entity types new relations (tables)

– Step 2: Relationships 1:1 (foreign keys)

– Step 3: Relationships 1:N (foreign keys)

– Step 4: Relationships N:M new relation (table)

– Step 5: Multivalued attributes new relation (table)

Page 31: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

31

Mapping E-ER to Relational schema

• Standard steps…

– Step 6:

• For each Super-class and Sub-class …

– create a new relation (table) as of Step 1

– in all sub-class relations insert the key of the superclass

– assign the key role to this attribute in all sub-class relations

Page 32: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

32

Mapping E-ER to Relational schema

• Standard steps…

– Step 6:

Page 33: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

33

Mapping E-ER to Relational schema

• Standard steps…

– Step 6:

Page 34: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

34

Mapping E-ER to Relational schema

• Standard steps…

– Step 6:

Page 35: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

35

Mapping E-ER to Relational schema

• Standard steps…

– Step 7:

• For each category and its super-classes

– create a new relation (table) as of Step 1

– if the super-classes have the same key attribute, insert this key attribute in the category relation (and assign it the key role)

– if the super-classes have a different key attributes, create a new key attribute in the category relation and insert it in the superclass relations as a foreign key

Page 36: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

36

Mapping E-ER to Relational schema

• Standard steps…

– Step 7:

Page 37: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

37

Mapping E-ER to Relational schema

• Standard steps…

– Step 7:

Page 38: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Database Design…

• Special Cases of ER Diagrams

• Enhanced ER-model

• UML

Topics

Page 39: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

39

Conceptual Schema Design

• UML (Unified Modeling Language)

– a standard for software design

– many of UML tools are useful in database design

– class diagrams (concepts) ...

• class

• attributes

• methods

• inheritance

• relationships

Page 40: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

40

Conceptual Schema Design

• UML (Unified Modeling Language)

– class

Page 41: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

41

Conceptual Schema Design

• UML (Unified Modeling Language)

– three types of relationships …

• associations

• aggregations

• generalizations

Page 42: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

42

Conceptual Schema Design

• UML (Unified Modeling Language)

– association between two entities (classes)...

Page 43: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

43

Conceptual Schema Design

• UML (Unified Modeling Language)

– association between two entities (classes)...

If I pick one owner, s/he is associated with 0 to many parcels

If I pick one parcel, it is associated with 1 to many owners

Page 44: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

44

Conceptual Schema Design

• UML (Unified Modeling Language)

– association between two entities (classes)...

1..1 0..1

Page 45: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

45

Conceptual Schema Design

• UML (Unified Modeling Language)

– association between two entities (classes)...

1..1 0..N

MEN WOMEN

Page 46: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

46

Conceptual Schema Design

• UML (Unified Modeling Language)

– aggregation

• the relationship between an object and its

components parts

• a class can be part of

– one class (total aggregation)

– more than one classes (partial aggregation)

Page 47: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

47

Conceptual Schema Design

• UML (Unified Modeling Language)

– aggregation …

weak

strong

Page 48: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

48

Conceptual Schema Design

• UML (Unified Modeling Language)

– aggregation … (implicit representation in EER)

• Through the name of the relationship

Page 49: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

49

Conceptual Schema Design

• UML (Unified Modeling Language)

– generalization …

• class-subclass relationships …

• a generalization is …

– overlapping or

– disjoint

Page 50: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

50

Conceptual Schema Design

• UML (Unified Modeling Language)

– generalization …

disjoint

overlapping

Page 51: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

51

Conceptual Schema Design

• OGC Geometry Class Diagram in UML

Geometry

Point LineString Polygon

MultiPolygon MultiLineString MultiPoint

Geom_Collection

Spatial Reference System

LinearRing Line

2..* 2..* 2..* 2..*

1..*

Page 52: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Logical Modeling

Emmanuel Stefanakis

[email protected]

Page 53: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Logical Database Design…

• Weaknesses of the Relational Model

• The Object-Oriented Model

Topics

Page 54: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

54

Logical Schema Design

• Weak Points of the Relational Model:

1. efficiency

• information retrieved by addressing multiple

tables (join operation is very slow)

2. data semantics

• the relational model lacks semantics

– cannot distinguish between different types of

relationships (association, aggregation, specialization)

– a column can be either attribute or relationship

Page 55: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

55

Logical Schema Design

• Weak Points of the Relational Model:

3. model extension

• relations cannot be used as built-in data types

(1-NF prevents nested relations)

4. object identity

• the method of mixing data values and identity

is proved dangerous (inconsistency problems)

Page 56: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

56

Logical Schema Design

• Weak Points of the Relational Model:

5. program interface

• differences in the languages used (non-comparable power)

• mismatch in the data types supported by the two systems

gap : it hampers smooth interaction

DATABASE

USER INTERFACE DBMS

PROGRAM PROGRAM INTERFACE DBMS

USER

O-O concepts

Relational DBMS

Page 57: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Logical Database Design…

• Weaknesses of the Relational Model

• The Object-Oriented Model

Topics

Page 58: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

58

Logical Schema Design

• Object-Oriented Model

– basic concept: the object

– an object has three components...

OBJECT

state behavioridentifier

Page 59: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

59

Logical Schema Design

• Object-Oriented Model

– an object state is …

• simple (atomic)

• complex

state

atom (atomic value)

tuple

collection

list

array

set

bagOBJECT

state behavioridentifier

Page 60: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

60

Logical Schema Design

• Object-Oriented Model

(i1,atom,’464197351’)

(i2,atom,’SMITH’)

(i3,atom,’JOHN’)

(i4,atom,’08/15/1952’)

(i5,atom,’GEORGE’)

(i6,atom,’191’)

(i7,atom,’FREDERICTON’)

(i8,atom,’NB’)

(i9,atom,’E3A5A3’)

(i10,atom,’CANADA’)

(i11,atom,’5064555555’)

(i12,atom,’5064448888’)

(i13,atom,’5069991234’)

(i14,tuple,<STREET:i5, NUMBER:i6, CITY:i7, PROVINCE:i8, ZIP:i9, COUNTRY:i10>)

(i15,set,<i11, i12, i13>)

(i16,tuple,<SIN:i1, SURNAME:i2, NAME:i3, DoB:i4, ADDRESS:i14, TELEPHONES:i15>

Page 61: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

61

Logical Schema Design

• Object-Oriented Model

i16tuple

SIN SURNAME NAME DoB

i1atom

ADDDRESS TELEPHONES

i2atom

i3atom

i4atom

464197351

STREET NUMBER CITY PROVINCE

i5atom

ZIP COUNTRY

i7atom

i8atom

i9atom

i10atom

GEORGE 191

i6atom

FREDERICTON NB CANADAE3A5A3

i14tuple

i15set

value

i11atom

i12atom

i13atom

SMITH JOHN 08/15/1952

5064555555 5064448888 5069991234

&oidtype

value

pointers to objects

a1 a2 a3 a4 …

pointers to objects

Object

Tuple

Collection

notation (diagram)

Page 62: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

62

Logical Schema Design

• Object-Oriented Model

– the object behavior …

• methods (operations) that can be executed to

– create/destroy an object

– update an object state

– retrieve object state

– compute new values based on object state

• the names and parameters of methods

– define the object interface

OBJECT

state behavioridentifier

Page 63: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

63

Logical Schema Design

• Object-Oriented Model …

– also supports …

• object classes

• associations between object classes

• class hierarchies and inheritance

– Several prototype systems: e.g., O2, Informix, etc.

Page 64: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

64

Logical Schema Design

• Object-Oriented Model …

Page 65: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

65

Logical Schema Design

• Object-Oriented Model …

Page 66: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

66

Logical Schema Design

• Object-Oriented Model …

Page 67: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

67

Logical Schema Design

• Object-Oriented Model …

Page 68: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

68

Logical Schema Design

• Object-Oriented DBMSs…

– Standard …

• ODMG

– from Object Data Management Group (1991-2001)

– ver. 1.0 (1993), ver. 2.0 (1997), ver. 3.0 (2000)

• consists of …

– the object model

– the object definition language (ODL)

– the object query language (OQL)

Page 69: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

69

Logical Schema Design

• Mapping EER/UML to OO Model

– Rule 1: mapping entities into classes

– Rule 2: mapping relationships

– Rule 3: Embedding methods into classes

– Rule 4: mapping super-subclass relationships

not examined here

Page 70: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

70

Logical Schema Design

• Object-Oriented DBMSs…

– Example OQL queries…

SELECT struct<d.sin, d.surname, d.name>

FROM d in all_owners

WHERE d.DoB < 01/01/1960;

all_owners;

464197351.surname;

464197351.address.city;

464197351.telephones;

464197351.titles.owns.parcel;

Page 71: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

71

Logical Schema Design

• Advantages of the O-O Model…

1. Efficiency

• encapsulation of methods in the objects

• tends to group all data concerning an object

• implementation of relationships through direct

links

O-O database rel. database

Page 72: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

72

Logical Schema Design

• Advantages of the O-O Model…

2. Data Semantics

• clear distinction between: classification,

generalization and aggregation

3. Model Extension

• possible by the use of classes in a manner

identical with ADT in programming

• user defined data types

Page 73: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

73

Logical Schema Design

• Advantages of the O-O Model…

4. Object Identity

• unique identifications for all objects

• created by the system

• independent of addresses and data values

• they can survive updating and data reorganization

Page 74: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

74

Logical Schema Design

• Advantages of the O-O Model…

5. Program Interface

• similarities between OOPS - OODBMS

• smoother program interface

• the gap between the software and the program interface is small

Page 75: Semi-structured Data and XML in Geographic Data Modeling ...estef/UNB_Home_files/GISBookSlides/Chapter_7.pdf · 35 Mapping E-ER to Relational schema •Standard steps… –Step 7:

Advanced Topics in Database Systems

Emmanuel Stefanakis

http://www2.unb.ca/~estef/

Stefanakis, E., 2014. Geographic Databases and Information Systems.

CreateSpace Independent Publ. [In English], pp.386.

Get a copy from Amazon

Chapter 7