KR A Principled Framework for Modular Web Rule Bases and its Semantics Anastasia Analyti Institute of Computer Science, FORTH-ICS, Greece Grigoris Antoniou Dept. of Computer Science, Univ. of Crete, Greece Carlos Viegas Damásio CENTRIA, Depart. De Informatica, Univ. Nova de Lisboa, Portugal
KR Motivation & Requirements Open-World and Closed-World Reasoning MWeb Modular Rule Bases syntax validity example MWebAS & MWebWFS model-theoretic semantics properties Conclusions - Future work Presentation Overview
KR Merging knowledge over rule bases on the Web is an important problem. Modularity, encapsulation, information hiding, and access control mechanisms are required. Closed-world and open-world reasoning should be supported. Proposed mechanisms should guarantee monotonicity of reasoning on all predicates, in the case that new rule bases are added to the modular base. The proposed modularity framework should have clear model- theoretic semantics. Motivation & Requirements
KR Rule bases defining a predicate p need mechanisms to express: if reasoning on p is open, closed, or normal that p is hidden, can only be imported, or redefined by other rule bases that p is exported to all requesting rule bases or only to particular ones Rule bases importing knowledge about a predicate p need mechanisms to express: the reasoning mode that p is requested if knowledge on p is imported from all providing rule bases or from particular ones Requirements (Cont.)
KR Open-World Reasoning Founded on First Order Logic Adopted in Description Logics, OWL, and SWRL Appropriate for predicates “fully-shared” in the Semantic Web Sometimes too conservative Closed-World Reasoning Founded on Nonmonotonic Logics Adopted in Logic Programming and WRL Appropriate for Deductive Databases Sometimes too brave Open-World & Closed-World Reasoning
KR Open-world and closed-world assumptions can be already combined in Extended Logic Programming! Two forms of negation are required: strong or explicit weak, default, or negation as failure The two forms of negation are available in: Well-founded semantics with explicit negation (WFSX) Answer Set Semantics (AS) The proposed solution is the same for both semantics Our Approach for OWAs & CWAs
KR Consider the following list of facts: % All current EU countries CountryEU(Austria) … CountryEU(UK) % Some non EU countries (not all…) CountryEU(China) CountryEU(Djibuti) Example
KR Closed world reasoning: CountryEU(?c) ← ~ CountryEU(?c) Open world reasoning: CountryEU(?c) ← ~ CountryEU(?c) CountryEU(?c) ← ~ CountryEU(?c) OWAs & CWAs with the help of Extended LP
KR Is Austria an EU country ? YES, due to the fact CountryEU(Austria) Is China an EU country ? NO, due to the fact CountryEU(China) Is Montenegro an EU country ? NO, because it is not listed and the list is complete (CLOSED WORLD REASONING) DON’T KNOW, because it is not listed and the list is not complete (OPEN WORLD REASONING) A Little Geography ….
KR An (MWeb) rule base s is a triple where: Name s is the name of s (an IRI reference) P s is the logic program of s (an MWeb logic program) Int s is the interface of s DEFINES declarations USES decarations An (MWeb) modular rule base S is a set of rule bases MWeb Modular Rule Bases
KR A term is an IRI reference, an RDF literal, or a variable An atom is: a simple atom p(t 1, …, t k ) or a qualified atom t (t 1, …, t k ) An (MWeb) rule r is a formula of the form L ← L 1, …, L m, ~ L m+1, …,~ L n where L is a simple atom A or the strong negation of a simple atom A L i is an atom A or the strong negation of an atom A If m=n, rule r is called objective An (MWeb) logic program P is a set of rules The Logic Program of a Rule Base
KR According to their reasoning modes, predicates are declared as: Definite predicates Open predicates Closed predicates positively closed negatively closed Normal predicates Definite, open, and closed predicates are limited to be defined by rules without weak negation Normal predicates can use the full language Predicate Reasoning Modes
KR If a predicate is declared definite in a rule base s then p is defined by objective rules, only. Similar to Definite Logic Programming, but allowing for explicit negation in the head and body of the rules Open and closed predicates appearing in the defining rules of p are interpreted, as if they had been declared definite. Definite Predicates defines … definite geo:Country geo:Country(Egypt). geo:Country(Canada). Rule Base s Example:
KR If a predicate is declared open in a rule base s w.r.t. a context cxt then p is defined not only by a set of objective rules, but also through the following rules, called, contextual OWA rules of p p(?x 1,…,?x n ) ← cxt(?x 1,…,?x n ), ~ p(?x 1,…,?x n ) p(?x 1,…,?x n ) ← cxt(?x 1,…,?x n ), ~ p(?x 1,…,?x n ) Context cxt is optional, and if defined, it should be a definite predicate Closed predicates appearing in the defining rules of p are interpreted, as if they had been declared open Open Predicates
KR Example of Open Predicates defines … open eu:CountryEU wrt context geo:Country. defines … definite geo:Country. eu:CountryEU(Austria). eu:CountryEU(Greece). … geo:Country(Egypt). geo:Country(Canada). … Rule Base s OWA rules: eu:CountryEU(?c) ← geo:Country(?c), ~ eu:CountryEU(?c) eu:CountryEU(?c) ← geo:Country(?c), ~ eu:CountryEU(?c)
KR If a predicate is declared positively or negatively closed in a rule base s w.r.t. a context cxt then p is defined not only by a set of objective rules, but also through a positive contextual CWA rule p(?x 1,…,?x n ) ← cxt(?x 1,…,?x n ), ~ p(?x 1,…,?x n ) or a negative contextual CWA rule p(?x 1,…,?x n ) ← cxt(?x 1,…,?x n ), ~ p(?x 1,…,?x n ) Context cxt is optional, and if defined, it should be a definite predicate Positively/Negatively Closed Predicates
KR Example of Positively Closed Predicates defines … posClosed eu:CountryEU wrt context geo:Country. defines … definite geo:Country. eu:CountryEU(Austria). euCountryEU(Greece). … geo:Country(Egypt). geo:Country(Canada). … Rule Base s CWA rule: eu:CountryEU(?c) ← geo:Country(?c), ~ eu:CountryEU(?c)
KR Let S be a modular rule base. The scope of a predicate p defined in a rule base s S can take the following values: Global: p is visible outside s and can be defined by any other rule base s’ S in global or internal scope only. The reasoning mode of global predicates must be always definite or open. Local: p is visible outside s and can be defined by any other rule base s’ S in internal scope only. Internal: p is visible inside s, only. No constraint is imposed on the reasoning mode of local and internal predicates Predicate Scope
KR DEFINES declarations: Determine which predicates p are defined in s, their scope, and defining reasoning mode Provide the rule bases to which s is willing to export p USES declarations: Determine which predicates p are requested by s and their requesting reasoning mode in s i.e., the reasoning mode in which s requests p definite, open, closed, normal Provide the rule bases from which s requests p Interface of a Rule Base s
KR DEFINES declarations: defines global | local |internal definite | open | posClosed | negClosed |normal PredicateInd [ wrt context PredicateInd] [visible to RuleBaseList] USES declarations: uses definite | open |closed | normal PredicateInd [ from RuleBaseList] The syntax of Defines and Uses Declarations
KR A modular rule base is valid if it satisfies a number of validity constraints: most of these constraints have already been presented Additionally: the complete list can be found in the paper In our work, we consider valid modular rule bases, only Validity of a Modular Rule Base
KR Example of a Modular Rule Base defines local posClosed eu:CountryEU. eu:CountryEU(Austria). eu:CountryEU(Greece). Rule base s 1 defines local open sec:citizenOf. defines global open sec:Suspect. sec:citizenOf(Anne,Austria). sec:citizenOf(Boris,Croatia). sec:Suspect(Peter). Rule base s 2 defines local normal gov:Enter visible to. defines local negClosed gov:RequiresVisa. defines internal open sec:citizenOf. uses open eu:CountryEU from. uses definite sec:citizenOf from. uses definite sec:Suspect from. gov:Enter(?p) eu:Country(?c), sec:citizenOf(?p,?c), (?p). gov:Enter(?p) eu:Country(?c), sec:citizenOf(?p,?c), gov:RequiresVisa(?c), (?p). gov:RequiresVisa(Croatia). sec:citizenOf(Peter,Greece). Rule base s 3
KR Let S be a modular rule base We define the MWebAS & MWebWFS of S model-theoretically through a uniform definition extending the AS and WFSX semantics on ELPs keeping all of their computational characteristics equivalent transformational semantics can be provided through generated ELPs that can be evaluated through AS and WFSX semantics, respectively Model-theoretic Semantics
KR Let S be a modular rule base The Herbrand Base of rule base s S wrt S consists of: p(c 1, …., c k ), where p is defined in s c i is a constant appearing in S 1, …., c k ), where p is requested by s from rbase c i is a constant appearing in S Herbrand Base of a Rule Base
KR Let S be a modular rule base A simple normal (resp. extended) interpretation of a rule base s wrt S is a 2-valued (resp. 3-valued) interpretation of the Herbrand Base of s wrt S A normal (resp. extended) interpretation of S is a set I = {I s | s S}, where: –I s = –I s i is a simple (resp.extended) interpretation of s wrt S –I s d, I s o, I s c, I s n correspond to the 4 reasoning modes of s Normal & Extended Interpretation of a Modular Rule Base
KR Let S be a modular rule base A normal (resp. extended) answer set of S is a normal (resp. extended) interpretation of S that satisfies certain constraints provided in the paper extending the definition of answer set (resp. extended stable model) of AS and WFSX semantics on ELPs Let p be a predicate defined in a rule base s S at reasoning mode m then: MWebAS & MWebWFS entailment
KR current reasoning mode of s Let p be a predicate defined in a rule base s Properties of MWeb Semantics defining reasoning mode of p in s
KR requesting reasoning mode of p in s’ (importer) Let p be a predicate defined in a rule base s and imported by a rule base s’ Properties of MWeb Semantics (cont.) defining reasoning mode of p in s (exporter)
KR Example defines local posClosed eu:CountryEU. eu:CountryEU(Austria). eu:CountryEU(Greece). Rule base s 1 defines local open sec:citizenOf. defines global open sec:Suspect. sec:citizenOf(Anne,Austria). sec:citizenOf(Boris,Croatia). sec:Suspect(Peter). Rule base s 2 defines local normal gov:Enter visible to. defines local negClosed gov:RequiresVisa. defines internal open sec:citizenOf. uses open eu:CountryEU from. uses definite sec:citizenOf from. uses definite sec:Suspect from. gov:Enter(?p) eu:Country(?c), sec:citizenOf(?p,?c), (?p). gov:Enter(?p) eu:Country(?c), sec:citizenOf(?p,?c), gov:RequiresVisa(?c), (?p). gov:RequiresVisa(Croatia). sec:citizenOf(Peter,Greece). Rule base s 3 S={s 1, s 2, s 3 }
KR defines local posClosed eu:CountryEU. eu:CountryEU(Austria). eu:CountryEU(Greece). Rule base s 1 defines local open sec:citizenOf. defines global open sec:Suspect. sec:citizenOf(Anne,Austria). sec:citizenOf(Boris,Croatia). sec:Suspect(Peter). Rule base s 2 defines local normal gov:Enter visible to. defines local negClosed gov:RequiresVisa. defines internal open sec:citizenOf. uses open eu:CountryEU from. uses definite sec:citizenOf from. uses definite sec:Suspect from. gov:Enter(?p) eu:Country(?c), sec:citizenOf(?p,?c), (?p). gov:Enter(?p) eu:Country(?c), sec:sitizenOf(?p,?c), gov:RequiresVisa(?c), (?p). gov:RequiresVisa(Croatia). sec:citizenOf(Peter,Greece). Rule base s 3 S={s 1, s 2, s 3 } Example (cont.)
KR defines local posClosed eu:CountryEU. eu:CountryEU(Austria). eu:CountryEU(Greece). Rule base s 1 defines local open sec:sitizenOf. defines global open sec:Suspect. sec:citizenOf(Anne,Austria). sec:citizenOf(Boris,Croatia). sec:Suspect(Peter). Rule base s 2 defines local normal gov:Enter visible to. defines local negClosed gov:RequiresVisa. defines internal open sec:citizenOf. uses open eu:CountryEU from. uses definite sec:citizenOf from. uses definite sec:Suspect from. gov:Enter(?p) eu:Country(?c), sec:sitizenOf(?p,?c), (?p). gov:Enter(?p) eu:Country(?c), sec:sitizenOf(?p,?c), gov:RequiresVisa(?c), (?p). gov:RequiresVisa(Croatia). sec:citizenOf(Peter,Greece). Rule base s 3 S={s 1, s 2, s 3 } Case-based Analysis of MWebAS
KR defines local posClosed eu:CountryEU. eu:CountryEU(Austria). eu:CountryEU(Greece). Rule base s 1 defines local open sec:sitizenOf. defines global open sec:Suspect. sec:citizenOf(Anne,Austria). sec:citizenOf(Boris,Croatia). sec:Suspect(Peter). Rule base s 2 defines local normal gov:Enter visible to. defines local negClosed gov:RequiresVisa. defines internal open sec:citizenOf. uses open eu:CountryEU from. uses definite sec:citizenOf from. uses definite sec:Suspect from. gov:Enter(?p) eu:Country(?c), sec:sitizenOf(?p,?c), (?p). gov:Enter(?p) eu:Country(?c), sec:sitizenOf(?p,?c), gov:RequiresVisa(?c), (?p). gov:RequiresVisa(Croatia). sec:citizenOf(Peter,Greece). Rule base s 3 S={s 1, s 2, s 3 } Restricted Propagation of Local Inconsistencies s 1 is inconsistent according to all simple and extended answer sets of S s 3 is affected from the inconsistency s 2 remains consistent eu:CountryEU(Austria).
KR Similarly to AS and WFSX on ELPs, MWebAS is more informative than MWebWFS Entailment under MWebAS is data-complete for co-NP Entailment under MWebWFS has polynomial data complexity Both MWeb semantics guarantee monotonicity of reasoning on all predicates, in the case that: new rule bases are added to the modular rule base S, and the importing rule base list of the predicates of the old rule bases stays the same. Properties of MWeb Semantics (cont.)
KR Our MWeb framework for modular rule bases supports: Reasoning in four modes: Definite: weak negation is not accepted at all Open: only OWAs are accepted Closed: both CWAs and OWAs are accepted Normal: weak negation is fully accepted Local closed-world and open-world assumptions Scoped negation-as-failure and scoped literal evaluation Restricted propagation of local inconsistencies Future work concerns: the definition of the transformational semantics the definition of modular Extended RDF ontologies Conclusions – Future Work