QSQL: Incorporating Logic-based Retrieval Conditions into SQL

Similar documents
QQL: A DB&IR Query Language

Boolean and Vector Space Retrieval Models

Efficient query evaluation

Propositional logic (revision) & semantic entailment. p. 1/34

Database Applications (15-415)

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Propositions. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 5.1, Page 1

Quantum Query Processing: Unifying Database Querying and Information Retrieval

A Dichotomy. in in Probabilistic Databases. Joint work with Robert Fink. for Non-Repeating Queries with Negation Queries with Negation

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Propositional Logic: Review

Notes. Corneliu Popeea. May 3, 2013

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Fuzzy Systems. Introduction

A Zadeh-Norm Fuzzy Description Logic for Handling Uncertainty: Reasoning Algorithms and the Reasoning System

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

CAIM: Cerca i Anàlisi d Informació Massiva

Foundations of Artificial Intelligence

Sound and Efficient Language-Integrated Query

From Constructibility and Absoluteness to Computability and Domain Independence

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation

22c:145 Artificial Intelligence

Comp487/587 - Boolean Formulas

Propositional Logic: Logical Agents (Part I)

KLMLean 2.0: a Theorem Prover for KLM Logics of Nonmonotonic Reasoning

Outline. Overview. Syntax Semantics. Introduction Hilbert Calculus Natural Deduction. 1 Introduction. 2 Language: Syntax and Semantics

Propositional logic. First order logic. Alexander Clark. Autumn 2014

Chap 2: Classical models for information retrieval

Propositional Logic: Part II - Syntax & Proofs 0-0

Relational Algebra on Bags. Why Bags? Operations on Bags. Example: Bag Selection. σ A+B < 5 (R) = A B

Fuzzy Systems. Introduction

Encoding formulas with partially constrained weights in a possibilistic-like many-sorted propositional logic

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

A FUZZY LINGUISTIC IRS MODEL BASED ON A 2-TUPLE FUZZY LINGUISTIC APPROACH

Advanced Topics in LP and FP

Propositional Logic: Semantics and an Example

Introduction to fuzzy logic

Artificial Intelligence Knowledge Representation I

CS47300: Web Information Search and Management

Database Applications (15-415)

The Complexity of Optimization Problems

Where are we? Operations on fuzzy sets (cont.) Fuzzy Logic. Motivation. Crisp and fuzzy sets. Examples

Probabilistic Databases

Some consequences of compactness in Lukasiewicz Predicate Logic

Information Retrieval and Web Search

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

if t 1,...,t k Terms and P k is a k-ary predicate, then P k (t 1,...,t k ) Formulas (atomic formulas)

Propositional and Predicate Logic - V

Announcements. Today s Menu

Propositional Logic: Logical Agents (Part I)

Representing and Querying Correlated Tuples in Probabilistic Databases

Propositional Resolution Introduction

Propositional Logic Part 1

Artificial Intelligence Chapter 7: Logical Agents

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Foundations of Artificial Intelligence

Lecture 2: Syntax. January 24, 2018

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

Profiling Sets for Preference Querying

A uniform programming language for implementing XML standards

The Veracity of Big Data

Interval Neutrosophic Sets and Logic: Theory and Applications in Computing

CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents

Knowledge-based Agents. CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents. Outline. Knowledge-based Agents

An Introduction to Modal Logic III

Lineage implementation in PostgreSQL

Propositional Logic: Models and Proofs

A Logic Primer. Stavros Tripakis University of California, Berkeley

P Q1 Q2 Q3 Q4 Q5 Tot (60) (20) (20) (20) (60) (20) (200) You are allotted a maximum of 4 hours to complete this exam.

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Non-Approximability Results (2 nd part) 1/19

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS

Reasoning Under Uncertainty: Introduction to Probability

Yet Another Proof of the Strong Equivalence Between Propositional Theories and Logic Programs

Fuzzy Answer Set semantics for Residuated Logic programs

Motivation. User. Retrieval Model Result: Query. Document Collection. Information Need. Information Retrieval / Chapter 3: Retrieval Models

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Part 1: Propositional Logic

Definite Logic Programs

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

Quantum Searching. Robert-Jan Slager and Thomas Beuman. 24 november 2009

CS156: The Calculus of Computation

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

Lecture 1: Logical Foundations

