2009 qing li semantic data modeling concepts background: semantic modeling research started in...

36
2009 Qing Li Semantic Data Modeling Concepts Semantic Data Modeling Concepts Background: Semantic modeling research started in ‘70s Semantic modeling research started in ‘70s (mainly late ‘70s) Originally as schema design aids/tools for traditional record-based models (eg, ER) Emphasis: to accurately model data relationships => more complex inherently, and encourage a more navigational view Results: Results: Semantically more expressive and powerful modeling concepts <embodied by a set of semantic data models>

Post on 21-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

Background: Semantic modeling research started in ‘70sSemantic modeling research started in ‘70s (mainly

late ‘70s) Originally as schema design aids/tools for traditional

record-based models (eg, ER) Emphasis: to accurately model data relationships

=> more complex inherently, and encourage a more navigational view

Results:Results: Semantically more expressive and powerful modeling concepts

<embodied by a set of semantic data models>

Page 2: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

Background (cont’d): Later trends:

1) to build full-fledged DBMSs based on semantic models directly

2) merge into the “object” database family Continue to evolve:Continue to evolve: up till late ‘80s / early ‘90s

Central Components of Semantic Modeling: Objects / Entities Attributes / Properties Abstraction relationships (semantic primitives)

Page 3: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

On Semantic Primitives (“data abstractions”): Classification Classification andand Instantiation Instantiation

the former involves classifying similar objects into classes

the latter refers to the generation and specific examination of distinct objects of a class

inverse of each other Related issuesRelated issues

class class vs.vs. type type class properties class properties vs.vs. type properties type properties classes as instances of classes as instances of meta-classesmeta-classes

Page 4: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

On Semantic Primitives (cont’d) IdentificationIdentification

refers to the abstraction process whereby all abstract concepts and concrete objects are made uniquely identifiable by means of identifiers

needed at two levels

1) to distinghish among DB objects & classes1) to distinghish among DB objects & classes

2) to identify DB objects and relate them to real-2) to identify DB objects and relate them to real-world counterpartsworld counterparts

“identifiers” vs. “keys”

Page 5: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

On Semantic Primitives (cont’d) Specification Specification andand Generalization Generalization (“is-a”)(“is-a”)

the former is the process of further classifying a class of objects into more specialized subclasses (“conceptual refinement”)

the latter is the inverse of the former, where several classes are generalized into a higher-level abstract class (“conceptual synthesis”)

Related conceptsRelated concepts attribute inheritance (attribute inheritance ()) instance subsumption (instance subsumption ())

Page 6: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

On Semantic Primitives (cont’d) Aggregation Aggregation (“is-part-of”)(“is-part-of”)

an abstraction concept for building composite/ complex objects from their component objects

three cases: we aggregate attribute values of an object to we aggregate attribute values of an object to

form the whole objectform the whole object represent an aggregation relationship as an represent an aggregation relationship as an

ordinary relationshipordinary relationship combine related objects into a combine related objects into a higher-levelhigher-level

aggregate object aggregate object (with attributes whose value (with attributes whose value ranges are non-atomic objects)ranges are non-atomic objects)

Page 7: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

On Semantic Primitives (cont’d) Association Association (“is-associated-with”)(“is-associated-with”)

an abstraction concept for associating objects from several independent classes

similar to the 3rd case of aggregation, with a distinction:

when an association instance is deleted, the when an association instance is deleted, the participating objects continue to exisitparticipating objects continue to exisit

(not the case for aggregation!)(not the case for aggregation!)

Page 8: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Semantic Data Modeling ConceptsSemantic Data Modeling Concepts

Related Work in AI Knowledge Representation (KR)Knowledge Representation (KR)

Semantic networks frame-based ones

Similarities & DifferencesSimilarities & Differences both use an abstraction process to identify common properties

& important aspects of objects, while attempting to surpress insignificant detailed differences

both provide concepts, constraints, operations, and languages for the object definition & representation

scope of KR is broader (can answer queries involving inference and deduction over objects)

KR tools are in-memory ones, could not scale up.

Page 9: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Introduction Numerous extensions to the ER model (since ‘79)Numerous extensions to the ER model (since ‘79) collectively referred as EER model Aiming at incorporating existing semantic concepts

and primitives into the original ER model EER Model Concepts & PrimitivesEER Model Concepts & Primitives

sub-/super-class (specialization/generalization)sub-/super-class (specialization/generalization) attribute inheritance superclass/subclass as an explicitly defined

and supported relationships

Page 10: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

EER Diagram Notation

Class 1 Class 2

Constraints on specialization/generalization:Constraints on specialization/generalization: predicate-defined constraint

