1 / 32

Data Model

Information Integration Lecture 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

elie
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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Information Integration Lecture 2 Data Model Michael Genesereth Autumn 2001

  2. 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

  3. 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.

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

  5. 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.

  6. 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.

  7. Tabular Representation

  8. 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

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

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

  11. Tabular Representation of Classes NB: Class tables are rarely in first normal form.

  12. 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

  13. Graph Representation block a on under block b stack on under block c

  14. 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

  15. 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.

  16. 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

  17. Predefined Names Numbers 123 123.456 123/456 Characters #\a #\b #\c Strings “abc def ghi” “abc \”def\” ghi” “abc \”d\\f\” ghi”

  18. 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.

More Related