E.Bertino, L.Matino Object-Oriented Database Systems Chapter 3. Query Language Seoul National University Department of Computer Engineering OOPSLA Lab.

Slides:



Advertisements
Similar presentations
Limitations of the relational model 1. 2 Overview application areas for which the relational model is inadequate - reasons drawbacks of relational DBMSs.
Advertisements

OO databases 1 Object Oriented databases. OO databases 2 Developing OODBMS - motivation motivation more and more application areas require systems that.
E.Bertino, L.Matino Object-Oriented Database Systems 1 Chapter 2. Object-Oriented Data Model Seoul National University Department. of Computer Engineering.
D ATABASE S YSTEMS I R ELATIONAL A LGEBRA. 22 R ELATIONAL Q UERY L ANGUAGES Query languages (QL): Allow manipulation and retrieval of data from a database.
Introduction to Databases
Chapter 1 Object-Oriented System Development
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
OBJECTS Object Oriented ???????. OBJECTS Object-Oriented n OO convenient label for a collection of interconnected ideas n OO approach views computer.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Chapter 14 (Web): Object-Oriented Data Modeling
Object-Oriented Databases
Chapter 4: Object-Oriented Data Modeling
July 13, 2015ADBS: OODB1 Concepts for Object-Oriented Databases Chapter 20.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
Databases Illuminated Chapter 7 The Object-Oriented Model.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Chapter 4 Object and Object-Relational Databases (Part ½: Object-Oriented Concepts) Lecturer: H.Ben Othmen Department of Computer Science, Umm Al-Qura.
Chapter 14: Object-Oriented Data Modeling
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
Chapter 14: Object-Oriented Data Modeling
XML, distributed databases, and OLAP/warehousing The semantic web and a lot more.
Limitations of the relational model. Just as the relational model supplanted the network and hierarchical model so too will the object – orientated model.
1 Relational Algebra and Calculus Chapter 4. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
E.Bertino, L.Matino Object-Oriented Database Systems 1 Chapter.1 Introduction Seoul National University Department. of Computer Engineering OOPSLA Lab.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Computer Concepts 2014 Chapter 12 Computer Programming.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
1 Spring 2000 Christophides Vassilis II) RELATIONAL DATABASES.
1 Relational Algebra and Calculas Chapter 4, Part A.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
OOPSLA LAB. 1 Chapter 4 Object Query Languages Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
1 Relational Algebra Chapter 4, Sections 4.1 – 4.2.
Object-Oriented Data Modeling
1 CS457 Object-Oriented Databases Chapters as reference.
E.Bertino, L.Matino Object-Oriented Database Systems 1 Chapter 5. Evolution Seoul National University Department of Computer Engineering OOPSLA Lab.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Design Model Lecture p6 T120B pavasario sem.
1Mr.Mohammed Abu Roqyah. Database System Concepts and Architecture 2Mr.Mohammed Abu Roqyah.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
OODBMS: Introduction and Logical Database Design
Chapter 2 Object-Relational DBMSs Chapter 28 in Textbook.
Database Management Systems, R. Ramakrishnan1 Relational Algebra Module 3, Lecture 1.
1 Spring 2000 Christophides Vassilis THE ODMG OBJECT QUERY LANGUAGE: OQL.
CSC271 Database Systems Lecture # 7. Summary: Previous Lecture  Relational keys  Integrity constraints  Views.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Copyright (c) 2014 Pearson Education, Inc. Introduction to DBMS.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
E.Bertino, L.Matino Object-Oriented Database Systems 1 Chapter 9. Systems Seoul National University Department of Computer Engineering OOPSLA Lab.
The Object-Oriented Database System Manifesto Malcolm Atkinson, François Bancilhon, David deWitt, Klaus Dittrich, David Maier, Stanley Zdonik DOOD'89,
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
The Object-Oriented Database System Manifesto
Chapter 12 Outline Overview of Object Database Concepts
Lec 3: Object-Oriented Data Modeling
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Chapter 20 Object-Oriented Analysis and Design
ITEC 3220A Using and Designing Database Systems
Chapter 8 Advanced SQL.
Presentation transcript:

