Modeller och språk för objekt-, relations- och webbdatabaser HT 2002.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Relational data objects 1 Lecture 6. Relational data objects 2 Answer to last lectures activity.
Database Design The process of finding user requirement
Object Oriented Database Group 4 Mathieu Metz Palani Kumaresan Napa Gavinlertvatana Kristine Pei Keow Lee Prabhu Ramachandran.
IMPLEMENTATION OF INFORMATION RETRIEVAL SYSTEMS VIA RDBMS.
The Relational Model Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
IS698: Database Management Min Song IS NJIT. The Relational Data Model.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Object Oriented Databases Bringing objects into databases.
Database Systems: Design, Implementation, and Management Tenth Edition
COP5725 – Principles of Database Management Systems
Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
SPRING 2004CENG 3521 The Relational Model Chapter 3.
Integrated Database Design Mark Graves. This presentation is Copyright 2001, 2002 by Mark Graves and contains material Copyright 2002 by Prentice Hall.
Data models Relational, object, and semistructured.
Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
Semantic Web 06 th March, 2002 Robert Kaminski, Thomas Panas.
Introduction to Database. File Formats Comma delimited file –"s1","peter",3 –"s2","paul",2.5 –"s3","mary",3.5 –Demo: Excel – Data/Import Extended Markup.
Object-Oriented Databases
Models and languages for semistructured data Bridging documents and databases.
Semi-structured Data. Facts about the Web Growing fast Popular Semi-structured data –Data is presented for ‘human’-processing –Data is often ‘self-describing’
Chapter 4 Object and Object-Relational Databases (Part ½: Object-Oriented Concepts) Lecturer: H.Ben Othmen Department of Computer Science, Umm Al-Qura.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
1 Introduction to databases concepts CCIS – IS department Level 4.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-02,03 Introduction –Data Models Lectured by, Jesmin Akhter.
Limitations of the relational model. Just as the relational model supplanted the network and hierarchical model so too will the object – orientated model.
CS848: Topics in Databases: Foundations of Query Optimization Topics Covered  Databases  QL  Query containment  More on QL.
Company LOGO OODB and XML Database Management Systems – Fall 2012 Matthew Moccaro.
1 CS 430 Database Theory Winter 2005 Lecture 17: Objects, XML, and DBMSs.
ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI SEPTEMBER Object Databases.
Chapter Two ( Data Model) Objectives Introduction to Data Models What are the Data Models Why they are important Learn how to design a DBMS.
Lecture 15: Relational Algebra
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Object-Relational SQL CIS 4301 Lecture Notes 4/20/2006.
Object relational database managmement systems (ORDBMS) Adapted by Edel Sherratt from originals by Nigel Hardy.
OOPSLA LAB. 1 Chapter 4 Object Query Languages Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
CSE 6331 © Leonidas Fegaras OODB1 Object-Oriented Databases and the ODMG Standard.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
WXGE 6101 DATABASE CONCEPTS & IMPLEMENTATIONS. Lesson Overview The Relational Model Terminology of relational model. Properties of database relations.
CS848: Topics in Databases: Information Integration Topics covered  Databases  QL  Query containment  An evaluation of QL.
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
COMP3030 Database Management System Final Review
Database Systems Lecture 1. In this Lecture Course Information Databases and Database Systems Some History The Relational Model.
1 Spring 2000 Christophides Vassilis THE ODMG OBJECT QUERY LANGUAGE: OQL.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 5 – September 4 th,
A facilitator to discover and compose services Oussama Kassem Zein Yvon Kermarrec ENST Bretagne.
Object-Relational Model. Review: Data Models Hierarchical Network ER (Pure) Relational (Pure) Object-oriented (ODMG) Object-relational (since SQL:1999)
AND OBJECT-ORIENTED DATABASES OBJECT-RELATIONAL DATABASES.
The ODMG Standard for Object Databases
Jennifer Widom Relational Databases The Relational Model.
Databases Flat Files & Relational Databases. Learning Objectives Describe flat files and databases. Explain the advantages that using a relational database.
CSCI 6315 Applied Database Systems Review for Midterm Exam I Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
1 CS122A: Introduction to Data Management Lecture #5 (E-R  Relational, Cont.) Instructor: Chen Li.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
Introduction to Database Programming with Python Gary Stewart
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
XML: Extensible Markup Language
Object-Oriented Databases and the ODMG Standard
The Relational Model.
Chapter 1: Introduction
Relational Algebra.
Web Ontology Language for Service (OWL-S)
Relational Databases The Relational Model.
Relational Databases The Relational Model.
CMPT 354: Database System I
ITEC 3220A Using and Designing Database Systems
INSTRUCTOR: MRS T.G. ZHOU
Presentation transcript:

