A Principled Framework for Modular Web Rule Bases and its Semantics

Download Report

Transcript A Principled Framework for Modular Web Rule Bases and its Semantics

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-2008
1
Presentation Overview
• Motivation & Requirements
• Open-World and Closed-World Reasoning
• MWeb Modular Rule Bases
• syntax
• validity
• example
• MWebAS & MWebWFS model-theoretic semantics
• properties
• Conclusions - Future work
KR-2008
2
Motivation & Requirements
•
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 modeltheoretic semantics.
KR-2008
3
Requirements (Cont.)
•
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
KR-2008
4
Open-World & Closed-World
Reasoning
•
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
KR-2008
5
Our Approach for OWAs & CWAs
•
Open-world and closed-world assumptions can be already
combined in Extended Logic Programming!
•
Two forms of negation are required:
•
•
•
The two forms of negation are available in:
•
•
•
strong or explicit
weak, default, or negation as failure
Well-founded semantics with explicit negation (WFSX)
Answer Set Semantics (AS)
The proposed solution is the same for both semantics
KR-2008
6
Example
•
Consider the following list of facts:
% All current EU countries
CountryEU(Austria) … CountryEU(UK)
% Some non EU countries (not all…)
 CountryEU(China)
 CountryEU(Djibuti)
KR-2008
7
OWAs & CWAs with the help of Extended LP
•
Closed world reasoning:
 CountryEU(?c) ← ~ CountryEU(?c)
•
Open world reasoning:
 CountryEU(?c) ← ~ CountryEU(?c)
CountryEU(?c) ← ~  CountryEU(?c)
KR-2008
8
A Little Geography ….
•
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)
KR-2008
9
MWeb Modular Rule Bases
•
An (MWeb) rule base s is a triple
<Names, Ps, Ints>
where:
•
Names is the name of s (an IRI reference)
•
Ps is the logic program of s (an MWeb logic program)
•
Ints is the interface of s


•
DEFINES declarations
USES decarations
An (MWeb) modular rule base S is a set of rule bases
KR-2008
10
The Logic Program of a Rule Base
•
•
•
A term is an IRI reference, an RDF literal, or a variable
An atom is:
•
a simple atom p(t1, …, tk) or
•
a qualified atom p@Namet(t1, …, tk)
An (MWeb) rule r is a formula of the form
L ← L1 , …, Lm , ~ Lm+1 , …,~ Ln
where
L is a simple atom A or the strong negation of a
simple atom  A
Li 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
KR-2008
11
Predicate Reasoning Modes
•
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
KR-2008
12
Definite Predicates
•
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.
Example:
Rule Base s
<http://geography.int>
defines … definite geo:Country
geo:Country(Egypt).
KR-2008
geo:Country(Canada).
13
Open Predicates
•
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(?x1,…,?xn) ← cxt(?x1,…,?xn), ~ p(?x1,…,?xn)
p(?x1,…,?xn) ← cxt(?x1,…,?xn), ~  p(?x1,…,?xn)
•
•
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
KR-2008
14
Example of Open Predicates
Rule Base s
<http://europa.eu>
defines … open eu:CountryEU wrt context geo:Country.
defines … definite geo:Country.
eu:CountryEU(Austria). eu:CountryEU(Greece). …
geo:Country(Egypt).
geo:Country(Canada). …
OWA rules:
 eu:CountryEU(?c) ← geo:Country(?c), ~ eu:CountryEU(?c)
eu:CountryEU(?c) ← geo:Country(?c), ~  eu:CountryEU(?c)
KR-2008
15
Positively/Negatively Closed Predicates
•
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(?x1,…,?xn) ← cxt(?x1,…,?xn), ~ p(?x1,…,?xn)
or a negative contextual CWA rule
p(?x1,…,?xn) ← cxt(?x1,…,?xn), ~  p(?x1,…,?xn)
•
Context cxt is optional, and if defined, it should be a
definite predicate
KR-2008
16
Example of Positively Closed Predicates
Rule Base s
<http://europa.eu>
defines … posClosed eu:CountryEU wrt context geo:Country.
defines … definite geo:Country.
eu:CountryEU(Austria). euCountryEU(Greece). …
geo:Country(Egypt).
geo:Country(Canada). …
CWA rule:
 eu:CountryEU(?c) ← geo:Country(?c), ~ eu:CountryEU(?c)