E.Bertino, L.Matino Object-Oriented Database Systems Chapter 3. Query Language Seoul National University Department of Computer Engineering OOPSLA Lab.

OOPSLA Lab 2 CONTENTS 4 Basic Concept 4 Query Language 4 Impedance Mismatch 4 Characteristics of OO Query Language 4 An SQL-like Query Language in ORION 4 The Languages of GemStone, O 2, and Iris

OOPSLA Lab 3 Query Language 4 Requirements 4 high-level 4 declarative (  procedural) 4 efficient 4 application independent 4 Resource completeness 4 Computational completeness 4 not so obvious for DB 4 query language with reasonable interface using P/L

OOPSLA Lab 4 Impedance Mismatch 4 Difference between the type system of P/L and that of DBL such as DDL, DML 4 Impedance mismatch in relational system 4 two different type system 4 two different computational model 4 Reasons to overcome impedance mismatch 4 to integrate the form between the languages involved 4 to increase the programmer’s productivity 4 One solution 4 adapting the programming models to be DML

OOPSLA Lab 5 Good Query Language Model 4 Simple but powerful 4 Not yet proposed 4 complex data model with poor formal foundation 4 query language and encapsulation are inconsistent 4 Seamlessness 4 smooth transition between two language environments

OOPSLA Lab 6 Characteristics of OO Query Language 4 Access to Objects 4 Aggregation Hierarchy 4 Inheritance Hierarchy 4 Recursive Queries 4 Methods 4 Query Results

OOPSLA Lab 7 Access to Objects 4 In RDBMS 4 only by query language 4 In OODBMS 4 by navigation using OID 4 by SQL-like query languages 4 by hybrid methods 1. set of OIDs using SQL-like query language 2. navigation for each OID 4 Types of equality in semantics of query 4 identity equality vs. value equality

OOPSLA Lab 8 Aggregation hierarchies 4 Attributes in a query can be nested 4 navigation is advantageous 4 Explicit join by identity equality operator 4 Implicit join by path expression 4 to navigate easily through aggregation hierarchy 4 no more expressive power but more conceptual conciseness w  Project  g  Task  i  Researcher  w.Workplan = g  g.Leader = i  i.Specialization = “DB” w  Project  g  Task  i  Researcher  w.Workplan = g  g.Leader = i  i.Specialization = “DB” w  Project  w.Workplan.Leader.Specialization = “DB”

OOPSLA Lab 9 Inheritance Hierarchies 4 A class or a class and all subclasses can be queried 4 Alternative predicate if class(x) = C 1 then pred 1 if class(x) = C 2 then pred 2 if class(x) = C 3 then pred 3... if class(x) = C n then pred n if class(x) = C 1 then pred 1 if class(x) = C 2 then pred 2 if class(x) = C 3 then pred 3... if class(x) = C n then pred n

OOPSLA Lab 10 Recursive Queries 4 A branch in a hierarchy of classes is cyclic, if given classes C i, C j meet one of the followings 4 C j is the (indirect) domain of an attribute of C i and C i is the domain of an attribute of C j 4 C j is the (indirect) domain of an attribute of C i and a superclass or subclass of C i is the domain of an attribute of C j

OOPSLA Lab 11 Types of Cyclic Branches Type n Type sType s-s Type n-s Key Attribute/domain Class/superclass

OOPSLA Lab 12 Methods 4 Methods can be used in queries 4 derived attribute a function which returns object comparable with that of an attribute primitive value or OID 4 predicate method a function which returns Boolean value true or false

OOPSLA Lab 13 Query Results 4 In relational model 4 the result of a query is a relation 4 nested queries 4 In OO model, restrictions on projection 4 the object itself or a single attribute 4 a set of object instances of a general class 4 in ORION, only limited forms of projection to both an attribute and path expression of objects

OOPSLA Lab 14 An SQL-like Language in ORION 4 Overview 4 Single Operand Queries 4 Multiple Operand Queries 4 Operations on Sets

OOPSLA Lab 15 SimpleQuery ::= select TargetClause | select TargetClause from RangeClause | select TargetClause where QualificationClause | select TargetClause from RangeClause where QualificationClause SimpleQuery ::= select TargetClause | select TargetClause from RangeClause | select TargetClause where QualificationClause | select TargetClause from RangeClause where QualificationClause Overview of an SQL-like Language 4 Defined for ORION 4 Syntax for simple query 4 TargetClause(select) for attributes to be retrieved 4 RangeClause(from) for sets of class instances 4 QualificationClause(where) for predicates

