On

the

Complexity

of

Computing

Peer

Agreements

for

Consistent

Query

Answering

in

Peer-to-Peer

Data

Integration

Systems

Peer-to-Peer

-LRB-

-RRB-

data

integration

systems

have

recently

attracted

significant

attention

for

their

ability

to

manage

and

share

data

dispersed

over

different

peer

sources

While

integrating

data

for

answering

user

queries

it

often

happens

that

inconsistencies

arise

because

some

integrity

constraints

specified

on

peers

global

schemas

may

be

violated

In

these

cases

we

may

give

semantics

to

the

inconsistent

system

by

suitably

repairing

the

retrieved

data

as

typically

done

in

the

context

of

traditional

data

integration

systems

However

some

specific

features

of

systems

such

as

peer

autonomy

and

peer

preferences

-LRB-

e.g.

different

source

trusting

-RRB-

should

be

properly

addressed

to

make

the

whole

approach

effective

In

this

paper

we

face

these

issues

that

were

only

marginally

considered

in

the

literature

We

first

present

a

formal

framework

for

reasoning

about

autonomous

peers

that

exploit

individual

preference

criteria

in

repairing

the

data

The

idea

is

that

queries

should

be

answered

over

the

best

possible

database

repairs

with

respect

to

the

preferences

of

all

peers

i.e.

the

states

on

which

they

are

able

to

find

an

agreement

Then

we

investigate

the

computational

complexity

of

dealing

with

peer

agreements

and

of

answering

queries

in

data

integration

systems

It

turns

out

that

considering

peer

preferences

makes

these

problems

only

mildly

harder

than

in

traditional

data

integration

systems

H.

-LSB-

Database

Management

-RSB-

systems

Relational

databases

F.

-LSB-

Analysis

of

Algorithms

and

Problem

Complexity

-RSB-

Nonnumerical

Algorithms

and

Problems

Theory

Management

Permission

to

make

digital

or

hard

copies

of

all

or

part

of

this

work

for

personal

or

classroom

use

is

granted

without

fee

provided

that

copies

are

not

made

or

distributed

for

profit

or

commercial

advantage

and

that

copies

bear

this

notice

and

the

full

citation

on

the

first

page

To

copy

otherwise

to

republish

to

post

on

servers

or

to

redistribute

to

lists

requires

prior

specific

permission

and/or

a

fee

CIKM

October

November

Bremen

Germany

Copyright

ACM

Peer-to-Peer

-LRB-

-RRB-

data

integration

systems

are

networks

of

autonomous

peers

that

have

recently

emerged

as

an

effective

architecture

for

decentralized

data

sharing

integration

and

querying

Indeed

systems

offer

transparent

access

to

the

data

stored

at

-LRB-

the

sources

of

-RRB-

each

peer

p

by

means

of

the

global

schema

equipped

with

p

for

modeling

its

domain

of

interest

moreover

pair

of

peers

with

the

same

domain

of

interest

one

peer

and

the

system

is

in

charge

of

accessing

each

peer

containing

relevant

data

separately

and

combining

local

results

into

a

global

answer

by

suitably

exploiting

the

mapping

rules

systems

can

be

considered

the

natural

evolution

of

traditional

data

integration

systems

which

have

received

considerable

attention

in

the

last

few

years

and

which

have

already

become

a

key

technology

for

managing

enormous

amounts

of

information

dispersed

over

many

data

sources

In

fact

systems

have

attracted

significant

attention

recently

both

in

the

development

of

efficient

distributed

algorithms

for

the

retrieval

of

relevant

information

and

for

answering

user

queries

-LRB-

see

e.g.

-LSB-

-RSB-

-RRB-

and

in

the

investigation

of

its

theoretical

underpinnings

-LRB-

see

e.g.

-LSB-

-RSB-

-RRB-

In

this

paper

we

continue

along

this

latter

line

of

research

by

investigating

some

important

theoretical

issues

In

particular

we

consider

an

expressive

framework

where

integrity

constraints

are

specified

on

peer

schemas

in

order

to

enhance

their

expressiveness

so

that

each

peer

can

be

in

fact

considered

a

completely

specified

data

integration

system

In

this

scenario

it

may

happen

that

data

at

different

peers

are

mutually

inconsistent

i.e.

some

integrity

constraints

are

violated

after

the

integration

is

carried

out

then

a

repair

for

the

system

has

to

be

computed

-LSB-

-RSB-

Roughly

speaking

repairs

may

be

viewed

as

insertions

or

deletions

of

tuples

at

the

peers

that

are

able

to

lead

the

system

to

a

consistent

state

Our

aim

is

to

deal

with

data

integration

in

systems

by

extending

some

of

the

ideas

described

in

previous

studies

on

merging

mutually

inconsistent

databases

into

a

single

consistent

theory

-LSB-

-RSB-

and

on

repairing

individual

data

integration

systems

-LSB-

-RSB-

Indeed

in

order

to

be

effective

in

this

framework

the

repair

approach

should

consider

the

peculiarities

of

systems

and

specifically

the

following

two

issues

In

practical

applications

peers

often

have

an

a-priori

knowledge

about

the

reliability

of

the

sources

that

in

turn

determines

their

criteria

for

computing

repairs

That

is

peers

will

rarely

delete

tuples

coming

from

highly

reliable

sources

and

will

try

to

solve

conflicts

by

updating

the

less

reliable

sources

only

Peers

are

autonomous

and

not

benevolent

they

rarely

disregard

their

individual

preferences

in

order

to

find

an

agreement

with

other

peers

on

the

way

the

repair

should

be

carried

out

Therefore

the

presence

of

possibly

contrasting

interests

of

selfish

peers

should

be

accounted

for

when

answering

user

queries

Despite

the

wide

interest

in

this

field

of

the

approaches

in

the

literature

considered

the

issue

of

modeling

the

autonomy

of

the

peers

in

providing

a

semantics

for

the

system

and

therefore

they

implicitly

assume

that

all

the

peers

act

cooperatively

in

the

network

Moreover

the

possibility

of

modeling

peer

preferences

has

been

rarely

considered

in

previous

studies

even

though

it

has

been

widely

recognized

to

be

a

central

issue

for

the

design

of

quality-aware

integration

systems

-LRB-

cf.

-LSB-

-RSB-

-RRB-

Indeed

the

first

and

almost

isolated

attempt

is

in

-LSB-

-RSB-

where

the

authors

considered

trust

relationships

among

peers

in

a

simplified

setting

in

which

the

system

does

not

transitively

propagate

information

through

peers

Actually

an

extension

to

the

case

of

transitive

propagations

is

also

argued

but

peers

autonomy

is

not

considered

and

query

answering

is

undecidable

in

presence

of

loops

In

this

paper

we

face

the

above

issues

by

introducing

a

formal

framework

for

reasoning

about

autonomous

peers

that

exploit

individual

preference

criteria

in

repairing

data

In

summary

our

contributions

are

the

following

We

preliminary

introduce

a

framework

for

data

integration

systems

where

each

peer

is

equipped

with

integrity

constraints

on

its

global

schema

The

model

is

simple

yet

very

expressive

since

each

peer

is

assumed

to

be

in

turn

a

data

integration

system

The

semantics

of

a

system

is

defined

in

terms

of

suitable

databases

for

the

peers

called

models

We

show

that

checking

whether

a

system

has

a

model

can

be

done

efficiently

We

propose

an

approach

to

the

repair

of

inconsistent

systems

that

focuses

on

data

stored

at

the

sources

rather

than

on

the

global

schema

-LRB-

following

the

approach

described

by

-LSB-

-RSB-

for

the

standard

data

integration

setting

-RRB-

This

is

particularly

suited

for

dealing

with

peers

as

their

preferences

are

typically

expressed

over

the

sources

Indeed

if

repairs

were

considered

on

the

global

schema

suitable

reformulations

and

translation

of

the

preferences

would

be

required

We

investigate

the

effect

of

considering

individual

preferences

on

the

semantics

of

database

integration

