believe it or not: adding belief annotations to databaseskanza/dbseminar/2012/believeitornot.pdf ·...

33
27-Feb-13 1 Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer, Magdalena Balazinska, Nodira Khoussainova, and Dan Suciu Presented by: Reut Igra

Upload: others

Post on 07-Aug-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

27-Feb-13 1

Believe It or Not:

Adding Belief

Annotations to

Databases

Wolfgang Gatterbauer, Magdalena

Balazinska, Nodira Khoussainova,

and Dan Suciu

Presented by: Reut Igra

Page 2: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

2 27-Feb-13

Motivation

Community of scientists are assembling

and revising data together.

DB may contain conflicts and

disagreements.

DBMSs provide limited support for

managing conflicts.

Page 3: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

3 27-Feb-13

Previous DB annotations

Annotations as superimposed

information.

Annotation as metadata without unique

semantics.

Page 4: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

4 27-Feb-13

The challenge

To allow for “conflicting annotations”

To support “higher-order annotations”

To support a standard DBMS with

extension of SQL

Page 5: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

5 27-Feb-13

Motivating application

The NatureMapping project

His goal is to record biodiversity of species in

the US state of Washington.

Participates submitted records of animal

sightings, from the field.

Observation included: user-id, species name,

date, location & comments.

BDMS allows multiple experts to annotate.

Page 6: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

6 27-Feb-13

BeliefSQL

Page 7: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

7 27-Feb-13

Example- the use of BDMS (1)

3 users

Alice

Bob

Carol

3 relations

Sightings (sid, uid, species, date, location)

Comments (cid, comment, sid)

Users (uid, name)

Page 8: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

8 27-Feb-13

Example- the use of BDMS (2)

Carol sees a bald eagle: i1:insert into Sightings

values ('s1','Carol','bald eagle','6-14-08','Lake Forest')

Bob doesn’t belief Carol saw a bald eagle: i2:insert into BELIEF 'Bob' not Sightings

values ('s1','Carol','bald eagle','6-14-08','Lake Forest')

Bob also doesn’t belief Carol saw a fish eagle: i3:insert into BELIEF 'Bob' not Sightings

