Information Systems & Semantic Web University of Koblenz Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk TexPoint fonts used in.

Slides:



Advertisements
Similar presentations
Information Systems & Semantic Web University of Koblenz Landau, Germany Advanced Data Modeling Relational Data Model continued Steffen Staab with Simon.
Advertisements

Information Systems & Semantic Web University of Koblenz Landau, Germany Ontologies for Model Engineering of Complex Systems.
Relational data objects 1 Lecture 6. Relational data objects 2 Answer to last lectures activity.
osnabrueck.de 1 Recognition of Credits - Achievements and Problems / Challenges A Stocktaking Exercise Bologna Conference Riga Dec.3-5.
Bernhard Zeller Alfons Kemper University of * This work was supported by an SAP contract within the so-called Terabyte-Project.
CS848: Topics in Databases: Foundations of Query Optimization Topics covered  Introduction to description logic: Single column QL  The ALC family of.
Lecture 11: Datalog Tuesday, February 6, Outline Datalog syntax Examples Semantics: –Minimal model –Least fixpoint –They are equivalent Naive evaluation.
COMP 5138 Relational Database Management Systems Semester 2, 2007 Lecture 5A Relational Algebra.
Relational Model Table = relation. Column headers = attributes. Row = tuple Beers Relation schema = name(attributes) + other structure info., e.g., keys,
Chapter 3 : Relational Model
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
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.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Web Science & Technologies University of Koblenz ▪ Landau, Germany Advanced Data Modeling Minimal Models Steffen Staab TexPoint fonts used in EMF. Read.
SECTION 21.5 Eilbroun Benjamin CS 257 – Dr. TY Lin INFORMATION INTEGRATION.
1 Relational Algebra & Calculus. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.  Relational.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
Web Science & Technologies University of Koblenz ▪ Landau, Germany Advanced Data Modeling Steffen Staab.
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Chapter 4 The Relational Model Pearson Education © 2014.
Introduction to Accounting Information Systems
THE RELATIONAL DATA MODEL CHAPTER 3 (6/E) CHAPTER 5 (5/E) 1.
FEN  Concepts and terminology  Operations (relational algebra)  Integrity constraints The relational model.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
Lecture 05 Structured Query Language. 2 Father of Relational Model Edgar F. Codd ( ) PhD from U. of Michigan, Ann Arbor Received Turing Award.
Chapter 2 Adapted from Silberschatz, et al. CHECK SLIDE 16.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – Relational Model.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Relational Algebra (Chapter 7)
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
1 Relational Algebra & Calculus Chapter 4, Part A (Relational Algebra)
1 Relational Algebra and Calculas Chapter 4, Part A.
Chapter 2 Introduction to Relational Model. Example of a Relation attributes (or columns) tuples (or rows) Introduction to Relational Model 2.
Chapter 2: Intro to Relational Model. 2.2 Example of a Relation attributes (or columns) tuples (or rows)
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Introduction.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Presented By: Miss N. Nembhard. Relation Algebra Relational Algebra is : the formal description of how a relational database operates the mathematics.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Relational Data Model.
Presented by Kyumars Sheykh Esmaili Description Logics for Data Bases (DLHB,Chapter 16) Semantic Web Seminar.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Information Systems & Semantic Web University of Koblenz ▪ Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk.
Chapter 3 The Relational Model. Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. “Legacy.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Information Systems & Semantic Web University of Koblenz ▪ Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk TexPoint fonts used in.
CSE202 Database Management Systems
CS4432: Database Systems II
Chapter 2: Relational Model
Entity-Relationship Model
Chapter 2: Intro to Relational Model
Relational Algebra Chapter 4 1.
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Lecture 2 The Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Relational Algebra Chapter 4 1.
The Relational Model Textbook /7/2018.
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
INSTRUCTOR: MRS T.G. ZHOU
Relational Model B.Ramamurthy 5/28/2019 B.Ramamurthy.
Lecture 2 Relational Database
Presentation transcript:

Information Systems & Semantic Web University of Koblenz Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AAA

ISWeb - Information Systems & Semantic Web Steffen Staab Recursion connected(StartPoint, EndPoint) :- arc(StartPoint, EndPoint). connected(StartPoint, EndPoint) :- arc(StartPoint, NextPoint), connected(NextPoint, EndPoint).

ISWeb - Information Systems & Semantic Web Steffen Staab Recursion StartPoint and EndPoint are connected if StartPoint and EndPoint are connected by an arc or there exists an intermediate point NextPoint such that StartPoint and NextPoint are connected by an arc and NextPoint and EndPoint are connected.