Inference in Propositional Logic

Fundamentos lógicos de bases de datos (Logical foundations of databases)

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

CSE 562 Database Systems

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

In general if we define on this set an operation of connotative product the result is not interpretable and may not make any sense.

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

Introduction to Artificial Intelligence. Logical Agents

In-Database Factorised Learning fdbresearch.github.io

Artificial Intelligence

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research Almaden. Lecture 4 Part 1

Transcription:

QSQL: Incorporating Logic-based Retrieval Conditions into SQL Sebastian Lehrack and Ingo Schmitt Brandenburg University of Technology Cottbus Institute of Computer Science Chair of Database and Information Systems DOAG 2010 - Nuremberg 17/11/2010

Outline Motivation CQQL retrieval model Incorporating CQQL concepts into SQL Experiments and outlook

Motivation example TV sets Name Handling Image quality OSP Sound quality............... Scenario: assessment of TV sets Properties handling, image quality and sound quality are rated by marks between 1 (best) and 6 (worst) Query: I want to find a device with a handling as easy as possible and the best possible quality of image. If a device has not a link to a sound system, the internal sound quality has to be as high as possible. 3

Motivation example (ha 1 iq 1) (osp = no sq 1) Introducing similarity predicates for modeling vague conditions handling as easy as possible best possible quality of image... Similarity predicates are indicated by and are evaluated to a score value [0, 1] Score value expresses the degree of fulfilling Boolean evaluation with a threshold mark given by 2: 4

Motivation example Evaluation? classical approach Boolean logic Boolean evaluation needs a threshold mark for vague conditions given by 2: TV sets Name Handling Image quality OSP Sound quality TV1 2 (True) 2 (True) yes (True) 3 (False) TV2 2 (True) 1 (True) yes (True) 1 (True) TV3 1 (True) 2 (True) no (False) 1 (True) TV4 3 (False) 1 (True) no (False) 4 (False)............... Result set includes TV1, TV2 and TV3 TV2 would be the best one 5

Consequences Integrating impreciseness and proximity into a logic-based query language by introducing similarity predicates Combination of Boolean predicates: osp=no truth value {true, false} and Similarity predicates: handling 1 score value [0, 1] within a logical query language Based on score values ranking becomes possible 6

Related approaches Boolean logic with threshold values [Oracle08] Fuzzy logic [Zadeh65] Semantics are defined by aggregation functions without a semantical model Probabilistic Many-World-Semantics [MayBMS09, Trio09] Probabilities for different possible worlds/states must be modeled in advanced Aggregation of probabilities without an inherent semantical model [Roelleke08] Correct aggregation semantics have to be preserved by users 7

Outline Motivation CQQL retrieval model Incorporating CQQL concepts into SQL Experiments and outlook

Calculus query language: CQQL CQQL: Commuting Quantum Query Language Extends the relational domain calculus (,,,,, R i (X, Y ),...) by integrating a similarity operator ( ) Based on a retrieval model using the vector space model of quantum mechanic and logic Detailed mathematical description of this model is omitted in this talk 9

Basic idea Query processing CQQL model value domain vector space tuple vector query condition space evaluation result squared cosine of the angle between vector and condition space 10

Basic idea Query processing CQQL model value domain vector space tuple vector query condition space evaluation result squared cosine of the angle between vector and condition space 11

Basic idea Query processing CQQL model value domain vector space tuple vector query condition space evaluation result squared cosine of the angle between vector and condition space 12

Basic idea Query processing CQQL model value domain vector space tuple vector query condition space evaluation result squared cosine of the angle between vector and condition space 13

Evaluation of a CQQL query After a syntactically normalisation a condition can be recursively evaluated by sv(t i, q) := ϕ(ti attr, q) if q is an atom eval(t i, q 1 q 2 ) := eval(t i, q 1 ) eval(t i, q 2 ) eval(t i, q 1 q 2 ) := eval(t i, q 1 ) + eval(t i, q 2 ) - eval(t i, q 1 q 2 ) eval(t i, q) := 1 eval(t i, q) Can also be interpreted as probability aggregation of independent events 14