systems

The

idea

is

that

queries

should

be

answered

over

the

best

possible

database

repairs

with

respect

to

the

preferences

of

all

peers

i.e.

over

the

states

on

which

they

are

able

to

find

an

agreement

Unfortu-nately

but

not

surprisingly

it

turns

out

that

considering

autonomous

peers

gives

rise

to

scenarios

where

they

are

not

able

to

find

any

agreement

on

the

way

the

integration

should

be

done

The

above

result

motivates

the

subsequent

study

of

the

complexity

of

dealing

with

peer

agreements

and

of

answering

queries

in

such

data

integration

systems

We

show

that

checking

whether

a

given

database

is

an

agreed

repair

is

a

difficult

task

since

it

is

complete

for

the

class

co-NP

Moreover

the

complexity

of

computing

an

agreement

turns

out

to

be

complete

for

the

functional

class

FPNP

Finally

we

study

the

complexity

of

computing

consistent

answers

and

show

that

this

problem

is

P

complete

It

follows

that

our

approach

for

handling

preferences

in

systems

is

just

mildly

harder

than

the

basic

data

integration

framework

where

in

fact

query

answering

lies

at

the

first

level

of

the

polynomial

hierarchy

-LSB-

-RSB-

as

well

The

rest

of

the

paper

is

organized

as

follows

In

Section

we

briefly

present

some

preliminaries

on

relational

databases

In

Section

we

introduce

a

simple

formalization

of

data

integration

systems

and

in

the

subsequent

section

we

enrich

it

to

take

care

of

peers

preferences

The

computational

complexity

of

the

concept

of

agreement

in

query

answering

is

studied

in

Section

Finally

in

Section

we

draw

our

conclusions

We

recall

the

basic

notions

of

the

relational

model

with

integrity

constraints

For

further

background

on

relational

database

theory

we

refer

the

reader

to

-LSB-

-RSB-

We

assume

a

-LRB-

possibly

infinite

-RRB-

fixed

database

domain

whose

elements

can

be

referenced

by

constants

c

c

n

under

the

unique

name

assumption

i.e.

different

constants

denote

different

objects

These

elements

are

assumed

to

be

shared

by

all

the

peers

and

are

in

fact

the

constants

that

can

appear

in

the

system

A

relational

schema

-LRB-

or

simply

schema

-RRB-

RS

is

a

pair

where

is

a

set

of

relation

symbols

each

with

an

associated

arity

that

indicates

the

number

of

its

attributes

and

is

a

set

of

integrity

constraints

i.e.

-LRB-

first-order

-RRB-

assertions

that

have

to

be

satisfied

by

each

database

instance

We

deal

with

quantified

constraints

i.e.

first

order

formulas

of

the

form

x.

l

i

A

i

y.

m

j

B

j

n

k

k

-LRB-

-RRB-

where

l

m

n

A

A

l

and

B

B

m

are

positive

literals

n

are

built-in

literals

and

x

and

y

are

lists

of

distinct

variables

Actually

to

keep

things

simple

we

shall

assume

throughout

the

paper

that

y

is

empty

thereby

dealing

with

universally

quantified

constraints

We

recall

here

that

this

kind

of

constraint

covers

most

of

the

classical

constraints

issued

on

a

relational

schema

such

as

keys

functional

dependencies

and

exclusion

dependencies

A

brief

discussion

on

how

to

generalize

the

results

in

the

paper

to

other

classes

of

constraints

is

reported

in

Section

A

database

instance

-LRB-

or

simply

database

-RRB-

DB

for

a

schema

RS

is

a

set

of

facts

of

the

form

r

-LRB-

t

-RRB-

where

r

is

a

relation

of

arity

n

in

and

t

is

an

n-tuple

of

constants

from

We

denote

as

r

DB

the

set

-LCB-

t

r

-LRB-

t

-RRB-

DB

-RCB-

A

database

DB

for

a

schema

RS

is

said

to

be

consistent

with

RS

if

it

satisfies

-LRB-

in

the

first

order

logic

sense

-RRB-

all

constraints

expressed

on

RS.

Figure

The

system

P

r

in

Example

A

relational

query

-LRB-

or

simply

query

-RRB-

over

RS

is

a

formula

that

is

intended

to

extract

tuples

of

elements

from

the

underlying

domain

of

constants

We

assume

that

queries

over

RS

are

Unions

of

Conjunctive

Queries

-LRB-

UCQs

-RRB-

i.e.

formulas

of

the

form

-LCB-

x

y

conj

-LRB-

x

y

-RRB-

y

m

conj

m

-LRB-

x

y

m

-RRB-

-RCB-

where

for

each

i

-LCB-

m

-RCB-

conj

i

-LRB-

x

y

i

-RRB-

is

a

conjunction

of

atoms

whose

predicate

symbols

are

in

and

involve

x

X

X

n

and

y

i

Y

i

Y

i

n

i

where

n

is

the

arity

of

the

query

and

each

X

k

and

each

Y

i

is

either

a

variable

or

a

constant

in

Given

a

database

DB

for

RS

the

answer

to

a

UCQ

Q

over

DB

denoted

Q

DB

is

the

set

of

n-tuples

of

constants

c

c

n

such

that

when

substituting

each

X

i

with

c

i

the

formula

y

conj

-LRB-

x

y

-RRB-

y

m

conj

m

-LRB-

x

y

m

-RRB-

evaluates

to

true

on

DB

In

this

section

we

introduce

a

simple

framework

for

dealing

with

systems

The

model

is

not

meant

to

be

a

novel

comprehensive

formalization

since

our

aim

here

is

to

face

the

problem

of

finding

agreement

among

peers

rather

than

to

investigate

new

syntactic

modeling

features

Therefore

our

approach

takes

basically

the

same

perspective

as

-LSB-

-RSB-

Basic

Framework

A

system

P

is

a

tuple

P

I

N

map

where

P

is

a

non-empty

set

of

distinct

peers

and

I

N

and

map

are

functions

whose

meaning

will

be

explained

below

First

each

peer

p

P

is

equipped

with

its

own

data

integration

system

I

-LRB-

p

-RRB-

which

is

formalized

as

a

triple

G

p

S

p

M

p

Basically

S

p

is

meant

to

denote

the

set

of

sources

to

which

p

is

allowed

to

access

and

is

in

fact

modeled

as

a

relational

schema

of

the

form

S

p

p

i.e.

there

are

no

integrity

constraints

on

the

sources

The

structure

of

the

global

schema

is

instead

represented

by

means

of

the

schema

G

p

p

p

whereas

the

relationships

between

the

sources

and

the

global

schema

are

specified

by

M

p

which

is

a

set

of

local

mapping

assertions

between

G

p

and

S

p

We

assume

that

each

assertion

is

of

the

form

Q

S

p

Q

G

p

where

Q

S

p

and

Q

G

p

are

two

conjunctive

queries

of

the

same

arity

over

the

source

schema

S

p

and

the

peer

schema

G

p

respectively

Example

Let

us

introduce

three

peers

namely

p

p

and

p

that

constitute

the

scenario

that

will

be

used

as

a

running

example

throughout

this

paper

to

illustrate

technical

definitions

The

global

schema

G

p

of

peer

p

consists

of

the

relation

predicate

secretary

-LRB-

Employee

Manager

-RRB-

-LRB-

without

constraints

-RRB-

the

source

schema

S

p

consists

of

the

relation

symbol

s

and

the

set

M

p

of

the

local

mapping

assertions

is

-LCB-

X

Y

s

-LRB-

X

Y

-RRB-

-RCB-

-LCB-

X

Y

secretary

-LRB-

X

Y

-RRB-

-RCB-

As

for

peer

p

the

schema

G

p

consists

of

the

relation

financial

-LRB-

Employee

Manager

-RRB-

-LRB-

without

constraints

-RRB-

the

source

schema

consists

of

the

relation

symbol

s

and

M

p

-LCB-

X

Y

s

-LRB-

X

Y

-RRB-

-RCB-

