Inferring the Principal Type and the Schema Requirements of an OQL Query - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Inferring the Principal Type and the Schema Requirements of an OQL Query

Description:

Type Compatibility / Resolving Constraints. Typing Rules. Inference Algorithm ... Generalisation Specialisation Relationship. Type Compatibility - Constraints ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 13
Provided by: AT168
Category:

less

Transcript and Presenter's Notes

Title: Inferring the Principal Type and the Schema Requirements of an OQL Query


1
Inferring the Principal Type and the Schema
Requirements of an OQL Query
Greek State Scholarships Foundation
National Bank of Greece
  • Agathoniki Trigoni and Gavin M. Bierman
  • July 2001

2
Motivation
  • What is a well-typed query?
  • Queries addressed against multiple schemata
  • Schema reconciliation interoperation
  • Semi-structured data
  • Generic queries and query definitions

DB/Schema A
DB/Schema B
Query Applications
Query
Query
Query
Query
DB/Schema C
Semi-Structured data
3
Objectives
  • Inferring the
  • Principal Type of an OQL Query
  • Minimum Schema Type Requirements

define Dept_Managers (dept) as select e from
Employees e where e.positionmanager and
e.departmentdept select d from Departments
d where count (Dept_Managers (d)) gt 5
Employee Department department String
position Department
Employee int department String
position Departments List (int)
Employee String department String
position Department int id
4
Outline
  • Motivation ? Schema Heterogeneity
  • Objectives Type and Schema Inference of OQL
  • Type System of OQL (ODMG 3.0)
  • Type Compatibility / Resolving Constraints
  • Typing Rules
  • Inference Algorithm
  • Conclusion

5
OQL Type System 1
Initial Type System
Subtyping Relation - Examples
6
OQL Type System 2
define q1 as select x from Students as x define
q2 as set ( first ( Students ) ) q1 union q2
Need for extended general types
q1 union q2
from Students
first (Students)
member type of any collection
7
Extended Type System
any
nonfunctional
function
atomic
constructor
collection
boolean
orderable
class
struct
set/bag
list/array
string
int/float
char
set
bag
list
array
int
float
Generalisation Specialisation Relationship
8
Type Compatibility - Constraints
  • Expressive power of OQL
  • Complex Type System

Variety of Type Constraints
If q1, q2, q3 have types
q3 q1 union q2
set (q1,q2)
q1 distinct(q2)
q1 q2.
q1 q2 5
etc
9
Inference Rules
One rule per OQL construct hence
syntax driven inference algorithm
Type environment
Constraints
Examples
10
Resolving Constraints
  • Constraint Resolution
  • Gradual
  • Accumulative


11
Type inference Algorithm - Example
select c from Courses as c
where count(c.chapters) gt 10 and
first(c.chapters)Types
?3boolean
Member_Type(?1)?2
Constructor_Member_Type(?2,chapters) ?4
?4?collection(nonfunctional)
Member_Type(?4) ?5
string
?4 ?list/array(?5)
Equality_Compatible(?5,string)
?4 ?list/array(string)
?5 string
IT(q)bag(?2)
12
Conclusion
OQL Expressiveness
Type Inference Model
Variety of Constraints
Complex Type System
Heterogeneity in DB Applications
Principal Query Type
Schema Requirements
Write a Comment
User Comments (0)
About PowerShow.com