admin管理员组

文章数量:1320661

In an owl file w Turtle syntax I have the following classes, properties and individuals

ss:State a owl:Class ;   
        rdfs:label "State" ;
        rdfs:subClassOf <; ;
        owl:disjointWith <; ;
        skos:notation "State" . 

ss:has_State rdf:type owl:ObjectProperty ; 
        rdfs:domain  <; ;
        rdfs:range   ss:State ;
        rdfs:label "has_State" ;
        skos:notation "has_State" . 

<;
  a <; ;
ns0:P31i_was_modif1ied_by <;, <;, <;, <;, <; ;

Using protege 5.6.3 and the pre-installed pellet reasoner 2.2.0 I would like to create a SWRL rule that states 'for each modification, create a new individual of class State and connect it to an object, with the property has_State'

this is what I have so far , in the SWRLTab

ns0:P31i_was_modified_by(?o, ?m) ^ swrlx:makeOWLThing(?s, ?m) -> ss:State(?s) ^ ss:has_State(?o, ?s)

I click "OWL+SWRL->Drools" then "Run Drools" then "Drools->OWL"

Then I start the Pellet reasoner. Under State class I see 6, not 5 instances as I should. the explanation of the reasoner is not something useful. I get

Why I am getting this and how can I fix it, so I can get the right amount of instances, based on modifications, everytime the SWRL rule runs?

In an owl file w Turtle syntax I have the following classes, properties and individuals

ss:State a owl:Class ;   
        rdfs:label "State" ;
        rdfs:subClassOf <http://www.w3./2002/07/owl#Thing> ;
        owl:disjointWith <http://www.w3./2002/07/owl#Nothing> ;
        skos:notation "State" . 

ss:has_State rdf:type owl:ObjectProperty ; 
        rdfs:domain  <http://id.gnm.de/ont/foko/Object> ;
        rdfs:range   ss:State ;
        rdfs:label "has_State" ;
        skos:notation "has_State" . 

<http://foko2014.gnm.de/content/foko_Objecta8f32>
  a <http://id.gnm.de/ont/foko/Object> ;
ns0:P31i_was_modif1ied_by <http://foko2014.gnm.de/content/foko_Consecration11e26e>, <http://foko2014.gnm.de/content/foko_Restoration11e253>, <http://foko2014.gnm.de/content/foko_Restoration11e251>, <http://foko2014.gnm.de/content/foko_Restoration11e24a>, <http://foko2014.gnm.de/content/foko_Reconstruction11e255> ;

Using protege 5.6.3 and the pre-installed pellet reasoner 2.2.0 I would like to create a SWRL rule that states 'for each modification, create a new individual of class State and connect it to an object, with the property has_State'

this is what I have so far , in the SWRLTab

ns0:P31i_was_modified_by(?o, ?m) ^ swrlx:makeOWLThing(?s, ?m) -> ss:State(?s) ^ ss:has_State(?o, ?s)

I click "OWL+SWRL->Drools" then "Run Drools" then "Drools->OWL"

Then I start the Pellet reasoner. Under State class I see 6, not 5 instances as I should. the explanation of the reasoner is not something useful. I get

Why I am getting this and how can I fix it, so I can get the right amount of instances, based on modifications, everytime the SWRL rule runs?

Share Improve this question asked Jan 18 at 16:30 slevinslevin 3,89621 gold badges76 silver badges140 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The issue is likely caused by how swrlx:makeOWLThing() built-in function works since it doesn't guarantee unique instance creation for each modification. Try using a more direct approach to create new State instances by modifying the SWRL rule to tie State creation to each modification:

ns0:P31i_was_modified_by(?o, ?m) -> 
    swrl:individualVariable(?s) ^ 
    ss:State(?s) ^ 
    ss:has_State(?o, ?s)

If this doesn't fix the issue:

  • Check the namespace prefixes in Protégé

  • Verify the modification property name exactly matches ns0:P31i_was_modified_by

  • Check that the Pellet reasoner is configured correctly

  • Try clearing existing inferred axioms before running the rule

本文标签: owlusing swrlxmakeOWLThing creates wrong number of new individualsStack Overflow