Data model
This presentation is the property of its rightful owner.
Sponsored Links
1 / 32

Data Model PowerPoint PPT Presentation


  • 101 Views
  • Uploaded on
  • Presentation posted in: General

Information IntegrationLecture 2. Data Model. Michael Genesereth Autumn 2001. Objects. Objects are the basis for our data model. Primitive: Quark23 Composite: Engine14 , CS246 Physical: Earth , Moon , Sun Abstract: Justice , CS246

Download Presentation

Data Model

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Data model

Information IntegrationLecture 2

Data Model

Michael Genesereth Autumn 2001


Objects

Objects

  • Objects are the basis for our data model.

    • Primitive: Quark23

    • Composite: Engine14, CS246

    • Physical: Earth, Moon, Sun

    • Abstract: Justice, CS246

    • Real: Jennifer, Mike, CS246

    • Imaginary: Sherlock Holmes, Unicorn3


Objects as data structures

Objects as Data Structures

a

b

c

Without loss of generality, we can think about objects as data structures in a computer with a 1-1 correspondence to real world objects.

NB: To accommodate numbers and strings, the computer might have to be infinitely large.


Universe of discourse

Universe of Discourse

The Universe of Discourse is the set of all objects about which we want to say something.


Relations

Relations

  • An n-ary relation is a set of n-tuples of objects from a universe of discourse.

    • Jennifer is a professor.

    • Mike is a professor.

    • Jennifer teachesCS145.

    • Mike teaches CS157.

    • Mike teaches CS246.

    • John got an A in CS145.

    • John got a B in CS157.


Arity versus cardinality

Arity versus Cardinality

  • The arity of a relation is the number of objects involved in any tuple. The cardinality is the number of tuples.

  • Arity 1 cardinality 3: Arity 3 cardinality 2:

    • Mike is a professor.John got an A in CS145.

    • Jennifer is a professor.John got a B in CS157.

    • Zohar is a professor.

  • Arity 2 cardinality 4:

    • Jennifer teachesCS145.

    • Mike teaches CS157.

    • Mike teaches CS246.

    • Zohar teaches CS157.


Tabular representation

Tabular Representation


Classes

Classes

A class is a structure consisting of a unary relation (the class predicate) and a finite set of binary relations (its attributes).

Class: course

Predicate: course.instance

Attribute: course.title

Attribute: course.teacher

Attribute: course.prerequisite


Predicates

Predicates

The extension of a class is the set of objects that satisfy the class predicate.


Attributes

Attributes

Each attribute of a class associates members of the class’s extension with corresponding values.


Tabular representation of classes

Tabular Representation of Classes

NB: Class tables are rarely in first normal form.


Memory resident representation

Memory-Resident Representation

Direct Object-Oriented Representation

Real-World Objects represented as Structured Objects

Relationships as pointers

Reverse Relationships are reverse pointers

Sentential Representation

Real-World Objects represented as Structured Objects

Sentences are objects

Objects point to sentences containing them


Graph representation

Graph Representation

block

a

on

under

block

b

stack

on

under

block

c


Naming

Naming

Naming of objects necessary for communication.

Choice #1:

* All objects named

Some objects named; others referenced by properties

Choice #2:

Relative Names

* Globally Unique Names


Relative naming via foreign keys

Relative Naming via Foreign Keys

In relative naming, all entries are strings (usually without quotes). Some are just strings (e.g. nicknames, addresses, descriptions, and so forth). Some refer to objects.

Object references formalized by use of foreign keys, i.e. the use within one table of the value for the key attribute for another table.


Globally unique name scheme

Globally Unique Name Scheme

A name is a sequence of alphanumeric characters together with various connector characters, such as / and . and _.

Choice #3:

Type determined by spelling

Type determined by name registry

* Mixture

Choice #4: Semantically meaningful names

Semantically meaningless names

* Mixture


Predefined names

Predefined Names

Numbers

123

123.456

123/456

Characters

#\a #\b #\c

Strings

“abc def ghi”

“abc \”def\” ghi”

“abc \”d\\f\” ghi”


Objects versus strings

Objects versus Strings

Object name refers to an object

john

String name refers to a string

“john” john

Objects and strings do not have same properties:

John is 33 years old.

“John” includes the character #\h.


  • Login