-LCB-

X

Y

financial

-LRB-

X

Y

-RRB-

-RCB-

The

schema

G

p

of

peer

p

consists

of

the

relations

employee

-LRB-

Name

Dept

-RRB-

and

boss

-LRB-

Employee

Manager

-RRB-

whose

set

of

constraints

contains

the

assertions

-LRB-

quantifiers

are

omitted

-RRB-

employee

-LRB-

X

Y

-RRB-

boss

-LRB-

X

Y

-RRB-

X

Y

and

boss

-LRB-

X

Y

-RRB-

boss

-LRB-

X

Y

-RRB-

Y

X

stating

that

managers

are

never

employees

the

source

schema

S

p

comprises

the

relation

symbols

s

and

the

set

of

the

local

mapping

assertions

is

-LCB-

X

Y

s

-LRB-

X

Y

-RRB-

-RCB-

-LCB-

X

Y

employee

-LRB-

X

Y

-RRB-

-RCB-

P

Each

peer

p

P

in

a

system

P

P

I

N

map

is

also

equipped

with

the

neighborhood

function

N

providing

a

set

of

peers

N

-LRB-

p

-RRB-

P

-LCB-

p

-RCB-

containing

the

peers

-LRB-

called

neighbors

-RRB-

who

potentially

have

some

information

of

interest

to

p.

Intuitively

the

neighborhood

relation

determines

the

structure

of

a

system

P

Such

a

structure

is

better

described

by

the

dependency

graph

G

-LRB-

P

-RRB-

of

P

i.e.

by

a

directed

graph

having

P

as

its

set

of

vertices

and

-LCB-

-LRB-

p

q

-RRB-

q

P

p

N

-LRB-

q

-RRB-

-RCB-

as

its

set

of

edges

In

particular

a

peer

q

is

in

N

-LRB-

p

-RRB-

iff

p

is

interested

in

the

data

exported

by

q

by

means

of

its

global

schema

i.e.

some

of

the

global

relations

of

p

can

be

populated

by

means

of

the

data

coming

from

q

besides

the

data

coming

from

the

sources

of

p

itself

To

this

aim

map

-LRB-

p

-RRB-

defines

the

set

of

peer

mapping

assertions

of

p.

Each

assertion

is

an

expression

of

the

form

Q

q

Q

p

where

the

peer

q

N

-LRB-

p

-RRB-

is

a

neighbor

of

p

and

Q

q

and

Q

p

are

two

conjunctive

queries

of

the

same

arity

over

schemas

G

q

and

G

p

respectively

Example

-LRB-

contd

-RRB-

Let

P

r

P

r

I

r

N

r

map

r

be

a

system

where

P

r

consists

of

three

peers

p

p

and

p

such

that

N

r

-LRB-

p

-RRB-

N

r

-LRB-

p

-RRB-

and

N

r

-LRB-

p

-RRB-

-LCB-

p

p

-RCB-

Figure

summarizes

the

structure

of

the

system

P

r

by

showing

for

each

peer

its

global

schema

its

source

schema

and

its

local

and

peer

mapping

assertions

In

particular

notice

that

the

mapping

assertions

are

such

that

map

-LRB-

p

-RRB-

map

-LRB-

p

-RRB-

and

map

-LRB-

p

-RRB-

-LCB-

X

Y

financial

-LRB-

X

Y

-RRB-

-RRB-

-RCB-

-LCB-

X

Y

boss

-LRB-

X

Y

-RRB-

-RCB-

-LCB-

X

Y

secretary

-LRB-

X

Y

-RRB-

-RCB-

-LCB-

X

Y

boss

-LRB-

X

Y

-RRB-

-RCB-

P

A

source

database

for

a

system

P

is

a

function

D

assigning

to

each

peer

p

P

such

that

I

-LRB-

p

-RRB-

G

p

S

p

M

p

a

database

instance

D

-LRB-

p

-RRB-

for

S

p

A

global

database

for

P

is

a

function

B

assigning

to

each

peer

p

a

database

instance

B

-LRB-

p

-RRB-

for

G

p

Usually

we

are

interested

in

global

databases

that

can

be

retrieved

from

a

given

source

as

formalized

below

Given

a

source

database

D

for

P

a

retrieved

global

database

for

D

is

a

global

database

B

that

satisfies

the

mapping

assertions

M

p

of

each

peer

p

i.e.

B

is

such

that

p

P

and

-LRB-

Q

S

p

Q

G

p

-RRB-

M

p

it

is

the

case

that

Q

D

-LRB-

p

-RRB-

S

p

Q

B

-LRB-

p

-RRB-

G

p

We

denote

by

ret

-LRB-

P

D

-RRB-

the

set

of

all

the

retrieved

global

databases

for

D

in

the

system

P.

Notice

that

in

the

definition

above

we

are

considering

sound

mappings

data

retrieved

from

the

sources

by

the

mapping

views

are

assumed

to

be

a

subset

of

the

data

that

satisfy

the

corresponding

global

relation

This

is

a

classical

assumption

in

data

integration

where

sources

in

general

do

not

provide

all

the

intended

extensions

of

the

global

schema

hence

extracted

data

are

to

be

considered

sound

but

not

necessarily

complete

Example

-LRB-

contd

-RRB-

Let

D

r

be

a

source

database

for

the

system

P

r

such

that

D

r

-LRB-

p

-RRB-

is

-LCB-

s

-LRB-

Albert

Bill

-RRB-

-RCB-

D

r

-LRB-

p

-RRB-

consists

of

-LCB-

s

-LRB-

John

Mary

-RRB-

s

-LRB-

Mary

Tom

-RRB-

-RCB-

and

D

r

-LRB-

p

-RRB-

-LCB-

s

-LRB-

Mary

-RRB-

-RCB-

Consider

also

the

global

database

B

r

such

that

B

r

-LRB-

p

-RRB-

-LCB-

secretary

-LRB-

Albert

Bill

-RRB-

-RCB-

B

r

-LRB-

p

-RRB-

-LCB-

financial

-LRB-

John

Mary

-RRB-

financial

-LRB-

Mary

Tom

-RRB-

-RCB-

and

B

r

-LRB-

p

-RRB-

-LCB-

employee

-LRB-

Mary

-RRB-

-RCB-

Then

it

is

easy

to

see

that

B

r

is

a

retrieved

database

for

D

r

in

P

r

i.e.

B

r

ret

-LRB-

P

r

D

r

-RRB-

Note

that

a

global

database

B

whose

peer

schema

for

some

peer

p

-LCB-

p

p

p

-RCB-

is

a

superset

of

B

r

-LRB-

p

-RRB-

is

in

ret

-LRB-

P

r

D

r

-RRB-

as

well

we

simply

say

that

B

is

a

superset

of

B

r

P

Models

of

Peer-to-Peer

Systems

Given

a

source

database

D

it

is

particular

important

to

investigate

whether

it

is

possible

to

retrieve

from

D

a

database

which

satisfies

the

semantics

of

the

network

Therefore

we

next

define

a

suitable

notion

of

model

for

a

system

The

approach

has

been

inspired

by

the

au-toepistemic

approach

of

-LSB-

-RSB-

in

particular

we

assume

that

peers

propagate

through

mapping

assertions

only

the

values

they

really

trust

Definition

Let

P

P

I

N

map

be

a

system

p

P

a

peer

with

I

-LRB-

p

-RRB-

G

p

S

p

M

p

and

G

p

p

p

and

D

a

source

instance

for

P.

Then

a

p-model

for

P

w.r.t.

D

is

a

maximal

nonempty

set

of

global

databases

M

ret

-LRB-

P

D

-RRB-

such

that

for

each

B

M

B

-LRB-

p

-RRB-

satisfies

the

constraints

in

p

and

for

each

assertion

Q

q

Q

p

map

-LRB-

p

-RRB-

it

holds

B

M

Q

B

-LRB-

q

-RRB-

q

B

M

Q

B

-LRB-

p

-RRB-

p

P

Thus

according

to

Condition