Evaluation of a CQQL query After a syntactically normalisation a condition can be recursively evaluated by eval(t i, q) := ϕ(ti attr, q) if q is an atom eval(t i, q 1 q 2 ) := eval(t i, q 1 ) eval(t i, q 2 ) eval(t i, q 1 q 2 ) := eval(t i, q 1 ) + eval(t i, q 2 ) - eval(t i, q 1 q 2 ) eval(t i, q) := 1 eval(t i, q) Can also be interpreted as probability aggregation of independent events 15

Evaluation of a CQQL query After a syntactically normalisation a condition can be recursively evaluated by eval(t i, q) := ϕ(ti attr, q) if q is an atom eval(t i, q 1 q 2 ) := eval(t i, q 1 ) eval(t i, q 2 ) eval(t i, q 1 q 2 ) := eval(t i, q 1 ) + eval(t i, q 2 ) eval(t i, q 1 q 2 ) eval(t i, q) := 1 eval(t i, q) Can also be interpreted as probability aggregation of independent events 16

Evaluation of a CQQL query After a syntactically normalisation a condition can be recursively evaluated by eval(t i, q) := ϕ(ti attr, q) if q is an atom eval(t i, q 1 q 2 ) := eval(t i, q 1 ) eval(t i, q 2 ) eval(t i, q 1 q 2 ) := eval(t i, q 1 ) + eval(t i, q 2 ) - eval(t i, q 1 q 2 ) eval(t i, q) := 1 eval(t i, q) Can also be interpreted as probability aggregation of independent events 17

Outline Motivation CQQL retrieval model Incorporating CQQL concepts into SQL Experiments and outlook

QSQL characteristics Designed as a SQL dialect Covers the core functionality of SQL-92: selection, projection, union,... Query processing is performed by a mapping between QSQL and SQL-99 Implemented as JDBC driver library for the Oracle DBS QSQL SQL-99 Java application QSQL-Library Normalisation Transformation JDBC-Driver Oracle DBS 19

Selection Similarity conditions are placed in the where-clause Attribute scoreval is automatically generated Example query: Determine all available TV sets with a handling as easy as possible. Syntax in QSQL: select name from tv_set where ( status= available and ha ~ 1 ) and scoreval > 0 order by scoreval desc 20

Selection Mapping to SQL-99 by using auxiliary functions implemented in PL/SQL: Score functions HA_TO_SCORE,... Logical connector functions LAND,...... Mapping to SQL-99: select name, LAND( EQUAL( status, available ), HA_TO_SCORE( ha, 1 ) ) as scoreval from tv_set where scoreval > 0 order by scoreval desc 21

Union Example query: Determine all producers which are capable to offer a TV set or a DVD player with a handling as easy as possible. Syntax in QSQL: select producer from tv_set where ha ~ 1 union select producer from dvd_player where ha ~ 1 22

Union Evaluation semantics for E = E 1 E 2 Score value computation is split in three cases sv E1 (t) + sv E2 (t) sv E1 (t) sv E2 (t) if t E 1 t E 2 sv E (t) = sv E1 (t) if t E 1 t / E 2 sv E2 (t) if t / E 1 t E 2 23

Mapping to SQL-99: Union select producer, max( scoreval ) as scoreval from ( select E1.producer, LOR( E1.scoreval, E2.scoreval ) as scoreval from ( select producer, HA_TO_SCORE( ha, 1 ) as scoreval from tv_set ) E1, ( select producer, HA_TO_SCORE( ha, 1 ) as scoreval from dvd_player ) E2 where E1.producer = E2.producer union all select producer, HA_TO_SCORE( ha, 1 ) as scoreval from tv_set where producer not in ( select producer from dvd_player ) union all select producer, HA_TO_SCORE( ha, 1 ) as scoreval from dvd_player where producer not in ( select producer from tv_set ) ) group by producer 24

Outline Motivation CQQL retrieval model Incorporating CQQL concepts into SQL Experiments and outlook

Experiments Test parameters: Table of 100,000 artificial TV sets Query: (ha 1 iq 1) (osp = no sq 1) Implemented on an Oracle 11g DBS Boolean-based evaluation is clearly faster Final sorting step is crucial Approach Seconds SQL 0.04 QSQL/unsorted 0.14 Skyline 1.01 Fuzzy/sorted 19.01 QSQL/sorted 19.25 26

Outlook Extending QSQL by further operations Implementation of a k-top operator to avoid a full sorting Applying more efficient mapping techniques 27

End Thank you for your attention. 28