Modeller och språk för objekt-, relations- och webbdatabaser HT 2002

Data models Relational, object, and semistructured

Types of database applications Queries No queries Simple data Complex data Word processing Payroll GIS CAD/CAM

An example schema EMPLOYEE PERSON ADDRESS COMPANY DEPARTMENT departments EMPLOYEEs head_office ISA address boss ceo office

An example schema

A relational schema zCOMPANY(CID, Name, Street, City, CEO) zDEPARTMENT(CID, DeptName, Street, City, Boss) zPERSON(SS#, Name, Street, City) zEMPLOYEE(SS#, Salary) zEMPLOYMENT(CID, DeptName, Emp) COMPANY.CEO << EMPLOYEE.SS# DEPARTMENT. CID << COMPANY.CID EMPLOYEE.SS# << PERSON.SS# EMPLOYMENT.(CID, DeptName) << DEPARTMENT.(CID, DeptName) EMPLOYMENT.Emp << EMPLOYEE.SS#

Problems with the schema  Composite attributes do not exist Head office cannot be described directly but is decomposed into Street, City zSet valued attributes do not exist The fact that people are employed at departments is described in an extra table

Problems with the schema  Generalisation does not exist The generalisation relationship between EMPLOYEE and PERSON is not explicit  Artificial identifiers required CID is an artificial identifier for COMPANY

A SQL query Which employees live at the same address, work at departments in London and earn more than 20000? SELECT A.SS#, B.SS# FROM EMPLOYEE AS A, EMPLOYEE AS B, EMPLOYMENT AS EMPL1, EMPLOYMENT AS EMPL2, PERSON AS P1, PERSON AS P2 DEPARTMENT AS D1, DEPARTMENT AS D2 WHERE A.SS# = P1.SS# AND B.SS# = P2.SS# AND P1.Street = P2.Street AND P1.City = P2.City AND A.Salary > AND B.Salary > AND EMPL1.SS# = A.SS# AND EMPL2.SS# = B.SS# AND EMPL1.CID = D1.CID AND EMPL2.CID = D2.CID AND EMPL1.DeptName = D1.DeptName AND EMPL2.DeptName = D2.DeptName AND D1.City = London AND D2.City = London

An object database schema ADDRESS Street:String City:String PERSON SS#:String Name:String Address:Address EMPLOYEE ISA PERSON Salary:Integer Boss:Employee Departments:{Department} COMPANY Name: String Head office: Address Departments: {Department} CEO: Employee DEPARTMENT Name:String Office:Address Boss:Employee Employees:{Employee}

An OO query SELECT e1.ss#, e2.ss# FROM e1, e2 in EMPLOYEE; d1, d2 in DEPARTMENT WHERE e1 in d1.Employees AND e2 in d2.Employees AND e1.Address = e2.Address AND e1.Salary > AND e2.Salary > AND f1.Office.City = London AND f2.Office.City = London Are there employees who live at the same address, work at departments in London and earn more than 20000?

OODB models zComplex types zTypes and classes zObject identity zInheritance

Complex types zBase types String Integer Boolean zConstructors Tuple Set Bag List Array

Complex types - an example zCOORDINATE X:Integer Y:Integer Z:Integer zPARKING SPOT Position:COORDINATE Occupied:Boolean zCAR PARK Spots:ARRAY OF PARKING SPOT Personnel:SET OF EMPLOYEE The type constructors can be applied to any type - cf. the relational model

Relation schemes and relations SS# Name Age Salary Eva Svensson Per Jonsson Sven Olsson Pia Eriksson PERSON Relation scheme Relation

Types and classes zA type is a time independent description of a set of (base or complex) values zA class has a time dependent extension that is a set of object identifiers

Object identity zEvery object is identified by an object identifier zThe object identifier does not change during the life span of the object zTwo different objects with different object identifiers may have the same values OID: Name: Simba Age: 11 Weight: 260 OID: Name: Simba Age: 11 Weight: 260

Object identity The relational model Lion(Name, Age, Weight) (Simba, 11, 260) OO-model LION Name:String Age: Integer Weight: Integer OID: Name: Simba Age: 11 Weight: 260

Object identity Why object identifiers are better than keys: Key attributes not stable Key values not stable Object sharing Object identifiers can be used in relational databases but must be maintained by the users

Inheritance The relational model PERSON(SS#, Name, City) EMPLOYEE(SS#, Salary) EMPLOYEE.SS# << PERSON.SS# OO model PERSON SS#: String Name: String City: String EMPLOYEE ISA PERSON Salary: Integer Employees are persons

Inheritance in the relational model PERSON(SS#, Name, City) EMPLOYEE(Emp#, SS#, Salary) EMPLOYEE.SS# << PERSON.SS# PERSON EMPLOYEE ISA PERSON(SS#, Name, City) EMPLOYEE(SS#, Spouse#, Salary) EMPLOYEE.Spouse# << PERSON.SS# PERSON EMPLOYEE spouse

Inheritance in OO databases PERSON SS#:String Name: String City: String EMPLOYEE ISA PERSON Emp#: String Salary: Integer PERSON SS#:String Name: String City: String EMPLOYEE Emp#: String Salary: Integer Spouse: PERSON PERSON EMPLOYEE ISA PERSON EMPLOYEE spouse

Extended base types create table slides ( idint, datedate, captiondocument, picturephoto_CD_image); create table landmarks ( namevarchar(30), locationpoint); Find sunsets within a 20 kilometers radius around Sacramento. select id from slides P, landmarks L S where sunset (P.picture) and contains (P.caption, L.name) and L.location |20| S.location and S.name = 'Sacramento';

Types of DBMSs Queries No queries Simple data Complex data File systems Relational OO/OR OO

Why do we like types? zTypes facilitate understanding zTypes enable compact representations zTypes enable query optimisation zTypes facilitate consistency enforcement

Background assumptions for typed data zData stable over time zOrganisational body to control data zExercise: Give an example of a context where these assumptions do not hold

Semistructured data Semistructured data is schemaless and self describing The data and the description of the data are integrated

Label-value pairs z{name: “John”, tel: , Label Value “John” name tel

Nested label-value pairs {name: {first: “John”, last: “Smith”}, tel: , “John” “Smith” name tel first last

Duplicate labels {name: {first: “John”, last: “Smith”}, tel: , tel: , tel: ,

Representing variations {person: {name: “John”, tel: , person: {name: “John”, person: {name: “John”, age: 33, person: {name: “John”, tel: , tel: }}

Representing relational data Regno Manuf Weight AA11 Volvo 1100 CC33 Volvo 900 EE55 Saab 1000 Ssno City Weight 1122 London Paris Berlin 80 CAR PERSON {CAR: {row: {Regno: “AA11”, Manuf: “Volvo”, Weight: 1100}, {row: {Regno: “CC33”, Manuf: “Volvo”, Weight: 900}, {row: {Regno: “EE55”, Manuf: “Saab”, Weight: 1000}}, PERSON: {row: {Ssno: “1122”, City: “London”, Weight: 80}, {row: {Ssno: “2233”, City: “Paris”, Weight: 70}, {row: {Ssno: “3344”, City: “Berlin”, Weight: 80}}}

An object graph person name age child &o1&o2 “Eva” 40 “Abel” 20 This graph represents two people, Eva and Abel, where Abel is the child of Eva. &o1 and &o2 are object identifiers denoting the people Eva and Abel.

Representing objects person name age child &o1&o2 “Eva” 40 “Abel” 20 {person: &o1{name: “Eva”, age: 40, child: &o2}, person: &o2{name: “Abel”, age: 20}} An object identifier, such as &o1, before a structure, binds the object identifier to the identity of that structure. The object identifier can then be used to refer to the structure.

Finding Info on the Web Suppose you spot the following news article in a paper and want to find contact information to the relevant scientists. What do you do? A group of scientists from New Zealand have discovered a gene, called ADB, which increases the risk of catching the flu. The discovery was made possible thanks to the detailed registration in New Zealand of flu patients.

Searching and Navigating This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is This may cause flu. about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is A gene called ADB about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is A gene called ADB about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. This paper is about gentic causes to contagious diseases. Genetic Causes to Disease Peter Black, Eric, Green New Zealand University Contact info flu ADB gene

The Semantic Web zStructuring data in documents yXML (eXtensible Markup Language) zStructuring data about documents yRDF (Resource Description Framework) zStructuring the semantics of domains yOntologies - shared conceptualisations

Course goals zThe course will familiarise the student with:  database models and query languages with respect to expressiveness and usability  theory and principles of object data bases  semistructured data and its applications  application areas for object and relational databases  interactive and embedded query languages  Semantic Web, including ontologies

Lectures 1. Introduction to data models 2. Query languages for relational databases 3. Models and query languages for object databases 4. Embedded query languages 5. Models and query languages for semistructured data, XML 6. Semantic Web, introduction 7. Semantic Web, continued