any

databases

in

the

p-model

satisfies

all

the

integrity

constraints

issued

over

the

global

schema

of

p

moreover

Condition

guarantees

that

peers

communicate

only

those

values

that

belong

to

all

models

i.e.

a

cautious

approach

to

the

propagation

has

been

pursued

Finally

we

point

out

that

as

for

local

mapping

assertions

peer

mapping

assertions

are

assumed

to

be

sound

Now

given

that

each

peer

singles

out

its

models

a

notion

of

model

for

the

whole

system

can

be

easily

stated

Definition

Let

P

P

I

N

map

be

a

system

A

model

for

P

w.r.t.

D

is

a

maximal

nonempty

set

M

ret

-LRB-

P

D

-RRB-

of

global

databases

such

that

for

each

p

P

M

is

a

p-model

If

a

model

for

P

w.r.t.

D

exists

we

say

that

D

satisfies

P

denoted

by

D

P.

P

For

instance

in

our

running

example

D

r

does

not

satisfy

P

r

indeed

the

peer

mapping

assertions

constrain

the

schema

of

p

to

contain

in

every

global

database

-LRB-

retrieved

from

D

r

-RRB-

the

tuples

boss

-LRB-

Albert

Bill

-RRB-

boss

-LRB-

John

Mary

-RRB-

boss

-LRB-

Mary

Tom

-RRB-

and

employee

-LRB-

Mary

-RRB-

that

violate

the

integrity

constraints

over

p

since

Mary

results

to

be

both

an

employee

and

a

manger

Therefore

retrieving

data

from

D

r

leads

to

an

inconsistent

scenario

We

conclude

by

noticing

that

deciding

whether

a

system

admits

a

model

can

be

done

efficiently

The

result

can

be

proven

by

modifying

the

techniques

in

-LSB-

-RSB-

in

order

to

first

evaluate

all

the

mappings

in

the

network

and

then

check

for

the

satisfaction

of

the

integrity

constraints

over

peer

schemas

Theorem

Let

P

P

I

N

map

be

a

system

and

D

be

a

database

instance

for

P.

Then

deciding

whether

there

is

a

model

for

P

w.r.t.

D

i.e.

D

P

is

feasible

in

polynomial

time

As

shown

in

our

running

example

in

general

data

stored

in

local

and

autonomous

sources

are

not

required

to

satisfy

constraints

expressed

on

the

global

schema

-LRB-

for

example

when

a

key

dependency

on

G

is

violated

by

data

retrieved

from

the

sources

-RRB-

Thus

a

system

may

be

unsatisfiable

w.r.t.

a

source

database

D

In

this

section

we

face

the

problem

of

solving

inconsistencies

in

systems

Specifically

we

introduce

a

semantics

for

repairing

a

system

To

this

aim

we

first

provide

a

model

for

peer

preferences

and

then

show

the

impact

of

these

individual

preferences

on

the

cost

of

reaching

a

global

agreed

repair

Peer

Preferences

and

Repairs

Let

P

P

I

N

map

be

a

system

and

D

be

a

source

database

instance

for

P.

Next

we

define

a

repair

weighting

function

w

p

-LRB-

P

D

-RRB-

for

each

peer

p

encoding

its

preferences

on

candidate

repairs

of

D.

Formally

w

p

-LRB-

P

D

-RRB-

is

a

polynomially-computable

function

assigning

to

each

source

database

instance

D

a

natural

number

that

is

a

measure

of

the

preference

of

p

on

having

D

as

a

repair

for

D

-LRB-

the

lower

the

number

the

more

preferred

the

repair

-RRB-

As

a

quite

simple

yet

natural

example

of

weighting

function

we

can

consider

the

evaluation

of

the

number

of

deletions

performed

to

the

peer

's

sources

In

this

case

we

have

that

w

p

-LRB-

P

D

-RRB-

-LRB-

D

-RRB-

D

-LRB-

p

-RRB-

D

-LRB-

p

-RRB-

which

in

fact

corresponds

to

the

size

of

the

difference

between

D

and

D

restricted

to

tuples

of

peer

p

This

weighting

function

is

called

cardinality-based

in

the

following

Example

-LRB-

contd

-RRB-

Consider

the

source

databases

D

r

D

r

and

D

r

such

that

D

r

-LRB-

p

-RRB-

D

r

-LRB-

p

-RRB-

D

r

-LRB-

p

-RRB-

D

r

-LRB-

p

-RRB-

D

r

-LRB-

p

-RRB-

-LCB-

s

-LRB-

John

Mary

-RRB-

-RCB-

D

r

-LRB-

p

-RRB-

-LCB-

s

-LRB-

Mary

Tom

-RRB-

-RCB-

D

r

-LRB-

p

-RRB-

-LCB-

-RCB-

D

r

-LRB-

p

-RRB-

-LCB-

-RCB-

D

r

-LRB-

p

-RRB-

-LCB-

s

-LRB-

Mary

-RRB-

-RCB-

and

D

r

-LRB-

p

-RRB-

-LCB-

s

-LRB-

Mary

-RRB-

-RCB-

Assume

that

for

each

peer

p

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

-RRB-

D

-LRB-

p

-RRB-

D

r

-LRB-

p

-RRB-

i.e.

she

prefers

source

repairs

where

the

minimum

number

of

tuples

is

deleted

from

D

r

-LRB-

p

-RRB-

Then

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

P

The

problem

of

solving

inconsistency

in

classical

data

integration

systems

has

been

traditionally

faced

by

providing

a

semantics

in

terms

of

the

repairs

of

the

global

databases

that

the

mapping

forces

to

be

in

the

semantic

of

the

system

-LSB-

-RSB-

Repairs

are

obtained

by

means

of

addition

and

deletion

of

tuples

according

to

some

minimality

criterion

We

next

propose

a

generalization

of

these

approaches

to

the

framework

which

takes

into

account

peers

preferences

To

this

aim

we

focus

on

finding

the

proper

set

of

facts

at

the

sources

that

imply

as

a

consequence

a

global

database

satisfying

all

integrity

constraints

Basically

such

a

way

of

proceeding

allows

us

to

easily

take

into

account

information

on

preferences

when

trying

to

solve

inconsistency

since

repairing

is

performed

by

directly

focusing

on

those

sources

whose

integration

has

caused

inconsistency

Definition

-LRB-

Repair

-RRB-

Let

P

be

a

system

p

a

peer

and

D

and

D

two

source

databases

We

say

that

D

is

p-minimal

if

D

P

and

there

exists

no

source

database

D

such

that

w

p

-LRB-

P

D

-RRB-

-LRB-

D

-RRB-

w

p

-LRB-

P

D

-RRB-

-LRB-

D

-RRB-

and

D

P.

Then

D

is

a

repair

for

P

w.r.t.

D

if

D

is

p-minimal

for

each

peer

p.

P

Example

-LRB-

contd

-RRB-

It

is

easy

to

see

that

D

r

D

r

and

D

r

satisfy

P

r

and

they

are

both

p

minimal

Indeed

peer

p

has

no

preferences

among

the

three

databases

since

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

w

p

-LRB-

P

r

D

r

-RRB-

-LRB-

D

r

-RRB-

Moreover

D

r

and

D

r

are

equally

preferred

by

p

whereas

D

r

and

D

r

are

equally

preferred

by

p

Therefore

all

peers

agree

on

D

r

which

is

thus

a

repair

for

D

r

w.r.t.

P

r

However

neither

D

r

is

p

minimal

nor

D

r

is

p

minimal

and

thus

they

are

not

repairs

P

We

next

define

the

semantics

of

a

system

in

terms

of

models

for

those

sources

on

which

all

the

peers

agree

Definition

-LRB-

Agreement

-RRB-

Let

P

P

I

N

map

be

a

system

and

D

be

an

instance

for

P

The

agreement

for

P

w.r.t.

D

is

the

set

of

all

of

its

models

w.r.t.

some

repair

and

will

be

denoted

by

Agr

-LRB-

P

D