values ('s1','Carol',‘fish eagle','6-14-08','Lake Forest')

Page 9: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

9 27-Feb-13

Example- the use of BDMS (3)

Alice believes there was a crow at Lake Placid, because she found black feathers: i4:insert into BELIEF 'Alice' Sightings

values ('s2','Alice', 'crow','6-14-08','Lake Placid')

i5:insert into BELIEF 'Alice' Comments

values ('c1','found feathers','s2')

Bob believes Alice saw a raven, and the feathers were purple-black: i6:insert into BELIEF 'Bob' Sightings

values ('s2','Alice','raven','6-14-08','Lake Placid')

i7:insert into BELIEF 'Bob' BELIEF 'Alice' Comments

values ('c2','black feathers','s2')

i8:insert into BELIEF 'Bob' Comments

values ('c2','purple-black feathers','s2')

Page 10: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

10 27-Feb-13

Multi-modal logic

= user u believes/doesn’t believes

tuple t

/

u t

Page 11: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

11 27-Feb-13

2 examples queries What sightings at Lake Forest believed by Bob. Returns:

(s2, Alice, raven): q1: select S.skey, S.uid, S.species

from Users as U, BELIEF U.uid Sightings as S

where U.name = 'Bob'

and S.location = 'Lake Forest‘

In which entries, users disagree with Alice. Returns: (Bob, crow, raven): q2: select U2.name, S1.species, S2.species

from Users as U1, Users as U2,

BELIEF U1.uid Sightings as S1,

BELIEF U2.uid Sightings as S2,

where U1.name = 'Alice'

and S1.sid = S2.sid

and S1.species <> S2.species

Page 12: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

12 27-Feb-13

Belief worlds (1)

Belief world- set of beliefs of a user

Consistent DB instances

For example:

What Alice believes

What Bob believes Alice believes

Open World Assumption

Page 13: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

13 27-Feb-13

Belief worlds (2)

Adding a sign attribute ‘s’: ‘+’ or ‘-’, For

example, the belief world ‘Bob believes’:

Page 14: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

14 27-Feb-13

Belief worlds (3)

Allowing a user to disagree with more

than 1 alternative:

i1 : ('s1','Carol','bald eagle','6-14-08','Lake

Forest')+

i9 : Alice('s1','Carol',‘fish eagle','6-14-08','Lake

Forest')+

Bob disagrees with both.

Page 15: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

15 27-Feb-13

Belief DB (1)

A collection of belief worlds

Belief statement using multi-modal logic

“Alice believes that Bob believes that tuple t is

false”:

Equivalent to

A belief path don’t contain the same users in

successive positions.

Bob Alice t

Bob Alice t

Page 16: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

16 27-Feb-13

Belief DB (2)

The belief worlds for:

“Bob believes”:

“Bob believes Alice believes”:

1 2 2 21 , 1 , 2 , 2BobD s s s c

12 ,Bob AliceD c

Page 17: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

17 27-Feb-13

Belief DB (3)

Message board assumption- if a new

user, Dora, joins the system, it needs to

assume by default that Dora believes

everything that is in the DB.

If D is the original belief DB, contains

D, and all statements that follow implicitly.

if

D

|D D

Page 18: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

18 27-Feb-13

Belief DB (4)

After Carol inserted (i1:s1+ ), Alice believes

this by default , but Bob states his disagreement , yet he believes Alice believes this .

1| AliceD s

2 1: Bobi s

1| Bob AliceD s

Page 19: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

19 27-Feb-13

Queries over belief DB

Consisting conjunctive queries extended, with

belief annotation.

Is called Belief Conjunctive Queries (BCQ)

Is of the form:

Returns all users x who disagree with Alice:

1

1 1 1: ,..., g

g

ss

w w g gq x R x R x

A belief path A sign Relational

tuples

3 : , , , , , , , , ,x Aliceq x S y z u v w S y z u v w

Page 20: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

20 27-Feb-13

Canonical Kripke structure (1)

The entailment relationship is defined: , |K v

Page 21: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

21 27-Feb-13

Canonical Kripke structure-

example

Page 22: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

22 27-Feb-13

Translation

Page 23: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

23 27-Feb-13

Query translation Creating 1 temporary table for each sub-goal

Creates 1 query over these tables

Page 24: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

24 27-Feb-13

Query translation- example

A relation R(sample, category, origin)

A query for disputed samples will be:

The query written in BeliefSQL:

Page 25: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

25 27-Feb-13

Query translation- example (cont.)

The translation first creates 2 intermediate

tables:

The final query combines those 2 tables:

Page 26: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

26 27-Feb-13

Updates- Data insert

insert a tuple with sign s into world w-

First- assuring the world w already exists

By verifying that the path w from the root, leads to a

world at depth |w|.

If not- verifying its parents node exist, then creates a

new world id.

Second- checking if the tuple doesn’t

exists, then creates a new entry.

If this tuple is consistent with existing beliefs- inserting

it into world w.

, 'R k x

, 's

w R k x

_, , 'k x

Page 27: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

27 27-Feb-13

Space complexity

Theoretic bounds for the size of a BDMS

in terms of the number of tuples in the

RDBMS.

m-number of users, n- number of

annotations, N- number of states in the

canonical Kripke structure.

The overall DB size is O((n+m)N)

Page 28: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

28 27-Feb-13

Query complexity (1)

3 typical queries:

A “query for content”= “What does Alice believe?”:

A “query for conflicts” = “Which animal sightings does Bob believe Alice believe, which he doesn’t believe himself?”:

A “query for users” = “Who disagrees with any of Alice’s beliefs of sightings at Lake Placid?”:

Page 29: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

29 27-Feb-13

Query complexity (2)

Conclusion: queries in BDMS can be executed in reasonable time on top of a standard RDBMS.

Page 30: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

30 27-Feb-13

Future work

Finding techniques to decrease the

“relative overhead” – the number of tuples

per number of belief annotations.

Applying the default rule selectively, and

during query evaluation, will reduce DB’s

size.

Optimized query time for common queries.

Page 31: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

31 27-Feb-13

Related work

Propagation of annotations during query evaluation.

Annotations are interpreted as colors, values and bundled tuples in tree fragments.

In other works, annotations are seen as simply additional information.

Modal logics was used to manage conflicts in a peer-to-peer system.

There was a work on uncertain and incomplete information before.

Page 32: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

32 27-Feb-13

conclusions

A model of DB annotations that allows

users to annotate content as well as other

users’ annotations with beliefs

Allows users to collaboratively contribute

and curate a shared data.

Allows managing conflicts between

different users.

Page 33: Believe It or Not: Adding Belief Annotations to Databaseskanza/dbseminar/2012/BelieveItOrNot.pdf · Believe It or Not: Adding Belief Annotations to Databases Wolfgang Gatterbauer,

33 27-Feb-13

Questions?