OOPSLA Lab 16 select:T fromTask :T where:T man_year == 2 and:T leader specialization == ‘DB’ and:T participant leader specialization == ‘Information System’. select:T fromTask :T where:T man_year == 2 and:T leader specialization == ‘DB’ and:T participant leader specialization == ‘Information System’. selectfromTask whereman_year == 2 andleader specialization == ‘DB’ andparticipant leader specialization == ‘Information System’. selectfromTask whereman_year == 2 andleader specialization == ‘DB’ andparticipant leader specialization == ‘Information System’. Examples of Simple Query 4 Object variables 4 reference the instances of classes 4 specified in RangeClause

OOPSLA Lab 17 Single Operand Queries 4 Acyclic queries 4 Cyclic queries 4 Use of methods 4 derived attributes 4 predicate attributes 4 Query results

OOPSLA Lab 18 Acyclic Queries 4 Aggregation hierarchy 4 path expression for nested sequences of attributes 4 Relation operators for multiple-valued attributes 4 has-subset, is-subset, =, is-in, union, difference, etc. 4 Inheritance hierarchy 4 the scope of a query can include inheritance hierarchy 4 `*' operator after the name of the class select Document* difference TechnicalReport where classification = ‘C2’ select Document* difference TechnicalReport where classification = ‘C2’

OOPSLA Lab 19 select Technical_Report (recurses amendment_to) where acronym_document == ‘ZZ122’ select Technical_Report (recurses amendment_to) where acronym_document == ‘ZZ122’ select Project where exist participating leader specialization == ‘DB’ select Project where exist participating leader specialization == ‘DB’ select Project where reserved_project select Project where reserved_project select Project project_name, work_plan where recurses subproject reserved_project select Project project_name, work_plan where recurses subproject reserved_project Several Query Types 4 Cyclic query 4 Derived attribute 4 Predicate method 4 Projections to the nested and simple objects

OOPSLA Lab 20 JoinPredicate ::= ScalarVariable ScalarOperator ScalarVariable | SetVariable SetOperator SetVariable JoinPredicate ::= ScalarVariable ScalarOperator ScalarVariable | SetVariable SetOperator SetVariable Multiple Operand Queries 4 Explicit join between classes 4 Syntax 4 Example select :D from Document :D, Project :P where :D title = :P Project_name select :D from Document :D, Project :P where :D title = :P Project_name

OOPSLA Lab 21 Operations on Sets 4 object membership based on value equality 4 Union, Intersection, Difference 4 object membership based on identity equality 4 UnionOfValue, DifferenceOfValue, IntersectionOfValue

OOPSLA Lab 22 GemStone 4 Querying only on collection object of Set class 4 Queries are issued by 4 select message for selecting all satisfied objects 4 reject message for selecting all unsatisfied objects 4 detect message for selecting an satisfied object 4 Query result 4 a set of objects whose class is the same as queried one Tasks select: { :t | (t.man_years > 20) & (t.leader.specialization = ‘DB’) } Tasks select: { :t | (t.man_years > 20) & (t.leader.specialization = ‘DB’) }

OOPSLA Lab 23 select t from t in Task where t.man_year > 20 and t.leader.specialization == ‘DB’ select t from t in Task where t.man_year > 20 and t.leader.specialization == ‘DB’ O2O2 4 Only standalone query language 4 can’t be used within methods or CO 2 language 4 Interactive graphic interface for 4 formulating queries 4 saving the queries 4 assigning a name to queries 4 browsing the result 4 Projections, joins, and sub-queries

OOPSLA Lab 24 Iris 4 OSQL query language 4 most similar to the SQL in terms of functionality 4 cursor for accessing the query results sequentially 4 Methods can be invoked in queries 4 Projection and distinct clause are possible select t for each Task t where t.man_year > 20 and t.leader.specialization = ‘DB’ ; select t for each Task t where t.man_year > 20 and t.leader.specialization = ‘DB’ ;