-RRB-

P

Example

-LRB-

contd

-RRB-

D

r

is

p-minimal

for

each

peer

p

and

it

is

easy

to

see

that

the

set

Agr

-LRB-

P

r

D

r

-RRB-

contains

all

databases

belonging

to

some

model

for

P

r

w.r.t.

D

r

In

particular

it

contains

the

supersets

-LRB-

satisfying

the

constraints

-RRB-

of

the

database

B

r

such

that

B

r

-LRB-

p

-RRB-

-LCB-

secretary

-LRB-

Albert

Bill

-RRB-

-RCB-

B

r

-LRB-

p

-RRB-

-LCB-

financial

-LRB-

Mary

Tom

-RRB-

-RCB-

and

B

r

-LRB-

p

-RRB-

-LCB-

boss

-LRB-

Albert

Bill

-RRB-

boss

-LRB-

Mary

Tom

-RRB-

employee

-LRB-

Mary

-RRB-

-RCB-

Moreover

no

other

global

database

is

in

Agr

-LRB-

P

r

D

r

-RRB-

P

We

can

finally

characterize

the

answer

to

a

user

query

in

terms

of

the

repairs

for

the

system

Definition

Let

P

P

I

N

map

be

a

system

let

D

be

a

source

database

for

it

and

let

Q

be

a

query

over

the

schema

of

a

peer

p.

Then

the

answer

to

Q

is

the

evaluation

of

the

query

over

all

the

possible

agreed

databases

ans

-LRB-

Q

p

P

D

-RRB-

B

Agr

-LRB-

P

D

-RRB-

Q

B

-LRB-

p

-RRB-

p

P

For

instance

in

our

running

example

the

answer

to

the

user

query

-LCB-

X

boss

-LRB-

X

Y

-RRB-

-RCB-

posed

over

peer

p

which

asks

for

all

employees

that

have

a

boss

is

-LCB-

Albert

Mary

-RCB-

since

this

query

is

evaluated

over

the

supersets

of

the

database

B

r

retrieved

from

D

r

only

We

conclude

the

section

by

noticing

that

Agr

-LRB-

P

D

-RRB-

is

just

a

formal

characterization

of

the

semantics

of

a

system

Usually

we

are

not

interested

in

computing

such

a

set

and

in

fact

for

practical

applications

suitable

techniques

and

optimization

algorithms

should

be

investigated

to

handle

inconsistency

at

query

time

-LRB-

in

the

spirit

of

e.g.

-LSB-

-RSB-

-RRB-

The

Price

of

Autonomy

Given

the

framework

presented

so

far

we

are

in

the

position

of

studying

the

effects

of

having

autonomous

peers

repairing

their

source

databases

according

to

their

own

preferences

We

next

show

that

in

some

cases

peers

might

not

find

an

agreement

on

the

way

the

repair

has

to

be

carried

out

This

is

a

somehow

expected

consequence

of

having

selfish

interested

peers

in

the

absence

of

a

global

coordination

Proposition

There

exists

a

system

P

and

a

source

database

D

such

that

there

is

no

agreement

i.e.

Agr

-LRB-

P

D

-RRB-

is

empty

Proof

-LSB-

Sketch

-RSB-

Consider

the

system

P

P

I

N

map

where

P

consists

of

the

peers

challenger

-LRB-

short

c

-RRB-

and

duplicator

-LRB-

short

d

-RRB-

that

are

mutually

connected

i.e.

N

-LRB-

c

-RRB-

-LCB-

d

-RCB-

and

N

-LRB-

d

-RRB-

-LCB-

c

-RCB-

Peer

c

is

such

that

I

-LRB-

c

-RRB-

G

c

S

c

M

c

where

the

schema

G

c

consists

of

predicates

r

c

-LRB-

X

-RRB-

and

mr

d

-LRB-

X

-RRB-

with

constraints

r

c

-LRB-

X

-RRB-

r

c

-LRB-

Y

-RRB-

X

Y

and

r

c

-LRB-

X

-RRB-

mr

d

-LRB-

Y

-RRB-

X

Y

the

source

schema

consists

of

the

relation

symbol

s

c

and

M

c

contains

only

the

assertion

-LCB-

X

s

c

-LRB-

X

-RRB-

-RCB-

-LCB-

X

r

c

-LRB-

X

-RRB-

-RCB-

Peer

d

is

such

that

I

-LRB-

d

-RRB-

G

d

S

d

M

d

where

the

schema

G

d

consists

of

predicates

r

d

-LRB-

X

-RRB-

and

mr

c

-LRB-

X

-RRB-

with

constraints

r

d

-LRB-

X

-RRB-

r

d

-LRB-

Y

-RRB-

X

Y

and

r

d

-LRB-

X

-RRB-

mr

c

-LRB-

Y

-RRB-

X

Y

the

source

schema

consists

of

the

relation

symbol

s

d

and

M

d

contains

only

the

assertion

-LCB-

X

s

d

-LRB-

X

-RRB-

-RCB-

-LCB-

X

r

d

-LRB-

X

-RRB-

-RCB-

Finally

map

-LRB-

c

-RRB-

contains

the

assertion

-LCB-

X

r

c

-LRB-

X

-RRB-

-RRB-

-RCB-

-LCB-

X

mr

c

-LRB-

X

-RRB-

-RCB-

while

map

-LRB-

d

-RRB-

contains

the

assertion

-LCB-

X

r

d

-LRB-

X

-RRB-

-RRB-

-RCB-

-LCB-

X

mr

d

-LRB-

X

-RRB-

-RCB-

Let

D

be

a

source

database

for

P

such

that

D

-LRB-

c

-RRB-

-LCB-

s

c

-LRB-

-RRB-

s

c

-LRB-

-RRB-

-RCB-

and

D

-LRB-

d

-RRB-

-LCB-

s

d

-LRB-

-RRB-

s

d

-LRB-

-RRB-

-RCB-

We

build

four

source

databases

say

D

D

D

and

D

that

satisfy

P

They

are

such

that

D

-LRB-

c

-RRB-

-LCB-

-RCB-

D

-LRB-

d

-RRB-

-LCB-

s

d

-LRB-

-RRB-

-RCB-

D

-LRB-

c

-RRB-

-LCB-

-RCB-

D

-LRB-

d

-RRB-

-LCB-

s

d

-LRB-

-RRB-

-RCB-

D

-LRB-

c

-RRB-

-LCB-

s

c

-LRB-

-RRB-

-RCB-

D

-LRB-

d

-RRB-

-LCB-

-RCB-

D

-LRB-

c

-RRB-

-LCB-

s

c

-LRB-

-RRB-

-RCB-

D

-LRB-

d

-RRB-

-LCB-

-RCB-

Notice

that

all

the

other

databases

satisfying

P

are

proper

subsets

of

these

ones

Then

by

assuming

that

each

peer

wants

to

minimize

the

number

of

deletions

in

D

there

exists

no

source

database

satisfying

P

that

is

both

c-minimal

and

d-minimal

In

the

light

of

Proposition

it

is

particulary

relevant

to

investigate

the

complexity

of

dealing

with

peer

agreements

and

query

answering

in

such

data

integration

systems

In

this

section

we

first

present

some

basic

problems

arising

in

the

proposed

framework

and

subsequently

analyze

their

computational

complexity

This

analysis

is

a

fundamental

premise

to

devise

effective

and

optimized

implementations

Problems

Given

a

system

P

and

a

source

database

D

for

P

we

consider

the

following

problems

RepairChecking

given

a

source

instance

D

is

D

a

repair

for

P

w.r.t.

D

AgreementExistence

is

Agr

-LRB-

P

D

-RRB-

AnyAgreementComputation

compute

a

database

B

in

the

agreement

Agr

-LRB-

P

D

-RRB-

if

any

QueryOutputTuple

given

a

query

Q

over

a

peer

schema

G

p

and

a

tuple

t

is

t

ans

-LRB-

Q

p

P

D

-RRB-

Intuitively

RepairChecking

is

the

