Advanced Database: Seminar # 12: Object-Oriented Databases1 Object Oriented Databases Seminar 12 Exploring ODMG standard Using Lambda-DB.

Slides:



Advertisements
Similar presentations
Advanced Database: Seminar # 12: Object-Oriented Databases1 Object Oriented Databases Seminar 12 Exploring ODMG - OQL Using Lambda-DB.
Advertisements

Object Databases Baochuan Lu. outline Concepts for Object Databases Object Database Standards, Languages, and Design Object-Relational and Extended-Relational.
Chapter 6 Additional Relational Operations Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
Employee database: Conceptual Schema in ERD Chapter 3, page 62.
Chapter 15 (Web): Object-Oriented Database Development
Object-Oriented Standards OMG OMDG. Overview Object Management Group (OMG) International non profit-making consortium founded in 1989 to address object.
© 2007 by Prentice Hall 1 Chapter 15 (Web): Object-Oriented Database Development Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
1 Announcements Research Paper due Monday November 22.
Databases Illuminated Chapter 7 The Object-Oriented Model.
1 ODB Design Handling Associations in ODL M. Akhtar Ali School of Informatics.
Object-Oriented Database Design using UML and ODMG
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
1 ODB Design: Handling Associations and Inheritance in ODL M. Akhtar Ali School of Informatics.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
Object Query Language (OQL) and Language Binding
Agenda  TMA03  M877 Block 3 Databases with Objects.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
By: Blake Peters.  OODB- Object Oriented Database  An OODB is a database management system in which information is represented in the form of objects.
1 Revision and Exam Briefing M. Akhtar Ali School of CEIS.
Why Object-Oriented DBMS? Abstract data types (relational data model is too simple). Interface with host programming language Managing large number of.
Seminar #: 9 (Object Oriented Database Schema in ODL) Advanced Databases (CM036) 1 Seminar 9 : OODB Schema in ODL Purpose To understand how an OODB is.
Object-Oriented Database Management Systems (ODBMS)
1 The module aims to: n Extend the concepts and practical implementation of the relational model. n Introduce the concepts of Object Oriented and Object-
1 Advanced Databases – Lecture # 11 Object-Oriented Databases Advanced Databases Object Oriented Databases School of Informatics Akhtar Ali.
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
1 Advanced Databases (CM036) – Lecture # 12: The ODMG Standard for Object Databases Object Query Language (OQL) & Language Binding Advanced Database Technologies.
Object Definition Language
OOPSLA LAB. 1 Chapter 4 Object Query Languages Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Scaling Heterogeneous Databases and Design of DISCO Anthony Tomasic Louiqa Raschid Patrick Valduriez Presented by: Nazia Khatir Texas A&M University.
CSE 6331 © Leonidas Fegaras OODB1 Object-Oriented Databases and the ODMG Standard.
Database Design Why do we need it? – Agree on structure of the database before deciding on a particular implementation. Consider issues such as: –What.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
Seminar 10: OODB Design (Self-Study)
Seminar #: 10 (Object Oriented Database Design) Advanced DB Technologies (CG096) 1 Seminar 10 : OODB Design Purpose To understand how an OODB is structured.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
1 CSE544 Monday April 26, Announcements Project Milestone –Due today Next paper: On the Unusual Effectiveness of Logic in Computer Science –Need.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
The ODMG Standard for Object Databases
Seminar #: 10a (Object Oriented Database Design) Advanced Databases (CM036) 1 Seminar 10a : OODB Design Purpose This seminar is the continuation of seminar.
XML Databases. XML Like HTML –Tags –Fixed vocabulary of tags and fixed structure –Tags indicate formatting, not semantics Strict HTML – XHTML –Always.
1 Advanced Database Technologies CG096 Dr. Akhtar Ali School of Computing, Engineering and Information Systems Jan 2007.
OOPSLA Lab.1 Chapter 6 Smalltalk Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
1 Advanced Databases – Lecture # 12: The ODMG Standard for Object Databases Advanced Databases The ODMG Standard for Object Databases.
1 ODB Design Handling Inheritance in ODL M. Akhtar Ali School of Informatics.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 ODMG: ODL and OQL This lecture is a short version of: Lecture 11 (on ODL) & Lecture 12 (on OQL) M. Akhtar Ali School of Informatics.
Object-Oriented Databases (chapter 3/3) ODMG-OQL for querying the database Simple OQL Queries, Retrieving Objects – an example Database Entry Points Retrieving.
OOPSLA Lab1 Chapter 7 Java Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Relational Algebra COMP3211 Advanced Databases Nicholas Gibbins
Object-Oriented Databases (chapter 2/3) Object Persistence - Introduction Persistent Programming Languages Specifying Object Persistence via Naming and.
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
Object-Oriented Databases and the ODMG Standard
COMP3017 Advanced Databases
Advanced Databases Object Oriented Databases
Database Design Why do we need it? Consider issues such as:
Seminar 10 : OODB Design (Self-Study)
Seminar 6 : OODB Schema in ODL
SQL: Structured Query Language DML- Queries Lecturer: Dr Pavle Mogin
Chapter 12 Outline Overview of Object Database Concepts
Seminar 9: OODB Design (Self Study)
ODB Design: Handling Associations and Inheritance in ODL
ITEC 3220A Using and Designing Database Systems
Chapter 15: Object-Oriented Database Development
Presentation transcript:

