SchemaLog – A Visual Perspective CPSC 534B Laks V.S. Lakshmanan UBC (names of schema components abbreviated.)

Slides:



Advertisements
Similar presentations
1 Datalog: Logic Instead of Algebra. 2 Datalog: Logic instead of Algebra Each relational-algebra operator can be mimicked by one or several Database Logic.
Advertisements

Relational Calculus and Datalog
CSE 636 Data Integration Conjunctive Queries Containment Mappings / Canonical Databases Slides by Jeffrey D. Ullman.
Query Folding Xiaolei Qian Presented by Ram Kumar Vangala.
CPSC 504: Data Management Discussion on Chandra&Merlin 1977 Laks V.S. Lakshmanan Dept. of CS UBC.
1 CHAPTER 4 RELATIONAL ALGEBRA AND CALCULUS. 2 Introduction - We discuss here two mathematical formalisms which can be used as the basis for stating and.
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.
Relational Algebra Dashiell Fryer. What is Relational Algebra? Relational algebra is a procedural query language. Relational algebra is a procedural query.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
SECTION 21.5 Eilbroun Benjamin CS 257 – Dr. TY Lin INFORMATION INTEGRATION.
Efficient Query Evaluation on Probabilistic Databases
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Foundations of Constraint Processing, Fall 2005 October 21, 2005CSPs and Relational DBs1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
CSE 636 Data Integration Datalog Rules / Programs / Negation Slides by Jeffrey D. Ullman.
2005conjunctive1 Query languages, equivalence & containment  conjunctive queries – CQ’s  More expressive languages.
2005lav-iii1 The Infomaster system & the inverse rules algorithm  The InfoMaster system  The inverse rules algorithm  A side trip – equivalence & containment.
Algebraic Laws Commutative and Associative Laws Commutativity for Sets and Bags (Ch5): R x S = S x R (Proof) R  S = S  R (ch5 e) R U S = S U.
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
CPSC 504: Data Management Review of Relational Model 2/2 Laks V.S. Lakshmanan Dept. of CS UBC.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Deductive Databases Chapter 25
Relational Algebra Instructor: Mohamed Eltabakh 1.
The Relational Model: Relational Calculus
Database Management Systems, R. Ramakrishnan1 Relational Calculus Chapter 4.
SQL Part I: Standard Queries. COMP-421: Database Systems - SQL Queries I 2 Example Instances sid sname rating age 22 debby debby lilly.
Database Management Systems,1 Relational Calculus.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science Database Applications Lecture#6: Relational calculus.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Relational Algebra.
Datalog Inspired by the impedance mismatch in relational databases. Main expressive advantage: recursive queries. More convenient for analysis: papers.
Answering Queries Using Views LMSS’95 Laks V.S. Lakshmanan Dept. of Comp. Science UBC.
CSE 636 Data Integration Conjunctive Queries Containment Mappings / Canonical Databases Slides by Jeffrey D. Ullman Fall 2006.
1 Relational Algebra and Calculas Chapter 4, Part A.
Chapter 5 Notes. P. 189: Sets, Bags, and Lists To understand the distinction between sets, bags, and lists, remember that a set has unordered elements,
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Module A: Formal Relational.
Computing & Information Sciences Kansas State University Wednesday, 17 Sep 2008CIS 560: Database System Concepts Lecture 9 of 42 Wednesday, 18 September.
Row Types in SQL-3 Row types define types for tuples, and they can be nested. CREATE ROW TYPE AddressType{ street CHAR(50), city CHAR(25), zipcode CHAR(10)
CPSC 404, Laks V.S. Lakshmanan1 Overview of Query Evaluation Chapter 12 Ramakrishnan & Gehrke (Sections )
Lu Chaojun, SJTU 1 Extended Relational Algebra. Bag Semantics A relation (in SQL, at least) is really a bag (or multiset). –It may contain the same tuple.
CPSC 404, Laks V.S. Lakshmanan1 Evaluation of Relational Operations – Join Chapter 14 Ramakrishnan and Gehrke (Section 14.4)
SCUHolliday - coen 1787–1 Schedule Today: u Subqueries, Grouping and Aggregation. u Read Sections Next u Modifications, Schemas, Views. u Read.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
Presented by Kyumars Sheykh Esmaili Description Logics for Data Bases (DLHB,Chapter 16) Semantic Web Seminar.
Welcome to CPSC 534B: Information Integration Laks V.S. Lakshmanan Rm. 315.
Instance Discovery and Schema Matching With Applications to Biological Deep Web Data Integration Tantan Liu, Fan Wang, Gagan Agrawal {liut, wangfa,
Problem Solving with Constraints CSPs and Relational DBs1 Problem Solving with Constraints CSCE496/896, Fall
Written By: Presented By: Swarup Acharya,Amr Elkhatib Phillip B. Gibbons, Viswanath Poosala, Sridhar Ramaswamy Join Synopses for Approximate Query Answering.
1. Chapter 2: The relational Database Modeling Section 2.4: An algebraic Query Language Chapter 5: Algebraic and logical Query Languages Section 5.1:
CS589 Principles of DB Systems Fall 2008 Lecture 4d: Recursive Datalog with Negation – What is the query answer defined to be? Lois Delcambre
Relational Calculus. Relational calculus query specifies what is to be retrieved rather than how to retrieve it. – No description of how to evaluate a.
Extensions of Datalog Wednesday, February 13, 2001.
CS589 Principles of DB Systems Fall 2008 Lecture 4c: Query Language Equivalence Lois Delcambre
Chapter 8 Relational Calculus.
Basic Operations Algebra of Bags
Schedule Today: Next After that Subqueries, Grouping and Aggregation.
Goal for this lecture Demonstrate how we can prove that one query language is more expressive than (i.e., “contained in” as described in the book) another.
Chapter 6: Formal Relational Query Languages
Notes Over 2.1 Function {- 3, - 1, 1, 2 } { 0, 2, 5 }
CSPs and Relational DBs
Basic Operations Algebra of Bags
Problem Solving with Constraints
Dr. Fowler  CCM Functions.
Logic Based Query Languages
Chapter 6: Formal Relational Query Languages
Datalog Inspired by the impedance mismatch in relational databases.
Database Dr. Roueida Mohammed.
Problem Solving with Constraints
Problem Solving with Constraints
Chapter 27: Formal-Relational Query Languages
Entity-Relationship Modelling
Presentation transcript:

SchemaLog – A Visual Perspective CPSC 534B Laks V.S. Lakshmanan UBC (names of schema components abbreviated.)

Basic Queries … … p s P S 1 dbStateA salesInfo … … P S 2 dbStateB salesInfo … … s S 3 dbStateC P S 1 > 15M & S 2 > 15M & S 3 > 15M. All positions treated alike. Condition box. Distinguished (i.e., output variables.) Conjunctive query!

Basic Queries (contd.) … … b P B S 2 dbStateB salesInfo … … b s B S 3 dbStateC P S 2 > 20M & S 3 > 20M.

Basic Queries – Observations Can use variables anywhere. Positions tell which is which. Order of arguments doesn’t matter. Arguments are named (unlike in datalog or standard FOL or RC). Tuple var’s – use is mostly existential (for now.) So far, output = set of tuples of bindings of (distinguished) variables. How to: Express union of CQs? Recursive queries? (what is recursion for SchemaLog anyway?) Construct output in a way we’d like? E.g., one relation per brand in Q 2.

Output construction (1) … … t S stocks … … d c D P S … … d S D P c D

Output construction (2) … … t S stocks … … d X D P S … … d S D P X D X date

Other issues. Try out other possibilities. What output structure do you get in each case? Union of CQs = set of (non-recursive) rules. So what’s recursion? Relation var’s can cause recursion, depending on semantics adopted.

What’s recursion in SchemaLog? Example Template:  db::X[ ], …. Remember: want to assume safety of rules. Def. Similar to that for datalog. Question: What does X range over? Does it include only existing database relations? Or does it also include newly created ones?

What’s recursion? Concrete Example: in::out[f(T,U): a->A, c->B]  in::X[T: a->A, Any->Y], Any <> a, Any <> b, in::r[U: Any->Y, b->B]. Consider instance of in database: a c … … r c b … … s Does X range over {r, s} or over {r, s, out}? Former case: no recursion Latter case: recursion, since: + can join r and s + but also out and s while creating out!

More on SchemaLog recursion. Call former case “restricted semantics” and latter case “unrestricted semantics”. Try previous example with your own sample data. Can you predict max. # iterations needed to evaluate relation out no matter what the input database? Use unrestricted semantics. For datalog, recursion = cycle(s) in predicate dependency graph. How would you characterize recursion in SchemaLog (under either semantics)?

Using function symbols. SchemaLog allows arbitrary first- order terms in each position – db, relation, attribute, value, tuple-id. Makes for powerful restructuring (and hence visualization) of information.