very

basic

problem

of

assessing

whether

a

source

instance

at

hand

satisfies

the

data

integration

system

Then

AgreementExistence

-LRB-

and

its

corresponding

computational

version

AnyAgreementComputation

-RRB-

asks

for

singling

out

scenarios

where

some

agrement

can

be

in

fact

computed

Finally

QueryOutputTuple

represents

the

problem

characterizing

the

intrinsic

complexity

of

a

query

answering

in

the

proposed

framework

indeed

it

is

the

problem

of

deciding

the

membership

of

a

given

tuple

in

the

result

of

query

evaluation

Results

Our

first

result

is

that

checking

whether

all

the

peers

are

satisfied

by

a

given

source

database

is

a

difficult

task

that

is

unlikely

to

be

feasible

in

polynomial

time

Theorem

RepairChecking

is

co-NP-complete

Hardness

holds

even

for

cardinality-based

weighting

functions

Proof

-LSB-

Sketch

-RSB-

Membership

Consider

the

complementary

problem

of

deciding

whether

there

exists

a

peer

p

such

that

D

is

not

p-minimal

This

problem

is

feasible

in

NP

by

guessing

a

source

database

D

and

checking

in

that

D

P

and

there

exists

a

peer

p

such

that

w

p

-LRB-

P

D

-RRB-

-LRB-

D

-RRB-

w

p

-LRB-

P

D

-RRB-

-LRB-

D

-RRB-

In

particular

is

feasible

in

polynomial

time

because

of

Theorem

and

is

feasible

in

polynomial

time

because

our

weighting

functions

are

polynomially

computable

Hardness

Recall

that

deciding

whether

a

Boolean

formula

in

conjunctive

normal

form

C

C

m

over

the

variables

X

X

n

is

not

satisfiable

i.e.

deciding

whether

there

exists

no

truth

assignments

to

the

variables

making

each

clause

C

j

true

is

a

co-NP-hard

problem

We

built

a

system

P

such

that

P

contains

a

peer

x

i

for

each

variable

X

i

a

peer

c

j

for

each

clause

C

j

and

the

distinguished

peer

e

The

source

schema

of

x

i

-LRB-

resp

c

j

-RRB-

consists

of

the

unary

relation

s

x

i

-LRB-

resp

s

c

j

-RRB-

whereas

the

global

schema

consists

of

the

unary

relation

r

x

i

-LRB-

resp

r

c

j

-RRB-

The

source

schema

of

e

consists

of

the

unary

relations

s

e

and

s

a

whereas

its

global

schema

consists

of

the

unary

relations

r

e

and

r

a

For

each

source

relation

say

s

P

-LRB-

-RRB-

contains

a

local

mapping

assertion

of

the

form

-LCB-

X

s

-LRB-

X

-RRB-

-RCB-

-LCB-

X

r

-LRB-

X

-RRB-

-RCB-

Each

global

relation

of

the

form

r

x

i

is

equipped

with

the

constraint

r

x

i

-LRB-

X

-RRB-

r

x

i

-LRB-

X

-RRB-

X

X

stating

that

each

relation

must

contain

one

atom

at

most

Each

global

relation

of

the

form

r

c

j

is

equipped

with

the

constraint

r

c

j

-LRB-

tx

i

-RRB-

r

c

j

-LRB-

fx

i

-RRB-

where

is

the

empty

disjunction

stating

that

for

each

variable

x

i

r

c

j

can

not

contain

both

tx

i

and

fx

i

at

the

same

time

Moreover

peer

e

has

also

the

constraint

r

e

-LRB-

X

-RRB-

r

a

-LRB-

X

-RRB-

X

X

Consider

the

source

database

D

for

P

such

that

D

-LRB-

x

i

-RRB-

-LCB-

s

x

i

-LRB-

tx

i

-RRB-

s

x

i

-LRB-

fx

i

-RRB-

-RCB-

for

each

x

i

occurring

in

c

j

D

-LRB-

c

j

-RRB-

-LCB-

s

c

j

-LRB-

tx

i

-RRB-

s

c

j

-LRB-

fx

i

-RRB-

-RCB-

and

D

-LRB-

e

-RRB-

-LCB-

s

e

-LRB-

t

-RRB-

s

e

-LRB-

f

-RRB-

s

a

-LRB-

t

-RRB-

-RCB-

Notice

that

due

to

the

constraints

issued

over

peers

schemas

any

source

database

D

with

D

P

is

such

that

D

-LRB-

x

i

-RRB-

for

each

x

i

Therefore

the

restriction

of

D

to

the

peers

of

the

form

x

i

is

in

one-to-one

correspondence

with

a

truth-value

assignment

for

denoted

by

-LRB-

D

-RRB-

Intuitively

the

atom

s

x

i

-LRB-

tx

i

-RRB-

-LRB-

resp

s

x

i

-LRB-

fx

i

-RRB-

-RRB-

means

that

variable

X

i

is

set

to

true

-LRB-

resp

false

-RRB-

whereas

the

atom

s

c

j

-LRB-

tx

i

-RRB-

means

that

the

clause

C

j

is

true

witnessed

by

the

assignment

for

the

variable

X

i

occurring

in

c

j

Finally

the

peers

mapping

assertions

in

P

are

defined

as

follows

For

each

variable

X

i

occurring

positively

-LRB-

resp

negatively

-RRB-

in

the

clause

C

j

there

are

exactly

two

mappings

of

the

form

-LCB-

r

x

i

-LRB-

tx

i

-RRB-

-RCB-

-LCB-

r

c

j

-LRB-

tx

i

-RRB-

-RCB-

and

-LCB-

r

x

i

-LRB-

fx

i

-RRB-

-RCB-

-LCB-

r

c

j

-LRB-

fx

i

-RRB-

-RCB-

-LRB-

resp

-LCB-

r

x

i

-LRB-

fx

i

-RRB-

-RCB-

-LCB-

r

c

j

-LRB-

tx

i

-RRB-

-RCB-

and

-LCB-

r

x

i

-LRB-

tx

i

-RRB-

-RCB-

-LCB-

r

c

j

-LRB-

fx

i

-RRB-

-RCB-

-RRB-

moreover

for

each

clause

C

j

containing

variables

X

j

X

j

k

there

exists

a

mapping

-LCB-

r

c

j

-LRB-

fx

j

-RRB-

r

c

j

-LRB-

fx

j

k

-RRB-

-RCB-

-LCB-

r

e

-LRB-

f

-RRB-

-RCB-

Figure

shows

on

the

upper

part

the

dependency

graph

G

-LRB-

P

-RRB-

for

the

formula

-LRB-

X

X

-RRB-

-LRB-

X

-RRB-

-LRB-

X

X

X

-RRB-

-LRB-

X

-RRB-

-LRB-

X

X

X

-RRB-

-LRB-

X

X

X

-RRB-

Assume

that

each

peer

wants

to

minimize

the

number

of

deletions

in

D

Then

given

a

source

database

D

minimal

w.r.t.

each

peer

in

P

but

e

we

can

show

that

the

above

mappings

encode

an

evaluation

of

the

assignment

-LRB-

D

-RRB-

In

particular

it

is

easy

to

see

that

-LRB-

D

-RRB-

is

a

satisfying

assignment

for

if

and

only

if

D

-LRB-

e

-RRB-

contains

the

facts

-LCB-

s

e

-LRB-

t

-RRB-

s

a

-LRB-

t

-RRB-

-RCB-

i.e.

one

fact

is

deleted

from

the

source

of

e

only

Assume

now

that

D

is

such

that

D

-LRB-

e

-RRB-

-LCB-

s

e

-LRB-

f

-RRB-

-RCB-

i.e.

two

facts

are

deleted

from

the

source

of

e.

Then

D

is

also

e-minimal

if

and

only

if

is

not

satisfiable

P

Given

the

above

complexity

result

one

can

easily

see

that

AnyAgreementComputation

is

feasible

in

the

functional

version

of

P

Indeed

we

can

guess

in

NP

a

