[Pellet-users] Unexpected result and long processing time for a SRWL rule
Role Francois
francois.role at univ-paris5.fr
Sat May 3 13:58:57 UTC 2008
Dear Peller users,
Suppose we have three "groups" and each group consists of the following
elements
A = {e1,e2} B = {e3,e4} C = {e5,e6}, which is expressed as :A
:hasElement :e1, :A :hasElement :e2 and so on.
Also suppose we have the following (I agree, a bit strange...) rule:
"if a group :G is related by the :mod relation to an :e element (normally
in another group) and, on the other hand, :G has an element :f
which is itself related by :mod to a group :H then if there is a
superGroup :R we would like to infer the following relation : R :hasGroup
:G" (the SRWL text is enclosed below)
Now suppose we assert that :
- there is a :mod relation between group B and the e2 element in group A
(:B :mod :e2.)
- there is a :mod relation between group C and the e4 element in group B
(:C :mod :e4.)
- there is an instance res which is a supergroup expressed as :res a
:SuperGroup.
Issuing the query:
select * where {?s <http://www.easy.org/ontology#hasGroup> ?g}
we expect to get only one result, namely:
ontology:res hasGroup ontology:B
But we get three results:
------------------------------
Query Results (3 answers):
s | g
==========================
ontology:res | ontology:e2
ontology:res | ontology:e4
ontology:res | ontology:B
and this after a very long processing time (about 20 seconds) which makes
it not effective for pratical purposes.
Could you give me a clue as to what is going on with this rule ?
I added the following assertions but it did not solve the problem:
:e2 owl:differentFrom :B.
:e4 owl:differentFrom :B.
:e4 owl:differentFrom :e2.
I could also try to add constraints to the properties but I would like to
get to the bottom of it and also understand why the processing time is so
long.
Thanks in advance
François
The OWL text is as follows (N3 notation):
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix swrl: <http://www.w3.org/2003/11/swrl#> .
@prefix : <http://www.easy.org/ontology#> .
<http://www.easy.org/ontology.owl> a owl:Ontology .
:Element a owl:Class.
:Group a owl:Class.
:SuperGroup a owl:Class.
:res a :SuperGroup.
:A a :Group.
:B a :Group.
:C a :Group.
:e1 a :Element.
:e2 a :Element.
:e3 a :Element.
:e4 :Element.
:e5 a :Element.
:e6 a :Element.
:hasElement a owl:ObjectProperty .
:mod a owl:ObjectProperty .
:hasGroup a owl:ObjectProperty .
:A :hasElement :e1.
:A :hasElement :e2.
:B :hasElement :e3.
:B :hasElement :e4.
:C :hasElement :e5.
:C :hasElement :e6.
:B :mod :e2.
:C :mod :e4.
:e2 owl:disjointWith :B.
:e4 owl:disjointWith :B.
:e4 owl:disjointWith :e2.
:G a swrl:Variable .
:H a swrl:Variable .
:e a swrl:Variable .
:f a swrl:Variable .
:R a swrl:Variable .
:theGroupRule a swrl:Imp;
swrl:body (
[ a swrl:IndividualPropertyAtom;
swrl:propertyPredicate :mod;
swrl:argument1 :G;
swrl:argument2 :e;
]
[ a swrl:IndividualPropertyAtom;
swrl:propertyPredicate :hasElement;
swrl:argument1 :G;
swrl:argument2 :f;
]
[ a swrl:IndividualPropertyAtom;
swrl:propertyPredicate :mod;
swrl:argument1 :H;
swrl:argument2 :f;
]
[ a swrl:ClassAtom;
swrl:classPredicate :SuperGroup;
swrl:argument1 :R;
]
);
swrl:head (
[ a swrl:IndividualPropertyAtom;
swrl:propertyPredicate :hasGroup;
swrl:argument1 :R;
swrl:argument2 :G;
] ).
More information about the Pellet-users
mailing list