SWRL rules don't infer new Object and Data Property Assertions

后端 未结 2 515
-上瘾入骨i
-上瘾入骨i 2020-12-06 08:34

I have created this ontology which contains two classes: Blood-Sugar and Services. Blood-Sugar has two data properties: hasValu with rang

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 09:24

    Based on your comment, perhaps an example of SWRL rules being used to infer a new object property assertion will get you on track. Some OWL 2 reasoners support SWRL rules, so I'm using Protégé 4.x and Pellet. SWRL rules can be used to infer new object property assertions. For instance, in the following ontology, there is a class Person with individuals Alice, Bill, Carl, and Raymond, an object property likes, and a rule:

    Person(?x) → likes(?x,Raymond)

    After enabling the Pellet reasoner (Reasoner > Pellet, then Reasoner > Start Reasoner), we get the expected results. E.g., Bill likes Raymond:

    bill likes raymond

    Here's the ontology:

    @prefix :       .
    @prefix rdfs:   .
    @prefix swrl:   .
    @prefix owl:    .
    @prefix xsd:    .
    @prefix swrlb:  .
    @prefix rdf:    .
    
    
            a       owl:Ontology .
    
    :Person  a      owl:Class .
    
    :Raymond  a     owl:NamedIndividual , :Person .
    
    :Alice  a       owl:NamedIndividual , :Person .
    
    [ a          swrl:Imp ;
      swrl:body  [ a          swrl:AtomList ;
                   rdf:first  [ a                    swrl:ClassAtom ;
                                swrl:argument1        ;
                                swrl:classPredicate  :Person
                              ] ;
                   rdf:rest   ()
    
                 ] ;
      swrl:head  [ a          swrl:AtomList ;
                   rdf:first  [ a                       swrl:IndividualPropertyAtom ;
                                swrl:argument1           ;
                                swrl:argument2          :Raymond ;
                                swrl:propertyPredicate  :likes
                              ] ;
                   rdf:rest   ()
    
                 ]
    ] .
    
    :Bill   a       owl:NamedIndividual , :Person .
    
    :likes  a       owl:ObjectProperty .
    
    :Carl   a       owl:NamedIndividual , :Person .
    
      a  swrl:Variable .
    

提交回复
热议问题