source

instance

D

build

in

polynomial

time

a

model

B

for

P

w.r.t.

D

-LRB-

by

construction

in

Theorem

-RRB-

and

check

in

co-NP

that

D

is

minimal

for

each

peer

Actually

we

can

do

much

better

In

fact

we

next

show

that

the

problem

is

complete

for

the

polynomial

time

closure

of

NP

and

thus

remains

at

the

first

level

of

the

polynomial

hierarchy

Theorem

AnyAgreementComputation

is

FPNP-complete

Hardness

holds

even

for

cardinality-based

weighting

functions

Proof

-LSB-

Sketch

-RSB-

Membership

The

problem

can

be

solved

by

processing

peers

in

a

sequential

manner

For

each

peer

in

P

we

can

find

the

minimum

value

of

the

associated

preference

function

by

means

of

a

binary

search

in

which

at

each

step

we

guess

in

NP

a

database

instance

and

verify

that

such

a

preference

holds

After

having

collected

the

minimum

values

for

all

peers

we

conclude

with

a

final

guess

to

get

a

repair

D

and

a

subsequent

check

that

actually

each

peer

gets

its

minimum

possible

value

for

P

w.r.t.

D.

Figure

Constructions

in

Proofs

of

Complexity

Results

Finally

a

model

for

P

w.r.t.

D

can

be

build

in

polynomial

time

-LRB-

again

by

construction

in

Theorem

-RRB-

Hardness

Let

be

a

boolean

formula

in

conjunctive

normal

form

C

C

m

over

the

variables

X

X

n

Assume

that

each

clause

say

C

j

is

equipped

with

a

weight

w

j

-LRB-

natural

number

-RRB-

Let

be

an

assignment

for

the

variables

in

Its

weight

is

the

sum

of

the

weights

of

all

the

clauses

satisfied

in

The

problem

of

computing

the

maximum

weight

over

any

truth

assignment

called

MAX

WEIGHT

SAT

is

FPNP-complete

Consider

again

the

construction

in

Theorem

and

modify

P

as

follows

The

source

schema

of

peer

e

consists

of

the

relation

s

w

whereas

its

global

schema

consists

of

the

relations

r

w

and

r

v

and

of

the

constraint

r

v

-LRB-

X

-RRB-

r

w

-LRB-

X

Y

-RRB-

The

local

mappings

of

e

is

-LCB-

X

Y

s

w

-LRB-

X

Y

-RRB-

-RCB-

-LCB-

X

Y

r

w

-LRB-

X

Y

-RRB-

-RCB-

Moreover

for

each

clause

c

j

over

variables

X

j

X

j

k

map

-LRB-

e

-RRB-

contains

the

assertion

-LCB-

r

c

j

-LRB-

fx

j

-RRB-

r

c

j

-LRB-

fx

j

k

-RRB-

-RCB-

-LCB-

r

v

-LRB-

fc

j

-RRB-

-RCB-

Let

P

be

such

a

modified

system

Notice

that

G

-LRB-

P

-RRB-

coincides

with

G

-LRB-

P

-RRB-

-LRB-

see

again

Figure

-RRB-

Consider

now

the

database

instance

D

for

P

obtained

by

modifying

D

such

that

D

-LRB-

e

-RRB-

contains

the

atoms

s

w

-LRB-

fc

j

-RRB-

s

w

-LRB-

fc

j

-RRB-

s

w

-LRB-

fc

j

w

j

-RRB-

for

each

clause

c

j

Intuitively

peer

e

stores

w

j

distinct

atoms

for

each

clause

c

j

Let

D

be

a

source

instance

that

satisfies

P

As

in

Theorem

the

restriction

of

D

over

the

variables

is

in

one-to-one

correspondence

with

a

truth

assignment

for

denoted

by

-LRB-

D

-RRB-

Then

it

is

easy

to

see

that

peer

e

must

delete

in

D

all

the

w

j

distinct

atoms

corresponding

to

a

clause

C

j

that

is

not

satisfied

by

the

assignment

-LRB-

D

-RRB-

Therefore

D

-LRB-

e

-RRB-

i

C

i

is

false

in

-LRB-

D

-RRB-

w

i

Hence

the

result

easily

follows

since

computing

the

source

instance

that

is

e-minimal

say

D

determines

the

maximum

weight

over

any

assignment

for

as

-LRB-

i

w

i

-RRB-

D

-LRB-

e

-RRB-

P

We

next

focus

on

the

AgreementExistence

problem

Note

that

membership

of

this

problem

in

P

is

easy

to

proven

after

the

above

theorem

However

the

reduction

for

the

hardness

part

we

shall

exploit

here

is

rather

different

Theorem

AgreementExistence

is

P

complete

Hardness

holds

even

for

cardinality-based

weighting

functions

Proof

-LSB-

Sketch

-RSB-

Membership

is

shown

with

the

same

line

of

reasoning

of

Theorem

For

the

hardness

consider

again

MAX

WEIGHT

SAT

and

the

P

complete

problem

of

deciding

whether

it

has

a

unique

solution

Let

P

be

the

system

built

in

Theorem

and

let

P

be

a

copy

of

it

obtained

by

replacing

each

element

-LRB-

both

relations

and

peers

-RRB-

r

in

P

by

r

Then

consider

the

system

P

obtained

as

the

union

of

P

P

and

a

fresh

peer

u.

Figure

shows

the

dependency

graph

G

-LRB-

P

-RRB-

The

local

schema

of

u

is

empty

while

its

global

schema

consists

of

the

unary

relation

r

u

with

the

constraint

n

i

r

u

-LRB-

bad

i

-RRB-

The

mapping

assertions

are

as

follows

For

each

variable

X

i

in

map

-LRB-

u

-RRB-

contains

-LCB-

r

x

i

-LRB-

tx

i

-RRB-

r

x

i

-LRB-

tx

i

-RRB-

-RCB-

-LCB-

r

u

-LRB-

bad

i

-RRB-

-RCB-

and

-LCB-

r

x

i

-LRB-

fx

i

-RRB-

r

x

i

-LRB-

fx

i

-RRB-

-RCB-

-LCB-

r

u

-LRB-

bad

i

-RRB-

-RCB-

It

is

worthwhile

noting

that

for

the

sake

of

simplicity

the

mapping

assertions

are

slightly

more

general

than

those

allowed

in

the

usual

definition

of

systems

since

they

involve

joins

among

different

peers

However

this

is

only

a

syntactical

facility

as

such

a

mapping

can

be

easily

simulated

by

introducing

a

suitable

dummy

peer

The

idea

of

the

reduction

is

that

if

the

same

assignment

that

maximizes

the

weight

of

the

satisfied

clauses

is

selected

for

both

P

and

P

then

r

u

-LRB-

bad

i

-RRB-

is

pushed

to

u

-LRB-

for

each

i

-RRB-

thereby

violating

the

constraint

Thus

there

is

a

-LRB-

nonempty

-RRB-

agreement

in

P

if

and

only

if

there

are

at

least

two

such

assignments

P

We

conclude

our

investigation

by

observing

that

query

answering

is

at

least

as

hard

as

AgreementExistence

Indeed

intuitively

if

peers

are

not

able

to

find

an

agreement

in

an

inconsistent

system

then

the

answer

to

any

given

query

will

be

empty

Moreover

membership

can

be

proven

by

the

same

line

of

reasoning

of

Theorem

and

we

thus

get

the

following

result

Theorem

QueryOutputTuple

is

P

complete

Hardness

holds

even

for

cardinality-based

weighting

functions

In

this

paper

we

investigated

some

important

theoretical

issues

in

data

integration

systems

Specifically

we

introduced

a

setting

in

which

peers

take

into

account

their

own

preferences

over

data

sources

in

order

to

integrate

data

if

some

inconsistency

arise

This

seems

a

natural

setting

for

such

kind

of

systems

which

has

not

been

previously

investigated

in

the

literature

It

turns

out

that

there

are

scenarios

where

peers

do

not

find

any

agreement