<attribute-defined: a special case> user-defined constraint disjointness constraint: <disjoint <disjoint vs.vs. overlapping> overlapping> completeness constraint: completeness constraint: <total <total vs.vs. partial> partial>

Page 11: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Page 12: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Page 13: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Sub-/super-class (cont’d) the disjointness and completeness constraints are

independent, hence we can have:

a) disjoint, totala) disjoint, total

b) disjoint, partialb) disjoint, partial

c) overlapping, totalc) overlapping, total

d) overlapping, partiald) overlapping, partial a generalization superclass usually is total, hence

only a) and c) apply to generalization specialization can have all above 4 kinds!

Page 14: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Sub-/super-class (cont’d) insertion and deletion rules:

deleting an entity from a superclass => deleting it from all the subclasses

inserting an entity in a superclass => inserting it to all predicate-defined subclasses if the entity satisfies the predicate

inserting an entity in a superclass of a total specialization => it is inserted in at least one of the subclasses of the specialization

specialization lattice & shared subclassesspecialization lattice & shared subclasses a shared subclass: the result of a shared subclass: the result of intersectionintersection!!

Page 15: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Page 16: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Categories and Categorization for modeling a single superclass/subclass

relationship with more than one superclass to derive to derive a class (an entity set) that is of a class (an entity set) that is of

heterogeneous instances (entities)heterogeneous instances (entities)

a category: a category: a subset of a subset of unionunion of its superclasses of its superclasses

* inheritance for categories:* inheritance for categories:

selective inheritance only!!selective inheritance only!!

* constraints for categories:* constraints for categories:

completeness constraint (ie, total vs. partial)completeness constraint (ie, total vs. partial)

Page 17: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Categories and Categorization (cont’d) partial categorizationpartial categorization

Company PersonCompany Person

UU

Account-Account-holderholder

Has-acctHas-acct BankBank

Page 18: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

The Extended ER ModelThe Extended ER Model

Categories and Categorization (cont’d) total categorizationtotal categorization

Building LotBuilding Lot

UU

PropertyProperty

=?==?=

PropertyProperty

dd

Building Lot

Page 19: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

An example EER schemaAn example EER schema

Page 20: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

“Semantic” model continuum:

… ‘… ‘7878 ‘‘88 ...88 ...

Fu

nti

on

al M

od

el:

rel

atio

nsh

ips

as f

unct

ions

SD

M:

ent

ity c

lass

es a

nd g

roup

ings

ER

Mo

del

:

exp

licit

rela

tion

ship

s

RM

/T:

Enh

ance

d in

tegr

ity (

ext

end

ed r

elat

iona

l mod

el)

SA

M*

spe

cial

-pu

rpos

e ty

pes

Eve

nt

Mo

del

:

dyn

amic

mod

elin

g

SH

M+

:

sta

tic a

nd d

ynam

ic m

odel

ing

EE

R

ext

ende

d E

R m

odel

ing

IFO

Mo

del

:

form

aliz

atio

n

Page 21: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

SDM: a Semantic Database Model proposed by McLeod + Hammer (‘78, ‘81)

1) attempted to provide a full set of modeling facilities

2) provided a rich set of semantic primitives, inheritance, constraints, and derivation options

one of the most referenced semantic models SDM Modeling Constructs:

Class / Type (unified) Instance / entity attributes (member attributes & class attributes) inter-class connections: sub-/super-type; grouping

Page 22: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Data Abstractions Supported by SDM Generalization (DAG) Aggregation (simulated by attribute values) Classification Association (via grouping)

SDM Additional Sementic Integrity Constraints: attribute cardinarlity (eg, single-valued, multi-valued) Inverse mapping value range constraints (eg, disjoint, overlapping) null value constraints (eg, mandatory, optional) others: exhaustive, duplicate, etc.

Page 23: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Other Unique Features of SDM Support of Derived Schema Components

=> permit “data relativism” attribute derivation (eg, inverse) subtype derivation:

a) attribute defined

b) set operations

c) value ranges

d) user specified uniformity of information objects

relationships as types types as objects

Page 24: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Problems of SDM Too complex for certain applications and their users

=> trade-off! No well-defined design methodology and tools No complete implementation system

(only subset of SDM features chosen by later systems)

Lack of behavioral / dynamic modelingLack of behavioral / dynamic modeling

Page 25: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

SHM+ : Extended Semantic Hierarchy Model proposed by Brodie and Ridjanovic (‘84) address the problem of modeling both the static and

dynamic portions of an application offers a companion design methodology (ACM/PCM)

Structure Modeling of SHM+Structure Modeling of SHM+ adopted previous semantic models’ concepts and data

