1 / 18

# Object Identities - PowerPoint PPT Presentation

Object Identities. A presentation by Corey Anderson Inspired by Abiteboul and Kanellakis. The big idea. Object-orientation in a database is good But no one uniform formalism exists yet So let’s use A&K’s formalism Object identities as First Class Citizens. Object Identity.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' Object Identities' - anja

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

### Object Identities

A presentation by Corey Anderson

Inspired by Abiteboul and Kanellakis

• Object-orientation in a database is good

• But no one uniform formalism exists yet

• So let’s use A&K’s formalism

• Object identities as First Class Citizens

• A unique identity for each object

oid

o-value

spouse: eve,

children: {cain, abel, seth, …} ]

• oid

• An identifier

• o-value

• An oid, a constant, or a tuple of o-values

• Schema v. Instance

• Classes P = { P1, P2, … }

• P = { 1st-gen, 2nd-gen }

• (P) : P {oids}

• (1st-gen) = { adam, eve }

• Relations R = { R1, R2, … }

• R = { ancestor-of-celebrity, founded-lineage }

• (R) : R  {o-values}

• (ancestor-of-celebrity) = {[seth, noah], …}

• Everything has a type 

•  = {} | constant | class | tuple | {} |  | 

• Given , each type has an interpretation [](i.e., the set of things that are of that type)

• [P] = (P)

• [[1, 2]] = {[v1,v2] | v1  [1], v2  [2]}

• A schema S is a triple (R,P,T)

• Relations R, classes P, type mapping T : RP types(P)

• An instance I is a triple (, , )

• o-value assignment , oid-assignment , oid-to-o-value partial function 

• P = { 1st-gen, 2nd-gen }

• R = { ancestor-of-celebrity, founded-lineage }

• T(1st-gen) =

[name: string, spouse: 1st-gen, children: {2nd-gen}]

• T(2nd-gen) = [name: string, occupations: { string }]

• T(ancestor-of-celebrity) = 2nd-gen

• T(founded-lineage) =

[anc: 2nd-gen, desc: (string or [spouse: string])]

• (1st-gen) = { adam, eve }

• (2nd-gen) = { seth, cain, abel, other }

• (founded-lineage) = {cain, seth, other }

• (ancestor-of-celebrity) = {[anc: seth, desc: noah],

[anc: cain, desc: [spouse: “Ada”]] }

children: {cain, abel, seth, other}]

• (abel) = [name: “Abel”, occupations: {“shepherd”}]

• (other) is undefined

• The Identity Query Language

• Rule-based, like Datalog

• Formally, (S, Sin, Sout)

• Sin, Sout are projections of S

• Convert an instance of input schema Sin to an instance of output schema Sout

• Typed

• Farmers who founded lineage

• farmer-founders(x) 2nd-gen(x), founded-lineage(x), x = [n, o], o = “farmer”

• Make a class of all the occupations

S = { R, P {occupation},

T {T(occupation) = [name: string]}

SinSSin from earlier

SoutSSout = {{}, {occupation}, …}

• What’s (S, Sin, Sout)?

T(R1) = string T(R2) = [string, occupation]

R1(o)  2nd-gen(x), x = [n,o]

R2(o,z) R1(o) ;; Creates the oid z and ;; automagically sets ;; (occupation) = z

R2(o,z) ;; Define z’s o-value

R = {R2, R3} T(R2) = [D, D] T(R3) = [D, {D}]

R4(x) R2(x,y)

R5(x,z) R4(x) ;; A new oid!

(y) R5(x,z), R2(x,y) ;; z is set-valued

R3(x, ) R5(x,z)

G1

G2

• IQL can express (almost) all possible database transformations

• oid invention was necessary here

• IQL contains other cool query languages as sublanguages

• Datalog, Datalog with negation, COL, …

• Augment definition of schema to include type hierarchy

• Schema S is a quadruple (R, P, T, ) where  is a partial order on P

• Augment definition of instance to account for oids being a subclass object

• (P) =  { (P’) | P’ P, P’ P }

• oids are unique identifiers for objects

• oids and their use are formally defined

• IQL is a language with which to query OODBs