Obj t O i t d D t b
Object-Oriented Databases
Support for Context-Aware Data Management
•
Version Model•
Query Processor•
ImplementationIt's been a long way... g y
Workstation
Mainframe Computer Personal Computer Laptop Computer
What will be next?
next?
Palmtop Computer Media Phones Disappearing Computer
...and the road goes on and on. g
So far, information systems have always coped with these ever-changing platforms and requirements
hierarchical databases
network databases
relational databases
object-oriented databases
object-relational databases
i i d t b
engineering databases
lightweight databases
personal databases
personal databases
mobile databases
context-aware databases?co e a a e da abases
The Need for Context-Aware Computing p g
Mobile computing
device limitations, such as reduced interaction bandwidth
location, environment, tasks, preferences, history, device characteristics, ...
Pervasive computing
lack of traditional interfaces, such as keyboards or screens
environment, tasks, moods, preferences, history, personality, background
background, ...
Web engineering
t t d t ti d ti b h i
content adaptation and proactive behaviour
personalisation, internationalisation, access channel or mode, ...
Solutions for Context-Aware Computing p g
Models
context representation
context management
Infrastructures
context gathering
context processing and augmentation
trigger-based application adaptation
CASE tools
model-based generation of context-aware applications
Solutions for Context-Aware Computing p g
Very few context-aware information systems, but...
temporal databases
engineering databases (CAD, CAM)
software configuration management
...have addressed comparable problems in the past
Upshot
stratum approaches built on top of existing systems do not work
experience in models, storage, indexing and query languages
context-aware data management has different requirements in
t i d i d i
terms indexing and query processing
Positioning of Our Work g
Approaches Examples
Requirements Use cases
User studies Specifications
UML use case diagrams, ...
Usability, field tests, ...
Mock-ups, descriptions, ...
Modelling Data Models Software Models
Specifications Mock ups, descriptions, ...
E/R, Relational Model, OM, ...
OMT UML class diagrams
Implementation Manual
Software Models
Domain-specific Models
OMT, UML class diagrams, ...
OOHDM, WebML, Hera, ...
IDE (Eclipse Visual Studio )
Implementation Manual
Semi-Automatic
Automatic Code Generation
IDE (Eclipse, Visual Studio, ...) WebRatio
Platforms Relational Databases
Object-Oriented Databases (Programming) Languages
SQL Server, mySQL, Oracle, ...
ObjectStore, db4o, OMS, ...
Java, C#, JSP, XML, XSLT, ...
Context-Aware Information Systems y
Goals
Context-dependent query processing
- mobile computing, pervasive computing, web engineering
S t f li ti d l t
Support for application development
- web engineering, software engineering, product engineering
Approach Approach
Context notion and representation
Two-dimensional version modelTwo dimensional version model
- Alternative versions (variants) for run-time context-awareness - Revisional versions (revisions) for design-time system evolution
M t hi l ith t l t t t d d t i t
Matching algorithm to select content-dependent variants
- Compute best match rather than exact match
Integration into an object-oriented data management systemeg a o o a objec o e ed da a a age e sys e
Context in Information Systems y
Context information is optional
Information system has a well-defined default behaviour
Available context information may varyR lt i t d i d th th ifi d b t t
Result is augmented or improved rather than specified by context
Context representation needs to be general and openContext, Context Space and Context State , p
Context space
context dimensions that are relevant to an application
S = {name1, name2, ..., namen}
∀ i: 1 ≤ i ≤ n ⇒ namei ∈ NAMES and therefore S ⊆ NAMES
Context Value
c = <name, value>, where name ∈ NAMES and value ∈ VALUES
Context
C(S) = {<name1, value1>, <name2, value2>, ..., <namem, valuem>}
= {c1, c2, ..., cm}
∀ i: 1 ≤ i ≤ m ⇒ name ∈ S and ∀ c c ∈ C: c = c ⇒ name = name
∀ i: 1 ≤ i ≤ m ⇒ namei ∈ S and ∀ ci, cj ∈ C: ci = cj ⇒ namei = namej
Context state
special context C (S) ∀ name ∈ S: ∃ <name value> ∈ C (S)
special context C(S), ∀ name ∈ S: ∃ <name, value> ∈ C(S)
Revisions and Variants
Revisions Variants
design-time
"off-line" queries
run-time
"on-line" queries q
targeted at developers
implicit and explicit creationq
targeted at users
explicit creation only
implicit and explicit creation
serial
explicit creation only
parallelOM Object Metamodel j
Simple Object
Version Model
Metamodel extended with variants and revisions
variants are structurally favoured over revisions
run-time performance versus design-time performance
Variants define a variant context C
v(S)
defines in which context a variant can be used
no two variants of an object can define the same Cv(S)
Revisions are identified by a revision number
ascending sequence
counter is incremented when a new version is generated
All versions of an object have the same types
Versioned OM Object Metamodel j
Versioned Object
Evolution of a Versioned OM Object j
Latest Revision
<loc, de>
o927@2[1] o927@7[1]
object o927@0[0] o927@1[0] o927@4[0] o927@8[0]
Default Variant
<loc, uk>
o927@3[2] o927@6[2]
<loc, ch>
o927@5[3] o927@9[3]
<loc, ch>
<lang, fr>
_time_
Identifying and Referencing Objects y g g j
Both specific and generic references are supported
Object identifier format: o "id" @ "version" [ "variant" ]
Concept of default variant and latest version
Partially specified references can be completed automatically
Versioning of object graphs
Based on object references
- both generic and specific references can be used - local managed within objects uni-directional
- local, managed within objects, uni-directional
- versioning of relationships is dependent on versioning of objects
Based on associations
- relation between objects based on tuples of object identifiers - represented as object with revisions and variants
- global, managed outside objects, bi-directional
- versioning of relationships is independent of versioning of objects
Automatic Completion of Object Identifiers p j
For each dimension of the version model there is a default representation
Latest version
Default variant
Partially specified references are completed as follows y
o927[2] ► o927@4[2] default version
o927@3 ► o927@3[0] default variant
o927 ► o927@4[0] default version and variant
Context-Aware Query Processing Q y g
Simple Scoring Function
Invoked for every object o accessed by the query evaluator
Invoked for every object o accessed by the query evaluator
Scoring function fs assigns a score value to every variant v of o
Indicator functionIndicator function ffii uses matching condition (uses matching condition ( ) for context values≅) for context values
The variant with the highest score smax is returned, if there is only one variant with smax
the score smax is above the system threshold smin
Syntax for Context and Property Values y p y
The indicator function f
iisupports the following syntax for both context and property values
Type Syntax Description Examples
atom x Atomic value en 27
atom x Atomic value en, 27
set x1{:xi} Set of atomic values S := {x x }
at:ch:de, red:blue
S := {x1, ..., xn} red:blue
range xmin..xmax Range of atomic values I := [x x ]
5.5..7.0, a f
I := [xmin, xmax] a..f
star * Wildcard *
Matching Condition ( g ( ) ≅ ) for Context Values
Examples p
object object
{(format,html), (lang,en)} {(format,html), (lang,en), (loc,uk)} {(img,wbmp), (lang,en), (loc,uk)}
object
o927@0[0] o927@1[1] o927@2[2]
object
o927@0[0] o927@1[1] o927@2[2]
<format, html>
<lang, en>
<lang, de>
<format, html>
<loc, uk>
<img, gif:png>
<lang, de>
<img, wbmp> <img, jpg>
<lang, en>
<loc, *>
2/2 1/2 0/2 2/3 2/3 0/3 0/3 1/3 2/3
be uam
est matc undesire
mbiguou
ch edus
Problems and Solutions
Selection of undesired variants
value prefixes (+, –) denote required and illegal matches
examples: <img, +wbmp>, <user, –fred>
Tie-breakers for ambiguous matches
weight factors w(n) for context dimensions
weight factors for matching classes (atom, set, range, wildcard)
handling of under and over-specified variants
General scoring function
Query Processing Modes
Q y g
Local
match context for every object individually
risk of "inconsistent" result sets
easy to integrate into existing query processor
Local with "convergence"
match context for every object individually
add "unmatched" variant context to context state
result depends on the structure of the query tree
Global
match context for all objects of the query tree
optimal, consistent and stable results
t ti ll l
computationally complex
Limitations and Issues
Sorted lists to specify user preferences
<lang=de_ch, de, en, it, fr>
update indicator function, makes matching more complex
Logical expressions to specify complex conditions
(lang=it && loc=ch) || (lang=it && loc=it)
rethink notion and representation of context!
Scalability
applications with large context space
information retrieval solutions (vector model, similarity measures)
However, experiences so far do not suggest major
problems related to these issues and limitations
Implementation p
Extension to the OMSjp layer adaptation of value model
Database Application
adaptation of value model
driver implementation handles versioning issues
OMS Pro Driver eOMS Driver OMS Avon Driver OMSjpInterface
No high-level operational model versions created manually
no support for merging or
OMS Pro Driver eOMS Driver OMS Avon Driver
no support for merging or deleting object versions
Not accessible throughd l ti l
OMS Pro eOMS OMS Avon
declarative query language
OMSjp Value Model jp
toNative()
<<interface>>
OMSValue ()
<<interface>>
OMSObject
<<interface>>
OMSBaseValue
<<interface>>
OMSStructuredValue
<<interface>>
OMSBulkExtent
<<interface>>
OMSInstance getObjectID()
getDressTypes() browse() dress() strip()
getValue() getMemberValue()
setMemberValue() getStructuredType() setStructuredType()
<<interface>>
<<interface>>
getMemberType() setMemberType()
<<interface>>
<<interface>>
<<interface>>
OMSString <<interface>>
OMSSetExtent getInstanceType()
getAttributeValue() setAttributeValue() executeMethod()
getName() getType()
OMSMember
<<interface>>
getName() OMSType
<<interface>>
OMSStructuredType
<<interface>>
OMSBagExtent
<<interface>>
OMSRankingExtent getExtent()
setExtent() OMSAssociation count()
intersect() minus() product() union()
OMSCollection
<<interface>>
OMSReal
<<interface>>
<<interface>>
OMSInteger
getBulk() OMSAttribute
getAttribute() getSubTypes() getSuperTypes()
<<interface>>
OMSObjectType
yp
getSubTypes() getSuperTypes()
<<interface>>
OMSBaseType
<<interface>>
OMSSequenceExtent
closure() compose() div() domain()
<<interface>>
OMSBinaryCollection <<interface>>
OMSDate OMSBoolean
<<interface>>
OMSUri
g p yp ()
() ds() dr() inverse() nest() range() rs() rr() unnest()
<<interface>>
OMSCardinality
<<interface>>
OMSBulk
<<interface>>
OMSObjectID
Extended Value Model
OMSObject OMSObjectVersion
oid: OMSObjectID
types: Collection<OMSObjectType>
versions: Collection<OMSObjectVersion>
latestTimestamp: Timestamp defaultVariantId: OMSVariantID
latestRevision: Map<OMSVariantID, OMSObjectVersion>
defaultVariant: SortedMap<Timestamp OMSObjectVersion>
#getBaseObject(): OMSObject +getTimestamp(): Timestamp baseObject: OMSObject timestamp: Timestamp variantId: OMSVariantID
instances: Collection<OMSInstance>
+getObjectID(): OMSObjectID +getDressTypes()
+dress(type: OMSObjectType) +strip(type: OMSObjectType)
+createRevision(version: OMSObjectVersion): OMSObjectVersion t V i t( t t C t t) OMSObj tV i
defaultVariant: SortedMap<Timestamp, OMSObjectVersion> getTimestamp(): Timestamp +getVariantID(): OMSVariantID
+browse(type: OMSObjectType): OMSInstance
+createVariant(context: Context): OMSObjectVersion +getLatestRevision(): OMSObjectVersion
+getLatestRevision(id: OMSVariantID): OMSObjectVersion +getDefaultVariant(): OMSObjectVersion
+getDefaultVariant(ts: Timestamp): OMSObjectVersion
+getVersion(ts: Timestamp, id: OMSVariantID): OMSObjectVersion +match(context: Context): OMSVariantID
baseVersion: OMSObjectVersion type: OMSObjectType
OMSInstance
( )
#getBaseVersion(): OMSObjectVersion setBaseVersion(version: OMSObjectVersion) +getInstanceType(): OMSObjectType
+setAttributeValue(name: String, value: Object) +getAttributeValue(name: String): OMSValue +executeMethod(name: String in: Object[]) type: OMSObjectType
+executeMethod(name: String, in: Object[])
... type
Outlook and Future Work
Integration of context into query language
Indexing of context-aware data
Context-aware metadata Context aware metadata
OMS represents everything as objects
collections, associations and methods already context awarecollections, associations and methods already context aware
investigation of types, type hierarchies, collection hierarchies
Context-aware programming Context aware programming
virtual method dispatching based on signature and context
prototype implementation in Prologp yp p g