on

the

way

the

repair

should

be

carried

out

and

where

some

kind

of

centralized

coordination

is

required

Actually

our

results

show

that

this

coordination

comes

with

a

cost

and

some

basic

problems

are

unlikely

to

be

tractable

However

the

complexity

of

the

problems

studied

in

this

paper

are

only

mildly

harder

than

the

corresponding

problems

in

traditional

data

integration

systems

This

is

an

important

feature

of

our

approach

that

paves

the

way

for

possible

easy

implementations

based

on

available

systems

In

particular

the

prototypical

implementation

appears

viable

with

minor

efforts

if

done

on

top

of

integration

systems

that

exploit

a

declarative

approach

to

data

integration

-LRB-

e.g.

-LSB-

-RSB-

where

logic

programs

serve

as

executable

logic

specifications

for

the

repair

computation

-RRB-

Indeed

our

complexity

results

show

that

logic

engines

able

to

express

all

problems

in

the

second

level

of

the

polynomial

hierarchy

such

as

the

DLV

system

-LSB-

-RSB-

suffices

for

managing

the

framework

once

we

provide

appropriate

logic

specifications

A

number

of

interesting

research

questions

arise

from

this

work

First

it

is

natural

to

ask

whether

the

framework

can

be

extended

to

the

presence

of

existentially

quantified

constraints

This

can

be

easily

done

for

some

special

syntactic

fragments

such

as

for

non

key-conflicting

schemas

i.e.

global

schemas

enriched

with

inclusion

dependencies

and

keys

for

which

decidability

in

the

context

of

data

integration

systems

has

been

proven

in

-LSB-

-RSB-

To

this

aim

one

has

to

modify

the

algorithm

in

-LSB-

-RSB-

to

propagate

information

in

a

system

by

accounting

for

mapping

assertion

as

well

as

for

inclusion

dependencies

and

eventually

check

that

after

such

propagation

no

key

has

been

violated

We

conclude

by

noticing

that

an

avenue

of

further

research

is

to

consider

more

sophisticated

peer-agreement

semantics

besides

the

Pareto-like

approach

described

here

For

instance

we

may

think

of

some

applications

where

peers

may

form

cooperating

groups

or

do

not

cooperate

at

all

Another

line

of

research

may

lead

to

enrich

the

setting

by

further

kinds

of

peer

preferences

criteria

by

replacing

or

complementing

the

weighting

functions

proposed

in

this

paper

The

work

was

partially

supported

by

the

European

Commission

under

project

INFOMIX

Francesco

Scarcello

's

work

was

also

supported

by

ICAR-CNR

Rende

Italy

-LSB-

-RSB-

Serge

Abiteboul

Richard

Hull

and

Victor

Vianu

Foundations

of

Databases

Addison

Wesley

Publ

Co.

Reading

Massachussetts

-LSB-

-RSB-

Marcelo

Arenas

Leopoldo

E.

Bertossi

and

Jan

Chomicki

Consistent

query

answers

in

inconsistent

databases

In

Proc

of

PODS

pages

-LSB-

-RSB-

P.

Bernstein

F.

Giunchiglia

A.

Kementsietsidis

J.

Mylopoulos

L.

Serafini

and

I.

Zaihrayeu

Data

management

for

peer-to-peer

computing

A

vision

In

Workshop

on

the

Web

and

Databases

WebDB

-LSB-

-RSB-

Leopoldo

Bertossi

Jan

Chomicki

Alvaro

Cortes

and

Claudio

Gutierrez

Consistent

answers

from

integrated

data

sources

In

Proc

of

FQAS

pages

-LSB-

-RSB-

Leopoldo

E.

Bertossi

and

Loreto

Bravo

Query

answering

in

peer-to-peer

data

exchange

systems

In

Proc

of

EDBT

Workshops

pages

-LSB-

-RSB-

Loreto

Bravo

and

Leopoldo

Bertossi

Logic

programming

for

consistently

querying

data

integration

systems

In

Proc

of

IJCAI

pages

-LSB-

-RSB-

Andrea

Cal

i

Domenico

Lembo

and

Riccardo

Rosati

On

the

decidability

and

complexity

of

query

answering

over

inconsistent

and

incomplete

databases

In

Proc

of

PODS

pages

-LSB-

-RSB-

Andrea

Cal

i

Domenico

Lembo

and

Riccardo

Rosati

Query

rewriting

and

answering

under

constraints

in

data

integration

systems

In

Proc

of

IJCAI

pages

-LSB-

-RSB-

Diego

Calvanese

Giuseppe

De

Giacomo

Maurizio

Lenzerini

and

Riccardo

Rosati

Logical

foundations

of

peer-to-peer

data

integration

In

Proc

of

PODS

pages

-LSB-

-RSB-

Thomas

Eiter

Michael

Fink

Gianluigi

Greco

and

Domenico

Lembo

Efficient

evaluation

of

logic

programs

for

querying

data

integration

systems

In

Proc

of

ICLP

pages

-LSB-

-RSB-

Enrico

Franconi

Gabriel

Kuper

Andrei

Lopatenko

and

Luciano

Serafini

A

robust

logical

and

computational

characterisation

of

peer-to-peer

database

systems

In

Proc

of

pages

-LSB-

-RSB-

Enrico

Franconi

Gabriel

Kuper

Andrei

Lopatenko

and

Ilya

Zaihrayeu

A

distributed

algorithm

for

robust

data

sharing

and

updates

in

database

networks

In

Proc

of

DB

pages

-LSB-

-RSB-

Enrico

Franconi

Gabriel

Kuper

Andrei

Lopatenko

and

Ilya

Zaihrayeu

Queries

and

updates

in

the

codb

peer

to

peer

database

system

In

Proc

of

VLDB

pages

-LSB-

-RSB-

Gianluigi

Greco

Sergio

Greco

and

Ester

Zumpano

A

logic

programming

approach

to

the

integration

repairing

and

querying

of

inconsistent

databases

In

Proc

of

ICLP

pages

Springer

-LSB-

-RSB-

Gianluigi

Greco

and

Domenico

Lembo

Data

integration

with

prefernces

among

sources

In

Proc

of

ER

pages

-LSB-

-RSB-

Alon

Y.

Halevy

Zachary

G.

Ives

Peter

Mork

and

Igor

Tatarinov

Piazza

data

management

infrastructure

for

semantic

web

applications

In

Proc

of

WWW

pages

-LSB-

-RSB-

Maurizio

Lenzerini

Quality-aware

peer-to-peer

data

integration

In

Proc

of

IQIS

-LSB-

-RSB-

Nicola

Leone

Thomas

Eiter

Wolfgang

Faber

Michael

Fink

Georg

Gottlob

Gianluigi

Greco

Giovambattista

Ianni

Edyta

Kalka

Domenico

Lembo

Maurizio

Lenzerini

Vincenzino

Lio

Bartosz

Nowicki

Riccardo

Rosati

Marco

Ruzzi

Witold

Staniszkis

and

Giorgio

Terracina

The

INFOMIX

system

for

advanced

integration

of

incomplete

and

inconsistent

data

In

Proc

of

SIGMOD

pages

-LSB-

-RSB-

Nicola

Leone

Gerald

Pfeifer

Wolfgang

Faber

Thomas

Eiter

Georg

Gottlob

Simona

Perri

and

Francesco

Scarcello

The

DLV

System

for

Knowledge

Representation

and

Reasoning

ACM

Transaction

on

Cumputational

Logic

To

appear

-LSB-

-RSB-

Luciano

Serafini

Fausto

Giunchiglia

John

Mylopoulos

and

Philip

A.

Bernstein

Local

relational

model

A

logical

formalization

of

database

coordination

In

Fourth

International

and

Interdisciplinary

Conference

on

Modeling

and

Using

Context

CONTEXT

pages

-LSB-

-RSB-

Igor

Tatarinov

and

Alon

Halevy

Efficient

query

reformulation

in

peer

data

management

systems

In

Proc

of

SIGMOD

pages