1 CENTRIA, Dept. Informática da Faculdade de Ciências e Tecnologia, Universidade Nova de Lisboa,2829-516 Caparica, Portugal.
2 Institute of Computer Science, FORTH-ICS,Crete, Greece.
3 Dept. of Computer Science, Univ. of Crete,Crete, Greece.
OutlineMotivation
Background: MWeb and Extended RDF
Simple Modular Extended RDF
Example
Embedding RIF, RDF, RDFS, and ERDF
Direct translation into Extended Logic Programming
Evaluation
Conclusions
MotivationKnowledge in the Semantic Web must be shared
and modularly organised.
The MWeb framework provides general mechanisms to specify modular rulebases in the Semantic Web, and has a working implementation supporting some of the Rule Interchange Format (RIF) constructs.
MWeb• Contextualized and global interpretation of arbitrary
predicates.• Explicit control of monotonicity and non-monotonicity.• Scoped open and closed world assumptions.• Separate interface and implementation of rulebases
with modular and independent compilation and loading.
Simple Modular Extended RDF
Equips RDF graphs with modularity constructs and declarative rules.
A simple modular ERDF ontology is formed by an interface and logic part [RR 2009].
Interface Declares exported classes and properties with visibility lists Declares imported classes and properties with import lists
(sources of information)
Logic part An (E)RDF graph which may contain negative triples Rules whose bodies are combinations of conjunctions, weak
negations (naf) and strong negations (neg) of triples Qualified literals (Lit @ Name) in bodies allow querying of
other (remote) ontologies
A glimpse of syntax (interface)
:- rulebase 'anne'.:- import('erdf.mw',interface).
% Defined and exported predicates:- defines global normal class(mw:Vocabulary).:- defines global normal property(choose) visible to 'peter'.
% Used (imported) predicates:- uses normal class(EUCountry) from 'geo'.:- uses normal property(travel), property(visit) from 'pyr', 'agcy'.
:- uses normal class(mw:Vocabulary) from 'pyr', 'agcy’, 'geo'.
A glimpse of syntax (rules)
:- import('erdf.rb',rulebase).
?Package.[choose ->> ?Ctry ] :-
neg ( ?Ctry # EUCountry),
?Package.[travel ->> ?Ctry ] @ 'pyr',
?Package.[visit ->> ?City ] @ 'pyr',
naf neg ?Package.[visit ->> ?City].
…
Approach followed The semantics of ERDF is itself declaratively specified in
MWeb rulebases which must be imported by the translated simple modular ERDF ontologies.
The following four MWeb rulebases are used:
1. RIF: specifies membership and subclass predicates, frames and (partially) equality.
2. RDF: specifies RDF reasoning rules, RDF axiomatic triples and relationship to RIF predefined predicates.
3. RDFS: axiomatic triples, RDFS closure rules, e.g class and property inheritance. Handles domain and range of properties.
4. ERDF: Specifies rules defining total and closed classes and properties on top of RDFS. Inheritance of negative extensions.
RIF builtins (logical part)
RDF embedding (logical part)
RDFS embedding (logical part)
ERDF embedding (interface)
:- rulebase 'http://erdf.org'.:- prefix erdf='http://erdf.org#'.:- import( 'rdfs.mw', interface ).
:- defines internal normal class(erdf:TotalClass), class(erdf:TotalProperty).
:- defines internal normal class(erdf:PositivelyClosedClass), class(erdf:NegativelyClosedClass). class(erdf:PositivelyClosedProperty), class(erdf:NegativelyClosedProperty).
:- defines internal normal property(erdf:complementOf).
ERDF embedding (logical part)
Rules to handle strong negation extensions in RIF, RDF and RDFS
% Compatibility with RIFneg ?X # ?Y :- neg ?X.[ rdf:type ->> ?Y].neg ?X.[rdf:type ->> ?Y] :- neg ?X # ?Y.neg ?X.[rdfs:subClassOf ->> ?Y] :- neg ?X ## ?Y.
% Compatibility with RDF?Z.[rdf:type->>rdf:Property] :- neg ?_.[?Z->>?_].
% Downard propation of negative information in RDFFneg ?Z.[rdf:type ->> ?X] :-
?X.[rdfs:subClassOf->>?Y], neg ?Z.[rdf:type->>?Y].
neg ?Z1.[?X ->> ?Z2] :- ?X.[rdfs:subPropertyOf->>?Y], neg ?Z1.[?Y->>?Z2].
ERDF embedding( logical part)
Total classes
neg ?Z.[rdf:type->>?X] :- ?X.[rdf:type ->> erdf:TotalClass],?Z #mw:Vocabulary, naf ?Z.[rdf:type->>?X].
?Z.[rdf:type->>?X] :- ?X.[rdf:type ->> erdf:TotalClass],?Z #mw:Vocabulary, naf neg ?Z.[rdf:type->>?X].
Closed classes
neg ?Z.[rdf:type->>?X] :- ?X.[rdf:type->>erdf:PositivelyClosedClass],
?Z #mw:Vocabulary, naf ?Z.[rdf:type->>?X].?Z.[rdf:type->>?X] :- ?X.[rdf:type->>erdf:NegativelyClosedClass],
?Z #mw:Vocabulary, naf neg ?Z.[rdf:type->>?X].
Translations into ELPTwo translations into extended logic
programming have been devised.
The first uses MWeb's transformation into extended logic programming and comes for free.
The current prototype implements this translation but introduces some overhead in the execution. Even so it is quite efficient when compared to existing alternative systems (see below)
A different alternative pursued in the paper is the definition of a direct translation into ELP (see ECAI 2010) of simple modular ERDF ontologies.
Direct Translation (1)Quad '->'('m',p,s,o) predicate to state that triple s p o is true at MWeb rulebase
m.
Interface (just use directives are translated)% Class use
'->'('anne','rdf:type',?S,'EUCountry') :- '->'('geo','rdf:type',?S, 'EUCountry').
% Property use'->'('anne','travel',?S,?O) :- '->'('pyr','travel', ?S, ?O).'->'('anne','travel',?S,?O) :- '->'('agcy','travel', ?S, ?O).
'->'('anne','visit',?S,?O) :- '->'('pyr','visit', ?S, ?O).'->'('anne','visit',?S,?O) :- '->'('agcy','visit', ?S, ?O).
% Vocabulary use'->'('anne', 'rdf:type',?S, 'mw:Vocabulary') :- '->'('pyr', 'rdf:type', ?S, 'mw:Vocabulary').'->'('anne', 'rdf:type',?S, 'mw:Vocabulary') :- '->'('agcy', 'rdf:type', ?S, 'mw:Vocabulary').'->'('anne', 'rdf:type',?S, 'mw:Vocabulary') :- '->'('geo', 'rdf:type', ?S, 'mw:Vocabulary').
Direct translation (2)Rules are simpler to translate and basically set the first argument of quads appropriately:
'->'('anne', 'choose', ?Package, ?Ctry) :-neg '#'('anne',?Ctry ,'EUCountry'),'->'('pyr', 'travel', ?Package, ?Ctry ),'->'('pyr', 'visit', ?Package, ?City),naf neg '->'('anne','visit', ?Package, ?City ).
Preliminary testing
cputime (ms)
* Mac OS X 10.5.8. 2.93 GHz Intel Core 2 Duo 4Gb 1067 MHz DDR3
Fig. 1 – cputime* for extracting all the triples by several rule engines
Conclusions MWeb can capture all the constructs of simple
modular ERDF ontologies
Semantics of ERDF can be declaratively specified in MWeb
The subset of MWeb necessary to capture simple modular ERDF ontologies can be immediately translated into extended logic programming
Preliminary benchmarking shows promising results when compared to existing memory-based Semantic Web rule engines.
Subsumptive tabling is preferable (10~100 times faster) and equality reasoning introduces substantial overhead.
DownloadThe MWeb system implementation can be
downloaded at
http://centria.di.fct.unl.pt/~cd/mweb/
OWL2 RL support is underway