abstractionse.g., objects, aggregation, generalization, classification,

association a structure specification language (called Beta)

2-step modeling process: (1) gross structure properties, and (2) fine details of these properties

Page 26: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Behavior Modeling of SHM+Behavior Modeling of SHM+ 2 forms of procedural abstraction

a) actions

b) transactions 3 forms of control abstraction

a) sequence ~> aggregation

b) choice ~> generalization

c) repetition ~> association Behavior Schemes and Behavior Specifications

the former is used for the design of gross behavioral properties

the latter is to specify those properties precisely (based on predicates)

Page 27: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Other unique features of SHM+Other unique features of SHM+ “inheritance” through relationships, too

=> what does this correspond to EER’s concept? functional specifications as formal specification &

verification techniques ACM/PCM: the associated/resultant design methodology

a unified methodology for both static and dynamic aspects of the application

Status: no commercial system developed overtaken by OODBs later on

Page 28: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Functional Data ModelsFunctional Data Models research started as early as in ‘76 (by Kerschberg) main idea: to use the concept of mathematical

function as the fundamental modeling construct=> any request for information is viewed as a function

call with certain arguments several proposals for the models and query

languages the DAPLEX functional model and language are the

best known

Page 29: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

The (DAPLEX) Functional Data Model (FDM) Modeling primitives

entities:

a) printable entity types: string, integer, char, real, …

b) abstract entity type: Entity functional relationships:

eg, Person() => Entity; Student() => Entity

Course() => Entity; Section() => Entity; Dept() => Entity

attribute: also a function whose result (range) is a printable entity

eg., SSN(Person) => string;

Sex(Person) => char;

Page 30: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

FDM Modeling primitives (cont’d) composite attribute:

eg, Name() => Entity

Name(Person) => Name

Fname(Name) => string

Lname(Name) => string

relationship type:

eg., Major(Student) => Dept;

Minor(Student) => Dept inverse mapping:

eg., Major-in(Dept) =>> Student (Inverse of Major)

Minor-in(Dept) =>> Student (Inverse of Minor)

1:M1:M

Page 31: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

FDM Modeling primitives (cont’d) M:N relationship type:

eg, Course-Completed(Student) =>> Section

Student-Attended(Section) =>> Student (Inverse of

Course-Completed)

functions with more than one argument:

eg., Grade(Student, Section) => char FDM Diagram Notations:

Entity

function f

1:M function f ’ (multivalued function f ’)

f

f ’

Page 32: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

FDM Diagram Example

Page 33: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

FDM Function Composition

=> derived functions=> derived functions

a) derived attributesa) derived attributeseg., Fname(Person) => Fname(Name(Person))

Lname(Person) => Lname(Name(Person))

b) inherited attributesb) inherited attributessuppose we declare:suppose we declare:

IS-A-Person(Student) => Person

then we can declare:then we can declare:

SSN(Student) => SSN(IS-A-Person(Student))

SSN(Student) => Sex(IS-A-Person(Student))

Fname(Student) => Fname(IS-A-Person(Student))

Hence, generalizationcan be simulated andsupported

Page 34: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

FDM Derived Data

=> also based on function composition=> also based on function compositionEg., Define Instructor(Student) =>> Instructor(Section(Student))

Define GradePointAverage(Student) =>

AVERAGE(Grade(Student,Section)OVER(Section(Student))

Define Brighter(S1 IN Student, S2 IN Student) =>

GradePointAverage(S1) > GradePointAverage(S2)

FDM Functional Query LanguageEg, “which instructors earn over twice the average salary for

instructors in their departments?”Define InstAvgSal(Dept) =>

AVERAGE(Salary(Instructor) OVER Instructor(Dept))

Page 35: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Functional Query Language (cont’d)FOR EACH Instructor SUCH THAT

Salary(Instructor) > 2 * InstAvgSal(Dept(Instructor))

PRINT Name(Instructor)

FDM Other Features Constraints

eg, Define CONSTRAINT NativeHead(Dept) =>

Has-Dept(Head(Dept)) = Head

Triggers Derived data update ...

Page 36: 2009 Qing Li Semantic Data Modeling Concepts Background:  Semantic modeling research started in ‘70s  Semantic modeling research started in ‘70s (mainly

2009 Qing Li

Representative Semantic ModelsRepresentative Semantic Models

Discussions1) Why do we need semantic data models? What

advantages are offered by semantic models?

2) What trade-offs can we draw from the various semantic data models?

3) Where to go from here?

- handful implementation prototype systems appeared

- a (then) trend:

=> to merge with object-oriented paradigm, so as to bring forth the next generation database technology?!