object identities
Download
Skip this Video
Download Presentation
Object Identities

Loading in 2 Seconds...

play fullscreen
1 / 18

Object Identities - PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on

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.

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

PowerPoint Slideshow about 'Object Identities' - anja


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
object identities

Object Identities

A presentation by Corey Anderson

Inspired by Abiteboul and Kanellakis

the big idea
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
Object Identity
  • A unique identity for each object

oid

o-value

adam

[ name: “Adam”,

spouse: eve,

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

formalisms basics
Formalisms – basics
  • oid
    • An identifier
  • o-value
    • An oid, a constant, or a tuple of o-values
  • Schema v. Instance
formalisms classes
Formalisms – classes
  • Classes P = { P1, P2, … }
    • P = { 1st-gen, 2nd-gen }
  • (P) : P {oids}
    • (1st-gen) = { adam, eve }
formalisms relations
Formalisms – relations
  • Relations R = { R1, R2, … }
    • R = { ancestor-of-celebrity, founded-lineage }
  • (R) : R  {o-values}
    • (ancestor-of-celebrity) = {[seth, noah], …}
formalisms typing
Formalisms – typing
  • 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]}
formalisms the last one
Formalisms – the last one!
  • 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 
an example schema
An Example Schema
  • 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])]

an example instance
An Example Instance
  • (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”]] }

  • (adam) = [name: “Adam”, spouse: eve,

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

  • (abel) = [name: “Abel”, occupations: {“shepherd”}]
  • (other) is undefined
posing queries iql
Posing Queries – IQL
  • 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
simple iql example
Simple IQL example
  • Farmers who founded lineage
    • farmer-founders(x) 2nd-gen(x), founded-lineage(x), x = [n, o], o = “farmer”
less simple iql example
Less simple IQL example
  • 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)?
the query
The query

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

another example nesting
Another example – nesting

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

why the authors like iql
Why the authors like IQL
  • 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, …
type inheritance
Type inheritance
  • 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 }
take home messages
Take home messages
  • oids are unique identifiers for objects
  • oids and their use are formally defined
  • IQL is a language with which to query OODBs
ad