+ All Categories
Home > Documents > Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual...

Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual...

Date post: 01-Feb-2018
Category:
Upload: vandiep
View: 234 times
Download: 0 times
Share this document with a friend
30
Semantic Modeling 1 CIS Semantic Data Modeling o What is Conceptual Data Modeling o Entity-Relationship (E-R ) Modeling o Limitations of E-R Modeling o Object-oriented Modeling: Another semantic model (discussed later in this course)
Transcript
Page 1: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 1CIS

Semantic Data Modeling

oWhat is Conceptual Data Modeling

oEntity-Relationship (E-R ) Modeling

oLimitations of E-R Modeling

oObject-oriented Modeling: Another semantic model (discussed later in this course)

Page 2: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 2CIS

What Is Conceptual Data Modeling?A process that represents the entities, relationships, and

activities of an enterprise in terms of a set of abstract concepts of a chosen data model for specific purposes.Enterprise Modeling, Business Modeling

ConceptualPerception

of an Enterprise

ConceptualPerception

of an Enterprise

Page 3: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 3CIS

Bridge the Gap

STUDENT( ID, Name, Age, Address, GPA )INSTRUCTOR ( Emp#, Name, Rank, Dept )COURSE ( Course#, Credits, Title )CLASS ( Emp#, ID, Course#, Time, Room )

STUDENT( ID, Name, Age, Address, GPA )INSTRUCTOR ( Emp#, Name, Rank, Dept )COURSE ( Course#, Credits, Title )CLASS ( Emp#, ID, Course#, Time, Room )

Page 4: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 4CIS

Data SemanticsoStatic Information

u Data -- Entities

u Associations -- Relationships among entities

oDynamic Information

u Activities -- Operations/transactions

u Integrity constraints -- Business rules/regulations and data meanings

Page 5: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 5CIS

Conceptual Data Model RevisitedA conceptual data model consists of:o A collection of formal concepts

o A set of usage rules

Different model has different modeling capability

Conventional (Logical data modeling)Conventional (Logical data modeling)

Semantic data modeling

Semantic data modeling

Object-Oriented data modeling

Object-Oriented data modeling

-- Hierarchical-- Network-- Relational

-- E-R-- EER-- etc.

Page 6: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 6CIS

E-R Modelingo Introduced by Peter Chen in 1976

oBasic modeling concepts:u Entities, entity types, and attributes

u Relationships

Instructor OfficeAssigned1 1

DepartmentWorks_for

N

1

Teaches

N

M

Course

Date

Language

Emp#

NameFName

MInit LNameTime

Location

Date

Page 7: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 7CIS

E-R Notation

Entity Relationship

Attribute Primary Key

Page 8: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 8CIS

EntitiesoAn entity is a conceptual object

oPhysically exists

4Usually a noun in requirement specification

CIS 2010 CIS 3730Jose Alice Steve

Acct CIS

Class

Student

Department

Page 9: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 9CIS

Entity TypesoA collection of similar entities

oAn abstraction of "physical" entities

4A noun in requirement specifications

4Having "independent" meaningDepartment Department

Student Student

Course Course

AcctCISJose

Alice

Steve

CIS 3730CIS 2010

Page 10: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 10CIS

Weak Entity TypesoCan't exist in DB independently

oMust be identified by its owneru Owner entity type

u Identify relationship

u Partial key

u Total participation

Student Registers Car

Date

1 N

Color PNumParking Lot#

Page 11: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 11CIS

AttributesProperties or characteristics of entities and entity types

u Attribute values -- Properties of entities

u Value set - All acceptable attribute values

u Attributes (definitions) -- Properties of entity types

4A noun or an adjective in requirement specifications

4No "independent" meaning

ID

Jose

"123-45-6789"

25Student Student Age

Page 12: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 12CIS

Key AttributesOne or a group of attributes that can uniquely identify

individual entities of an entity typeu A key refers to one or a group of attributes as a whole

u A key attribute is a component attribute of a key

u Key changes with data semantics

An entity type may have several qualified keysu Primary key -- One of the candidate keys

u Alternate key - Candidate keys not used as the primary key

u Secondary key -- An identifier of records with similar properties of interest

4The primary key attribute(s) is(are) underlined

Page 13: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 13CIS

More Attributes

Student Student id

age

name

degrees

FnameMname

Lname

oSimple attributeContains atomic values only

oComposite attribute

Has component attributes

__________________________________

oSingle-valued attributeHas exactly one value per entity

oMulti-valued attributeContains repeating values per entity

__________________________________

oDerived attributeAttribute values computed by means of

other attributes

SalesrepSalesrep

FnameMname

Lname

EmpNo

CommRate

CommEarned

Page 14: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 14CIS

RelationshipsAssociations among entitiesu Relationships -- Associations among entities

4Usually a verb in requirement specification

Occurrence Diagram or Semantic NetCourseStudent

Takes

Joseph Alice Sue Tom Peter . . .

CIS2010 CIS3210 CIS3215 CIS3730CIS8140. . .

Student CourseTakes

Page 15: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 15CIS

Relationship DegreesThe number of entity types associated with that relationship.

Each entity in a relationship is known as a participant.

Unary

SupervisesEmployee Employee

Employee Employee Department Department Work

Binary

n-aryTernary

Project Project Part Part Supply

Supplier Supplier

Page 16: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 16CIS

N-ary RelationshipsoA link must associate with all participants

oCardinality is with respect to individual relationships

4A N-ary relationship is not equivalent to N binary relationships

Salesperson Order

Customer

ships

N

M 1

Page 17: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 17CIS

Relationship Attribute

oDescribes the association

4A adverb or noun in requirement specification

Instructor Course teaches

sect# time

dateroom#

Page 18: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 18CIS

Relationship CardinalityHow entities are connected through a relationshipu One-to-One -- An entity of E1 is

connected to at most one entity of E2and vice versa.

u One-to-Many -- An entity of E1 may be connected to one or more entities of E2, but an entity of E2 can only be mapped to at most one entity of E1.

u Many-to-Many -- An entity of E1may be linked to one or more entities of E2, and vice versa.

[ ][ ][ ]...

abc...

xyz...

E1 E2R1 1

[ ][ ][ ]...

abc...

xyz...

1 M

...

abc...

xyz...

M N

Page 19: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 19CIS

Relationship Types

• Recursive Relationship– Relationship type where same entity type participates more than once in

different roles.

• Relationships may be given role names to indicate purpose that each participating entity type plays in a relationship.

Page 20: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 20CIS

Recursive Relationship calledSupervises with Role Names

Page 21: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 21CIS

Entities associated through two distinct Relationships with Role Names

Page 22: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 22CIS

Participation ConstraintsLet R be a relationship type involves entity type E as a

participant. If every instance of E participates in at least one instance of R, then the participation is said to be total; other wise it is said to be partial [Date, 2004]

oPartial (optional) participation An entity of E does not have to be mapped to another entity through the relationship.

oTotal (mandatory) participationEvery entity of E must be connected through the relationship to other entity ( or entities ).

Writer Writer

Publishes

Book Book

M

1

Page 23: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 23CIS

Structural Constraints

• Main type of constraint on relationships is called multiplicity.

• Multiplicity - number (or range) of possible occurrences of an entity type that may relate to a single occurrence of an associated entity type through a particular relationship.

• Represents policies (called business rules) established by user or company.

Page 24: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 24CIS

Multiplicity

Teaches TakesFaculty Course Student(1,45)(0,4) (1,1) (?,?)

Page 25: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 25CIS

Other E-R Models

Entity 1 Entity 2Relationship

RelationshipEntity 1 Entity 2

attr. 1 attr. 2

RelationshipEntity 1 Entity 2( 1:m ) ( 0:5 )

Page 26: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 26CIS

Pros and Cons of E-R

Emp#, Name, AddressSalary, Skill

Advantagesu Simple and easy to understand.

u Very popular.

u Semantic richer than classical data models.

Disadvantages:u Not a formally defined data model.

u Deals with some integrity constraints.

u Difficult to distinguish entities from relationships.

u Has redundant modeling information.

ProjectManager

Project

Dependent

ProjectMember Works-on

m-has

Manageshas

Emp#, Name, AddressSalary, Skill

ID, NameAddressBirth-date

Page 27: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 27CIS

Is-A RelationshipoGeneralization and specialization hierarchyu Supertypes -- Hide the differences of subtypes

u Subtypes -- Reveal specific properties

Person

Student Staff

UnderGrad Grad Faculty Secretary

Generalization

SpecializationIs-A Is-A Is-A Is-A

Is-A Is-A

Page 28: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 28CIS

InheritanceoA supertype contains the common properties of all its subtype

entities.

oSubtype inherits properties of its supertype and may have its own properties.

Person Person

EmployeeEmployee DependentDependent

ProjectMember Project

Member Project

Manager Project

Manager

ID, Name, Address

Birth-dateSalary, Skill

Is-A Is-A

Is-A Is-A

Ratio-of-success, ... Languages, ...

Page 29: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 29CIS

ER Example – In-class exercise

A database is being constructed to keep track of the teams and games of a baseball league. A team has a number of players, not all of whom participate in each game. It is desired to keep track of the players participating in each game for each team, the positions they played in that game, and the result of the game. Design an ER schema diagram for this application

Assumptions: Each game in the schedule is identified by a unique Game#, and a game is also identified uniquely by the combination of Date, starting Time, and Field where it is played. A performance attribute is used to store information on the individual batting performance of each player in a game.

Page 30: Semantic Data Modeling - Georgia State · PDF fileSemantic Modeling 2 CIS What Is Conceptual Data Modeling? A process that represents the entities, relationships, and activities of

Semantic Modeling 30CIS

EER Modeling ExampleAmerican Airlines Company

The American Airlines Company publishes a monthly flight log report that tracks which type of aircraft and the number of hours that were flown by an individual pilot. A separate report is prepared for each pilot and is used to monitor pilot flight proficiency for the two types of aircraft (fixed-wing and rotorcraft) which a pilot may be qualified to fly.

The following business rules apply to this report. Pilots may be assigned to fly different aircraft each day by the flight scheduling manager. Each aircraft has a single crew chief permanently assigned to perform maintenance on the aircraft, although a crew chief may crew more than one aircraft. Each aircraft is identified by an aircraft number. There are several aircraft types in the fleet. An aircraft number is unique within an aircraft type.

Identify the entities in this situation and draw an E-R diagram of the entities to include their relationships and any attributes identified in this example. Give examples of additional attributes that might be associated with each entity.


Recommended