Advanced Database: Seminar # 12: Object-Oriented Databases1 Object Oriented Databases Seminar 12 Exploring ODMG standard Using Lambda-DB

Advanced Database: Seminar # 12: Object-Oriented Databases2 Example Schema in ODL module University { interface Person { attribute string name; attribute string address; attribute date birthDate; }; class Lecturer : Person (extent Lecturers) { attribute short room; relationship set tutees inverse Student::tutor; relationship Department worksFor inverse Department::staff; relationship set teaches inverse Unit::taughtBy; }; class Student : Person (extent Students) { attribute string major; relationship Lecturer tutor inverse Lecturer::tutees; relationship Course enrolledOninverse Course::hasStudents; relationship set takesinverse Unit::takenBy;}; class Department (extent Departments) { attribute string name; relationship set staffinverse Lecturer::worksFor; relationship set offers inverse Course::offeredBy; }; class Course (extent Courses) { attribute string name; relationship Department offeredByinverse Department::offers; relationship set hasStudentsinverse Student::enrolledOn; relationship set hasUnitsinverse Unit::partOf; }; class Unit (extent Units) { attribute string name; attribute string code; relationship set takenBy inverse Student::takes; relationship set taughtByinverse Lecturer::teaches; relationship set partOfinverse Course::hasUnits; }; };

Advanced Database: Seminar # 12: Object-Oriented Databases3 Object Creation – the Database // Department instances %d1 := Department(name:"Computing"); %d2 := Department(name:"Maths"); %d3 := Department(name:"Engineering"); // Lecturer instances %Date_Type doBirth; doBirth.year = 1965; doBirth.month = 12; doBirth.day = 25; %i1 := Lecturer(name:"Neil Eliot", address: "South Shields", birthDate: doBirth, worksFor: d1); %i2 := Lecturer(name:"Julia Robert", address: "Durham", worksFor: d2); %i3 := Lecturer(name:"David Meyer", address: "Sunderland", worksFor:d1); %i4 := Lecturer(name:"Alex Shearer", address: "Newcastle", worksFor:d3); %i5 := Lecturer(name:"Norman Paton", address: "Northumberland", worksFor: d3); %i6 := Lecturer(name:"David Livingston", address: "Northumberland", worksFor: d1); %i7 := Lecturer(name:"M Akhtar Ali", address: "Newcastle", worksFor:d1); %i8 := Lecturer(name:"Patric Patterson", address: "Newcastle", worksFor: d2); // Course instances %c1 := Course(name:"Bsc Computing for Business", offeredBy: d1); %c2 := Course(name:"MSc Computing Conversion", offeredBy: d1); %c3 := Course(name:"Bsc Mathematics", offeredBy: d1); %c4 := Course(name:"Bsc Electrical Engineering", offeredBy: d1); // Student objects %s1 := Student(name:"Jane Smith", address: "Durham", major : "Computing", tutor: i1, enrolledOn: c1); %s2 := Student(name:"Mark Brown", address: "Newcastle", major : "Computing", tutor: i3, enrolledOn: c2); %s3 := Student(name:"Andrew Tailor", address: "Fenham", major :"Maths", tutor: i2, enrolledOn: c3); %s4 := Student(name:"Samanta Fox", address: "Gosforth", major : "Maths", tutor: i1, enrolledOn: c2); %s5 := Student(name:"Sandra Falcon", address: "Jesmond", major :"Engineering", tutor: i5, enrolledOn: c4); %s6 := Student(name:"Pedro Sampaio", address: "Morpeth", major :"Engineering", tutor: i3, enrolledOn: c1); %s7 := Student(name:"Sarah Khan", address: "Durham", major : "Computing", tutor: i1, enrolledOn: c1); %s8 := Student(name:"Ian Prat", address: "Newcastle", major :"Computing", tutor: i3, enrolledOn: c2); %s9 := Student(name:"Andrew Shah", address: "Fenham", major : "Maths",tutor: i2, enrolledOn: c3); %s10 := Student(name:"Alex Fernandes", address: "Gosforth", major :"Maths", tutor: i1, enrolledOn: c2); %s11 := Student(name:"Hena Kattak", address: "Jesmond", major :"Engineering", tutor: i5, enrolledOn: c4); %s12 := Student(name:"Maria Willian", address: "Morpeth", major :"Engineering", tutor: i3, enrolledOn: c1); // Unit objects %u1 := Unit(name: "Advanced Databases", code: "CM036"); %u2 := Unit(name: "OO Modelling", code: "CM031"); %u3 := Unit(name: "Elementrary Algebra", code: "MATH065"); %u4 := Unit(name: "Descret Mathematics", code: "MATH045"); %u5 := Unit(name: "Tranformers", code: "EE038"); %u6 := Unit(name: "Electronic Beams", code: "EE073");