ISWeb - Information Systems & Semantic Web Steffen Staab Integrity constraints Each class has at least one lecturer: x (class(x) y lecturer(y, x)). Each class has at most one lecturer: x(class(x) y z(lecturer(y, x) lecturer(z, x) y=z).

ISWeb - Information Systems & Semantic Web Steffen Staab Complex values route(StartPoint, EndPoint, [StartPoint, EndPoint]) :- arc(StartPoint, EndPoint). route(StartPoint, EndPoint, [StartPoint | Route]) :- arc(StartPoint, NextPoint), route(NextPoint, EndPoint, Route).

ISWeb - Information Systems & Semantic Web Steffen Staab Problems Combinations of following three features create problems with defining semantics of deductive databases and designing query answering algorithms for them: Negation; Recursion; Complex values. Restrictions may be required on the use of (combinations of) these features.

ISWeb - Information Systems & Semantic Web Steffen Staab SWI Prolog:

ISWeb - Information Systems & Semantic Web Steffen Staab Soccer database % EXTENSIONAL DATABASE % Relation nextLeague describes the hierarchy of leagues in % UK nextLeague(league2, league1). nextLeague(league1, championship). nextLeage(championship, premier).

ISWeb - Information Systems & Semantic Web Steffen Staab % the list of clubs club(arsenal). club(watford). club(leedsU). club(miltonKeynesDons). % the list of leagues of clubs league(arsenal, premier). league(watford, championship). league(leedsU, league1). league(miltonKeynesDons, league2).

ISWeb - Information Systems & Semantic Web Steffen Staab % the list of players and where they are playing player(andy,arsenal). player(wim,watford). player(liam, leedsU). player(mike, miltonKeynesDons).

ISWeb - Information Systems & Semantic Web Steffen Staab % some players foul other players foul(andy,wim). foul(andy,bert). foul(andy,chris). foul(andy,dan). foul(wim, andy). foul(wim, dan).

ISWeb - Information Systems & Semantic Web Steffen Staab Soccer database % INTENSIONAL DATABASE % Relation nextLeagues describes the order on leagues % It is defined as the transitive closure of nextLeague higherLeague(LowerLeague, HigherLeague) :- nextLeague(LowerLeague, HigherLeague). higherLeague(LowerLeague, HigherLeague) :- nextLeague(LowerLeague, MiddleLeague), higherLeague(MiddleLeague, HigherLeague).

ISWeb - Information Systems & Semantic Web Steffen Staab % A higher-leagued club is a club who is in a higher league higherLeaguedClub(Higher, Lower) :- league(Higher, HigherLeague), league(Lower, LowerLeague), higherLeague(LowerLeague, HigherLeague).

ISWeb - Information Systems & Semantic Web Steffen Staab % likes is a relation among players. % (i) every player likes himself like(Player, Player) :- player(Player). % (ii) every player likes all players in higher-ranked clubs like(Lower, Higher) :- player(Lower, LowerClub), player(Higher, HigherClub), higherRankedClub(HigherClub, LowerClub).

ISWeb - Information Systems & Semantic Web Steffen Staab % (iii) a player likes a lower-ranked player when % players of the lower-ranked club % do not foul other players of his club likes(Higher, Lower) :- player(Higher, HigherClub), lower(LowerClub), higherRankedClub(HigherClub, LowerClub), not hasPlayerWhoFoulsSomePlayerFrom(LowerClub, HigherClub).

ISWeb - Information Systems & Semantic Web Steffen Staab % an auxiliary relation: hasPlayerWhoFoulsSomePlayerFrom hasPlayerWhoFoulsSomePlayerFrom(Club1, Club2) :- player(Player1, Club1), player(Player2, Club2), foul(Player1, Player2).

ISWeb - Information Systems & Semantic Web Steffen Staab % INTEGRITY CONSTRAINTS % every club has a league 8 x(club(x) ! 9 y league(x, y)). % only premier league player may foul more than one player 8 p, c, z1, z2 (player(p,c) Æ foul(p, z1) Æ foul(p, z2) ! z1 = z2 Ç league(c, premier)).

Information Systems & Semantic Web University of Koblenz Landau, Germany Relational Data Model

ISWeb - Information Systems & Semantic Web Steffen Staab Overview Relational data model; Tuples and relations; Schemas and instances; Named vs. unnamed perspective; Relational algebra;

ISWeb - Information Systems & Semantic Web Steffen Staab Table PlayerBirth Year Andy1980 Wim1975 Liam1985 Mike1988 Bert1971

ISWeb - Information Systems & Semantic Web Steffen Staab Observations The rows of the table contain pairs occurring in the relation player. There are two columns, labeled respectively by name and birth year. The values in each column belong to different domains of possible values.

ISWeb - Information Systems & Semantic Web Steffen Staab How to specify a relation 1.specifying the names of the columns (also called fields or attributes); 2. specifying a domain of possible values for each column; 3. enumerate all tuples in the relation. (1)–(2) refer to the schema of this relation, while (3) to an instance.

ISWeb - Information Systems & Semantic Web Steffen Staab Domains and attributes A set of domains (sets of values); A set of corresponding domain names d 1, d 2, … A set of attributes a 1, a 2, …

ISWeb - Information Systems & Semantic Web Steffen Staab Relation Schema and Instances Tuple: any finite sequence (v 1, …, v n ). n is the arity of this tuple. Relation schema: r(a 1 :d 1, …, a n :d n ) where n ¸ 0, r is a relation name, a 1, …, a n are distinct attributes, d 1, …, d n are domain names. Relation instance: finite set of tuples (v 1, …, v n ) of arity n such that v i 2 D i for all i.

ISWeb - Information Systems & Semantic Web Steffen Staab Observation 1.The attributes in each column must be unique. 2. A relation is a set. Therefore, when we represent a relation by a table, the order of rows in the table does not matter. Let us add to this: 3. The order of attributes does not matter.

ISWeb - Information Systems & Semantic Web Steffen Staab New notation for tuples A tuple is a set of pairs { (a 1, v 1 ), …, (a n, v n ) } denoted by { a 1 =v 1, …, a n =v n }, Let d 1, …, d n be domain names and be the corresponding domains. The tuple conforms to a relation schema r(a 1 :d1, …, a n :d n ) if v i 2 D i for all i.

ISWeb - Information Systems & Semantic Web Steffen Staab Relational data are structured Note that in the relational data model tuples stored in a table are structured: all tuples conform to the same relation schema; the values in the same column belong to the same domain. Untyped perspective: there is a single domain, so the second condition can be dropped.

ISWeb - Information Systems & Semantic Web Steffen Staab Typed or untyped? Consider the relation admire: admireradmired wimandy mikewim liamandy liamarsenal

ISWeb - Information Systems & Semantic Web Steffen Staab Database schema and instance Relational database schema: a collection of relation schemas with distinct relation names. Relational database instance conforming to a relational database schema S: a mapping I from the relation names of S to relation instances such that for every relation schema r(a 1 :d 1, …, a n :d n ) in S the relation instance I(r) conforms to this relation schema.

ISWeb - Information Systems & Semantic Web Steffen Staab Unnamed perspective No attributes a tuple is simply a sequence (v_1, …, v_n) of values. The components of tuples can therefore be identified by their position in the tuple.

ISWeb - Information Systems & Semantic Web Steffen Staab From Unnamed to Named Perspective Introduce a collection of attributes #1,#2, …, identify tuple (v 1, …, v n ) with the tuple { #1 = v 1, …,#n = v n }. Likewise, identify relation schema r(d 1, …, d n ) with r(#1:d 1, …,#n:d n ).

ISWeb - Information Systems & Semantic Web Steffen Staab Relational Algebra and SQL 1. Can define new relations from existing ones; 2. Uses a collection of operations on relations to do so.

ISWeb - Information Systems & Semantic Web Steffen Staab Constant { (v 11, …, v 1n ), ….. (v k1, …, v kn ) }

ISWeb - Information Systems & Semantic Web Steffen Staab Union R 1 [ R 2 = {(c 1, …, c k ) | (c 1, …, c k ) 2 R 1 or (c 1, …, c k ) 2 R 2 }

ISWeb - Information Systems & Semantic Web Steffen Staab Set difference R_1 - R2 = {(c 1, …, c k ) | (c 1, …, c k ) 2 R 1 and (c 1, …, c k ) 2 R 2 }

ISWeb - Information Systems & Semantic Web Steffen Staab Cartesian product R1 £ R2 = {(c 1, …, c k, d 1, …, d m ) | (c1, …, c k ) 2 R 1 and (d 1, …, d m ) 2 R 2 }.

ISWeb - Information Systems & Semantic Web Steffen Staab Projection Let now R be a relation of arity k and i 1, …, i m be numbers in {1, …, k}. ¼ i 1, …, i m (R) = {(c i 1, …, c i m ) | (c 1, …, c k ) 2 R }. We say that ¼ i 1, …, i m (R) is obtained from R by projection (on arguments i 1, …, i m ).

ISWeb - Information Systems & Semantic Web Steffen Staab Selection Assume formulas on domains with variables #1, #2, …. For example, #1 = #2. ¾ F (R) = {(c 1, …, c k ) | (c 1, …, c k ) 2 R and F holds on (c 1, …, c k )}.