Coordinating PeertoPeer information sources Fausto Giunchiglia University of

  • Slides: 34
Download presentation
Coordinating Peer-to-Peer information sources Fausto Giunchiglia, University of Trento AOIS’ 02 - June 02,

Coordinating Peer-to-Peer information sources Fausto Giunchiglia, University of Trento AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

The talk n Intuitions n The underlying theory: The Local Relational Model (an application

The talk n Intuitions n The underlying theory: The Local Relational Model (an application of the Local Models Semantics [Ghidini and Giunchiglia, AIJ 2001]) n Some theoretical results n VERY PRELIMINARY logical architecture n … and agents? AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

INTUITIONS AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

INTUITIONS AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Peer to Peer (P 2 P) Computing n Peers come and go, but must

Peer to Peer (P 2 P) Computing n Peers come and go, but must nevertheless be able to interoperate. n There are many examples outside the database field w Napster – a shared directory of available music and client software to read/write the directory and import/export files. w Gnutella – a decentralized group membership and search protocol, mainly used for file sharing. w Groove – a secure shared space among intermittantly connected systems with no central server w… AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Is There a Role for P 2 P Databases ? n There’s hardly any

Is There a Role for P 2 P Databases ? n There’s hardly any literature w Web. DB ’ 01 paper (Gribble, Halevy, Ives, Rodrig, Suciu) focuses on data placement w This implies some control over data placement w They’re serious about building a system (“Piazza”) n Is it a really new research problem? Or only a new application with a lot of hype around it? n Compare it with the work on data integration (Local-asview, global-as-view approaches). Can’t we just apply the same techniques? AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Data integration: a snapshot n Global schema (defined at design time). n Integration defined

Data integration: a snapshot n Global schema (defined at design time). n Integration defined at design time by mapping local data bases into global data base n Global schema as primitive (LAV: local-as-view), or local schemas as primitive (GAV: Global-as-view) n In all cases: take one domain of interpretation (as implicitly defined by the global schema) and MAP all individuals, relations and attributes of databases to integrate into it n Want correctness (query containment) n But: w What if a new node comes in? w Can we really deal with completely autonomous nodes? w What about autonomy at run time (change schema? ) w …. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Coordinating P 2 P databases: is it a new research problem? - 1 Domain

Coordinating P 2 P databases: is it a new research problem? - 1 Domain Characteristics: n Autonomy: peer databases are largely independent (in their language, contents, in how they answer queries …). They may be incomplete, overlapping, semantically heterogeneous, mutually inconsistent, . . n Dinamicity: nodes come and go … and maybe come again …, schemas, attributes, values may change over time, … n You know something about the peer databases. Almost never you know everything. This knowledge is hard to maintain and may be obsolete AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Is it a new research problem? - 2 Solution desiderata: n Need scalability over

Is it a new research problem? - 2 Solution desiderata: n Need scalability over number of nodes n Want “incrementality” as a function of the effort made in developing a solution (design time) and in getting “good” answers (runtime) n (Design or run time) correctness and completeness should be limit cases (most of the time too costly to be implemented) n Want robustness with respect to autonomy of peer databases AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Is it a new research problem? - 3 Solution characteristics: n Keep autonomy, add

Is it a new research problem? - 3 Solution characteristics: n Keep autonomy, add coordination, as much as it can be afforded (see incrementality) n Notion of good enough answer, as a function of coordination effort NOTE: Coordination is NOT (data) integration. w Integration is defined once for all at design time. Coordination may change at run time w Differently from data integration, there is no global schema. By the way, what is a global schema in the P 2 P domain? How much are we willing to pay to approximate it … and maintain it in time? w … AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

The Local Relational Model AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

The Local Relational Model AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

A Motivating Example – 1 - n Scenario w Databases of medical patients w

A Motivating Example – 1 - n Scenario w Databases of medical patients w Complete integration is likely to be infeasible w But dynamic integration of databases relevant to one patient could have high value. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

A Motivating Example – 2 n Consider 3 databases, one table per DB: w

A Motivating Example – 2 n Consider 3 databases, one table per DB: w f: family doctor f: Prescription(Pat. ID, treatment, disease) w p: pharmacist p: Medication(PID, Prod, Prescription. ID) w h: hospital h: Patients(PATid, disease, in, out) n A given patient may be described in all 3 databases n But the databases might use different patient id formats and disease descriptions. n When a patient is injured on a ski holiday in another country, yet more databases need to get involved. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Domain Relations n Each database DBi: its language Li, with a set Ai of

Domain Relations n Each database DBi: its language Li, with a set Ai of unary predicates for Attributes, a set of constant symbols DOMi for Elements, a set of predicates Ri for Relations n Take a set of such DBi, i in I n Define Domain relation rij as a subset of DOMi x DOMj. rij is the set of pairs <di, dj> where, intuitively di and dj (usually different constants) stand for the same object in the world n Each row <d 1, d 2> in domain relation rik specifies that value d 1 in database i corresponds to value d 2 in database k n Clearly, it’s a simplification to have one domain per database. This is just for notational convenience. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

A Motivating Example – 3 n Consider previous 3 databases, w f: family doctor

A Motivating Example – 3 n Consider previous 3 databases, w f: family doctor f: Prescription(p 12, Aspirin, Headache) w p: pharmacist p: Medication(31, Aspirin-Bayer, fd 23) w h: hospital h: Patients(r 3, car_accid, 1/1/01, 3/1/01) n We may have: w <r 3, p 12> in rhf w <31, p 12> in rpf w <p 12, r 3> in rfh, if we have inverse mapping AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Domain relations … more n …. Suppose we have: w <r 3, p 12>

Domain relations … more n …. Suppose we have: w <r 3, p 12> in rhf w <31, p 12> in rpf w <p 12, r 3> in rfh w… n NOTE: We do not collapse local domains in the universal domain (as in data integration). We keep them distinct, and introduce mappings between pairs of domains as objects. Domain relations explicitly manipulated at run time to implement coordination between peer databases. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Domain Relations – Examples n rij may be partial and not surjective (most often

Domain Relations – Examples n rij may be partial and not surjective (most often the case) n rij, rji need not be symmetric: rij (rji(x)) x. For example, consider DBi containing length measurements in meters and DBj in kilometers. One can have w rij(x) = round. To. Closest. K(x), e. g. , rij(653)=1, rij(453)=0 w rji(x) = x*1000 e. g. , rji(1)=1000 n rij= inverse(rji) : different but equivalent representations of same domain n rij= rji = emptyset : disjoint domains (what if only one being emptyset? ) n rik=(rij composed rjk) : transitive mappings among domains n rij(ds)= emptyset, with ds subset of di: keep ds secret n d 1, d 2 in DOMi, d 1<I d 2 d 1’in rij(d 1), d 2’in rij(d 2). (d 1’<j d 2’): preserving order (currency exchange) AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

P 2 P Coordination n Instead of a global schema, assume each peer has

P 2 P Coordination n Instead of a global schema, assume each peer has w pair-wise coordination fomulas that specify interdependencies. w binary domain relations that specify how the symbols used in one database translate to symbols used in another database. n Coordination formulas and domain relations can only refer to acquaintances. n Use domain relations and coordination formulas for query and update processing. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Coordination Formulas – Examples ( p: x). ( p: y). (p: ( z). medication(x,

Coordination Formulas – Examples ( p: x). ( p: y). (p: ( z). medication(x, z, y) f: treatments(x, home, y) ) ( h: x). ( h: y). (h: ( z 1, z 2). patient(x, y, z 1, z 2) f: treatments(x, hospital, y) ) “There’s a row in the treatments table in the family doctor database for each row in the patient and hospital databases” NOTE: see indexing of formulas and variables AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Coordination formulas n Coordination formulas are built from atomic formulas i: f(x), where f(x)

Coordination formulas n Coordination formulas are built from atomic formulas i: f(x), where f(x) is a First Order formula, and using standard connectives: and, or, , , . n Variables quantified on one DB may have to be interpreted on other DBs. Mapping is done exploiting domain relations. Consider, eg. : w (i: x). j: P(x) “for each object di in DOMi, the corresponding object dj =rij(di) in DOMj has the property P” w (i: x). (i: P(x) j: Q(x) and k: R(x)) “for each object di in DOMi, if P holds of di … n Quantification is always done with respect to the domain of one database. However notice difference between w (i: x). A(x), with A(x)a coordination formula w i: x. B(x), with B(x)a first order formula. It holds iff (i: x). i: B(x) holds AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Higher Level Correspondences n One can generalize the domain relation to correspondences at higher

Higher Level Correspondences n One can generalize the domain relation to correspondences at higher meta-levels w constant to constant, e. g. , ‘one’ ‘uno’; or CAN$1. 00 US$0. 65 w table to table, e. g. , Customer w column to column, e. g. , name(Cust) nm(Customer) n This is also captured in coordination formulas. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Answering Queries n Local queries. Treated as if there exist no peer databases. They

Answering Queries n Local queries. Treated as if there exist no peer databases. They are first order formulas of the form A(x) q(x) with A(x) a first order formula, x and q as below n Global queries. They are coordination formulas of the form A(x) i: q(x) w where Ø A(x) is a coordination formula Ø x has n variables Ø q is a new n-ary predicate symbol Ø i is the database which gets the query w The answer to a global query is {d domin such that ( i: x). A(x) i: x=d)} AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Answering Queries – An example n Consider the query below, submitted to database h:

Answering Queries – An example n Consider the query below, submitted to database h: ((i: P(x) j: R(y)) k: S(x, y) ) h: q(x, y) n Three steps: 1. Evaluate P, R, S in i, j, k (respectively) 2. map results via rih, rjh, rkh to sets si, sj, sk and then 3. compute ((si sj) sk) AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

SOME THEORETICAL RESULTS AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

SOME THEORETICAL RESULTS AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Theoretical Results – 1 n Provide a model theory by defining the Local Relational

Theoretical Results – 1 n Provide a model theory by defining the Local Relational Model in terms of Relational spaces, where a relational space is defined as a pair: <set of local databases, set of pairwise domain relations> n Provide a notion of satisfiability and logical consequence of coordination formulas with respect to relational frames n Provide inference rules for using coordination formulas. n Prove them sound and complete with respect to the LRM. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Theoretical Results – 2 n Define a generalized relational theory as a theory with

Theoretical Results – 2 n Define a generalized relational theory as a theory with domain closure, distinct domain values, and finite number of possible relation extensions (closed world assumption). n Define relational multi-context system <T, R> as a family of relational languages (one per database) with a generalized relational theory (in T) and set of coordination formulas (in R). n Prove that for any relational multi-context system, there’s a unique maximal relational space that satisfies it. (Generalizes Reiter’s result on CWA and single databases. ) AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Theoretical Results – 3 Given a multi-context system <T, R> that represents it, the

Theoretical Results – 3 Given a multi-context system <T, R> that represents it, the answer to a query A(x) i: q(x) is the set of all d such that {i: Ti}i I, R |- ( i: x). A(x) i: x=d) This result is the basis for a correct and complete query answering mechanism (for a given set of coordination formulas … which may implement something totally different from the data integration approach (LAV, GAV)) AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

VERY PRELIMINARY HINTS OF A LOGICAL ARCHITECTURE AOIS’ 02 - June 02, 2002 Coordinating

VERY PRELIMINARY HINTS OF A LOGICAL ARCHITECTURE AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

A proposed architecture (prelim. ) – 1 Four basic ingredients 1. Interest Group: set

A proposed architecture (prelim. ) – 1 Four basic ingredients 1. Interest Group: set of nodes being able to answer queries about a certain topic (e. g. , Tourism, medical care). Needed to compute scope of query answering 2. Acquaintance (with respect to a node and a given query): a node which is supposed to have information that can be used to answer the query 3. Coordination rule (with respect to an acquaintance): it says how to propagate query forward and results back 4. Correspondence rule (with respect to an acquaintance): it takes care of semantic heterogeneity problem. AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

A proposed architecture (prelim. ) – 2 From theory to practice 1. Interest Group:

A proposed architecture (prelim. ) – 2 From theory to practice 1. Interest Group: In LRM is the set of databases in a relational frame 2. Acquaintance (of a node n 1): In LRM any node n 2 for which there is a coordination formula involving n 1 and n 2 3. Coordination rule: An implementation of coordination formulas, parametric on correspondence rules. 4. Correspondence rule : A set of rewrite rules which implement the language dependent part of coordination formulas and take care of semantic heterogeneity (domain relations are implemented as special kinds of correspondence rules). AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Level 1 architecture – The P 2 P layer n P 2 P Layer

Level 1 architecture – The P 2 P layer n P 2 P Layer w P 2 P functionality is add-on n Local Data Source w w Database File system Web site … n User Interface w User queries w Results w … n Query Manager and Update Manager w responsible for query and update propagation w manage coordination and correspondence rules, acquaintances, and interest groups n Wrapper w provides a translation layer between QM and UM, and LDS AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources 30

Level 2 architecture – The Query manager n Propagation Planner w Talks to group-manager

Level 2 architecture – The Query manager n Propagation Planner w Talks to group-manager n Query Formation w Responsible of formation of outgoing queries, as well as querying the local data source n Results Handler w Responsible for sending and receiving query results; w Shows results to user n Executed Query History w Preventing from duplicate query execution n Acquaintances n Interest Groups n Group Management w Used only by node-managers for management of groups and query propagation n Coordination and Correspondence Rules AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources 31

Query propagation strategy ← Re s 2 1. Node defines query topic GM 2.

Query propagation strategy ← Re s 2 1. Node defines query topic GM 2. Node sends Group Manager (GM) request of Query Scope (QS) 3. GM computes QS 4. QS ( , topic)= (2, 4, 6, 8, 9, 11) 4. Node 1 sends query to acquaintances, in QS, namely 2 and 4, and reports this 9 fact to GM. 6 5. Nodes 2 and 4 send answer to node 1 2 6. Node 2 propagates query to its acquaintances in QS, namely 4 and 6, 2. Q ( , topic) 10 7 1. Q ( ) and reports this fact to GM ←Res 4 1 4 7. And so on… 8. Nodes which do not propagate any 11 further, report this fact to GM 3 9. Propagation stops when “no more 5 propagation” received from all 8 boundary nodes (reached all reachable acquaintances). AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Summary n Coordinating P 2 P information sources: keep autonomy, add (run-time) coordination. Be

Summary n Coordinating P 2 P information sources: keep autonomy, add (run-time) coordination. Be content with good enough answers. n Theoretically, model coordination using four notions: set of local databases, domain relations, coordination formulas, global answer to a query n Implementationally, implement coordination using five notions: interest groups, acquaintances, coordination rules, correspondence rules, coordination algorithm n … and agents? AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources

Published work (not much … yet) n Paper on LRM still unpublished, but see

Published work (not much … yet) n Paper on LRM still unpublished, but see project Web page n Paper on basic ideas in WEBDB 2002 n Paper on architecture in CIA 2002 n These slides soon on my Web page Project Web page (to be put up soon) will be accessible from my Web page: http: //www. ict. unitn. it/~fausto/ AOIS’ 02 - June 02, 2002 Coordinating Peer-to-Peer information sources