Advanced Database: Seminar # 12: Object-Oriented Databases4 Object Creation – continued… // link Unit objects with Course objects c1->update()->hasUnits.add(u1); c2->update()->hasUnits.add(u1); c1->update()->hasUnits.add(u2); c2->update()->hasUnits.add(u2); c3->update()->hasUnits.add(u3); c1->update()->hasUnits.add(u4); c3->update()->hasUnits.add(u4); c4->update()->hasUnits.add(u5); c4->update()->hasUnits.add(u6); // link with students u1->update()->takenBy.add(s1); u1->update()->takenBy.add(s2); u1->update()->takenBy.add(s7); u2->update()->takenBy.add(s8); u2->update()->takenBy.add(s1); u2->update()->takenBy.add(s2); u2->update()->takenBy.add(s7); u3->update()->takenBy.add(s3); u3->update()->takenBy.add(s4); u3->update()->takenBy.add(s1); u3->update()->takenBy.add(s10); u3->update()->takenBy.add(s11); u3->update()->takenBy.add(s9); u4->update()->takenBy.add(s2); u4->update()->takenBy.add(s4); u4->update()->takenBy.add(s1); u4->update()->takenBy.add(s10); u4->update()->takenBy.add(s7); u4->update()->takenBy.add(s9); u5->update()->takenBy.add(s5); u5->update()->takenBy.add(s6); u5->update()->takenBy.add(s11); u5->update()->takenBy.add(s12); u6->update()->takenBy.add(s5); u6->update()->takenBy.add(s11); u6->update()->takenBy.add(s12);

Advanced Database: Seminar # 12: Object-Oriented Databases5 Querying using OQL Simple Query Named objects – entry points Path expressions Explicit Joins select l.name from l in Lecturers The query returns names of lecturers such that the type of the result is bag. Departments The query returns all Department objects. The type of the query is set. select struct(Lname:l.name, Dname:l.worksFor.name) from l in Lecturers The query returns names of lecturers and their departments. Note that this in this query, l.worksFor.name is path expression. The query returns names of lecturers and their department by joining them (but the query does not include any join condition). The type of the result is bag. This query has an implicit join. select struct(Lname:l.name, Dname:d.name) from l in Lecturers, d in Departments where l.worksFor = d and d.name = "Computing" Here the user explicitly tells that a join should be performed on the basis of matching OIDs (l.worksFor and d denote an OID of a Department object). The type of the result is bag.

Advanced Database: Seminar # 12: Object-Oriented Databases6 OQL Queries – continued … Unnesting Query – to unnest a collection A Nesting Query – to create nested collection select struct(Dname:d.name, AccStaff: (select l.name from l in d.staff)) from d in Departments The query returns names of departments and their employees. The inner query iterates over the collection staff and projects out lecturer name and creates a collection, and in the outer query the result of the inner query is assigned to the variable AccStaff. The type of the query is bag >. The query retrieves names of lecturers and their tutees in pairs. The query iterates over the collection Lecturers via the variable l; then iterates over l.tutees (a set of Student objects) via the variable s, which unnests this collection; then projects out name from l and name from s. The type of the query result is bag. select struct(LName:l.name, SName:s.name) from l in Lecturers, s in l.tutees

Advanced Database: Seminar # 12: Object-Oriented Databases7 OQL Queries – continued … Aggregation select distinct struct(Lname:l.name, Dname:l.worksFor.name, TuteesNo: count(l.tutees) from l in Lecturers where count(l.tutees) >= max(select count(t.tutees) from t in Lecturers) This query retrieves the names of lecturers and their departments such that the lecturers have maximum tutees. The type of the query is set. The query can be written more efficiently in two steps as: maxNo := max(select count(t.tutees) from t in Lecturers) select distinct struct(Lname:l.name, Dname:l.worksFor.name, TuteesNo: count(l.tutees) from l in Lecturers where count(l.tutees) >= maxNo The query retrieves names of units and the number of teaching staff and the students who take these units. The type of the query result is bag. select struct(Uname:u.name, Tno: count(u.taughtBy), Sno: count(u.takenBy)) from u in Units