KR-2008
17
Predicate Scope
•
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
KR-2008
18
Interface of a Rule Base s
•
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
KR-2008
19
The syntax of Defines and Uses Declarations
•
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]
KR-2008
20
Validity of a Modular Rule Base
A modular rule base is valid if it satisfies a number of
validity constraints:
•
most of these constraints have already been presented
•
Additionally:
uses p
(importer)
•
•
•
normal
allowed
allowed
allowed
allowed
closed
allowed
allowed
allowed
error
open
allowed
allowed
allowed
error
objective
allowed
allowed allowed error
objective open
closed
normal
defines p (exporter)
the complete list can be found in the paper
In our work, we consider valid modular rule bases, only
KR-2008
21
Example of a Modular Rule Base
<http://europa.eu>
<http://security.int>
defines local posClosed eu:CountryEU.
defines local open sec:citizenOf.
defines global open sec:Suspect.
eu:CountryEU(Austria).
eu:CountryEU(Greece).
sec:citizenOf(Anne,Austria).
sec:citizenOf(Boris,Croatia).
sec:Suspect(Peter).
Rule base s2
Rule base s1
<http://gov.countryY>
defines local normal gov:Enter visible to <http://security.int>.
defines local negClosed gov:RequiresVisa.
defines internal open sec:citizenOf.
uses open eu:CountryEU from <http://europa.eu>.
uses definite sec:citizenOf from <http://security.int>.
uses definite sec:Suspect from <http://security.int>.
gov:Enter(?p)  eu:Country(?c), sec:citizenOf(?p,?c),
~sec:Suspect@<http://security.int>(?p).
gov:Enter(?p)   eu:Country(?c), sec:citizenOf(?p,?c),
gov:RequiresVisa(?c),
~sec:Suspect@<http://security>(?p).
gov:RequiresVisa(Croatia).
sec:citizenOf(Peter,Greece).
KR-2008
Rule base s3
22
Model-theoretic Semantics
•
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
KR-2008
23
Herbrand Base of a Rule Base
•
Let S be a modular rule base
•
The Herbrand Base of rule base s  S wrt S consists of:
•
•
p(c1, …., ck), where

p is defined in s

ci is a constant appearing in S
p@rbase(c1, …., ck), where

p is requested by s from rbase

ci is a constant appearing in S
KR-2008
24
Normal & Extended Interpretation of a
Modular Rule Base
•
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 = {Is | s  S}, where:
–
Is = < Isd, Iso, Isc, Isn>
–
Isi is a simple (resp.extended) interpretation of s wrt S
–
Isd, Iso, Isc, Isn correspond to the 4 reasoning modes of s
KR-2008
25
MWebAS & MWebWFS entailment
•
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:
s |mAS p (c) if for each normal answer set M of S , M m ( p (c))  1
S
s
s |mWFS p (c) if for each extended answer set M of S , M m ( p (c))  1
S
s
KR-2008
26
Properties of MWeb Semantics
• Let p be a predicate defined in a rule base s
current
reasoning
mode of s
normal
closed
open
definite open
definite open
definite open
closed
closed
open
normal
definite definite definite definite
definite open
closed
normal
defining reasoning mode of p in s
KR-2008
27
Properties of MWeb Semantics (cont.)
• Let p be a predicate
• defined in a rule base s and
• imported by a rule base s’
requesting
reasoning
mode of p in s’
(importer)
normal
definite open
closed
closed
open
definite open
definite open
closed
open
normal
definite definite definite definite
definite open
closed
normal
defining reasoning mode of p in s (exporter)
KR-2008
28
Example
S={s1, s2, s3}
<http://europa.eu>
<http://security.int>
defines local posClosed eu:CountryEU.
defines local open sec:citizenOf.
defines global open sec:Suspect.
eu:CountryEU(Austria).
eu:CountryEU(Greece).
sec:citizenOf(Anne,Austria).
sec:citizenOf(Boris,Croatia).
sec:Suspect(Peter).
Rule base s2
Rule base s1
<http://gov.countryY>
defines local normal gov:Enter visible to <http://security.int>.
defines local negClosed gov:RequiresVisa.
defines internal open sec:citizenOf.
uses open eu:CountryEU from <http://europa.eu>.
uses definite sec:citizenOf from <http://security.int>.
uses definite sec:Suspect from <http://security.int>.
SEM
s1 |
eu : CountryEU (Croatia ) ,
S
gov:Enter(?p)  eu:Country(?c), sec:citizenOf(?p,?c),
~sec:Suspect@<http://security.int>(?p).
while
gov:Enter(?p)   eu:Country(?c), sec:citizenOf(?p,?c),
s3 | SEM eu : CountryEU (Croatia )
gov:RequiresVisa(?c),
S
~sec:Suspect@<http://security>(?p).
for
gov:RequiresVisa(Croatia).
sec:citizenOf(Peter,Greece).
KR-2008
Rule
SEM  {mAS, mWFS
} base s3
29
Example (cont.)
S={s1, s2, s3}
<http://europa.eu>
<http://security.int>
defines local posClosed eu:CountryEU.
defines local open sec:citizenOf.
defines global open sec:Suspect.
eu:CountryEU(Austria).
eu:CountryEU(Greece).
sec:citizenOf(Anne,Austria).
sec:citizenOf(Boris,Croatia).
sec:Suspect(Peter).
Rule base s2
Rule base s1
s3 | SEM gov : Enter( Anne)
S
defines local normal gov:Enter visible to <http://security.int>.
and
defines local negClosed gov:RequiresVisa.
<http://gov.countryY>
defines internal open sec:citizenOf.
s3 | SEM ~ gov : Enter( Peter)
S
uses open eu:CountryEU from <http://europa.eu>.
uses definite sec:citizenOf from <http://security.int>. for
uses definite sec:Suspect from <http://security.int>.
SEM  {mAS , mWFS}
gov:Enter(?p)  eu:Country(?c), sec:citizenOf(?p,?c),
~sec:Suspect@<http://security.int>(?p).
gov:Enter(?p)   eu:Country(?c), sec:sitizenOf(?p,?c),
gov:RequiresVisa(?c),
~sec:Suspect@<http://security>(?p).
gov:RequiresVisa(Croatia).
sec:citizenOf(Peter,Greece).
KR-2008
Rule base s3
30
Case-based Analysis of MWebAS
S={s1, s2, s3}
<http://europa.eu>
<http://security.int>
defines local posClosed eu:CountryEU.
defines local open sec:sitizenOf.
defines global open sec:Suspect.
eu:CountryEU(Austria).
eu:CountryEU(Greece).
sec:citizenOf(Anne,Austria).
sec:citizenOf(Boris,Croatia).
sec:Suspect(Peter).
Rule base s2
Rule base s1
<http://gov.countryY>
defines local normal gov:Enter visible to <http://security.int>.
defines local negClosed gov:RequiresVisa.
defines internal open sec:citizenOf.
s 3 | mAS gov : Enter( Boris ) ,
S
uses open eu:CountryEU from <http://europa.eu>.
uses definite sec:citizenOf from <http://security.int>. while
uses definite sec:Suspect from <http://security.int>.
mWFS gov : Enter( Boris )
gov:Enter(?p)  eu:Country(?c), sec:sitizenOf(?p,?c), s 3 |
S
~sec:Suspect@<http://security.int>(?p).
gov:Enter(?p)   eu:Country(?c), sec:sitizenOf(?p,?c),
gov:RequiresVisa(?c),
~sec:Suspect@<http://security>(?p).
gov:RequiresVisa(Croatia).
sec:citizenOf(Peter,Greece).
KR-2008
Rule base s3
31
Restricted Propagation of Local Inconsistencies
S={s1, s2, s3}
<http://europa.eu>
<http://security.int>
defines local posClosed eu:CountryEU.
defines local open sec:sitizenOf.
defines global open sec:Suspect.
eu:CountryEU(Austria).
eu:CountryEU(Greece).
eu:CountryEU(Austria). Rule base s1
sec:citizenOf(Anne,Austria).
sec:citizenOf(Boris,Croatia).
sec:Suspect(Peter).
Rule base s2
<http://gov.countryY>
defines local normal gov:Enter visible to <http://security.int>.
defines local negClosed gov:RequiresVisa.
defines internal open sec:citizenOf.
• s1 is inconsistent
uses open eu:CountryEU from <http://europa.eu>.
uses definite sec:citizenOf from <http://security.int>.
uses definite sec:Suspect from <http://security.int>.
according to all simple
and extended answer
sets of S
• s is affected from the
3
gov:Enter(?p)  eu:Country(?c), sec:sitizenOf(?p,?c),
~sec:Suspect@<http://security.int>(?p). inconsistency
• s2 remains consistent
gov:Enter(?p)   eu:Country(?c), sec:sitizenOf(?p,?c),
gov:RequiresVisa(?c),
~sec:Suspect@<http://security>(?p).
gov:RequiresVisa(Croatia).
sec:citizenOf(Peter,Greece).
KR-2008
Rule base s3
32
Properties of MWeb Semantics (cont.)
•
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.
KR-2008
33
Conclusions – Future Work
•
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
KR-2008
34