简体   繁体   中英

Protege/Turtle/OWL difficulties making object properties for reified statements work

Suppose I want to represent that Bill exercises once a week. I want to explore various ways of representing this in owl as I'm getting more familiar with building ontologies in owl and formulating them in turtle. I'm open to hear alternative representations, but here's the one I'm trying for:

  1. ActivityType is a class.
  2. Exercise is an instance of that class.
  3. Bill is an instance of Human (a class), and he performs the activity of exercise.
  4. Then, I want to qualify Bill's performance as something that happens once a week.
  5. To do that, I make a class of Frequencies, and an instance called OnceAWeek.
  6. Then I want to reify Bill's performing of excercise and relate that reified owl sentence to the OnceAWeek Frequency.

Here's how I tried it (I'll omit some upper ontology stuff, but that shouldn't be where any problems lie):

:performsActivityType rdf:type owl:ObjectProperty;
    rdfs:Domain :Animal;
    rdfs:Range :ActivityType.

:performsWithFrequency rdf:type owl:ObjectProperty;
    rdfs:Domain owl:Axiom;
    rdfs:Range :Frequency.

:Human rdf:type owl:Class ;
       rdfs:subClassOf :Animal.


:ActivityType rdf:type owl:Class .

:Frequency rdf:type owl:Class .

:Exercise rdf:type owl:NamedIndividual, :ActivityType.

:OnceAWeek rdf:type owl:NamedIndividual, :Frequency.

:Bill rdf:type :Human;
      :performsActivityType :Exercise.

[rdf:type owl:NamedIndividual, owl:Axiom ;
    owl:annotatedSource :Bill;
    owl:annotatedProperty :performsActivityType;
    owl:annotatedTarget :Exercise;
    :performsWithFrequency :OnceAWeek].

The problem: when I do this, I can't verify that I've added the intended knowledge by looking at this in Protege. I can verify that I am creating/reifying the right Axiom, as I can sneak in something like "rdfs:label "he does it once a week"" and that annotates the assertion and is visible when I open the.owl file in Protege. But I can't find a way to verify that I'm making the:performsWithFrequency claim about the (Bill performsActivityType Exercise) sentence.

Help?

(Again, thoughts on better ways to pursue this representation are also welcome, though I still want to learn how to handle this one if possible).

When you design an ontology it is often helpful to think in terms of the inferences you want to make. In your case, assume we want be able to classify people according to their activity levels. We can do the following:

:hasExerciseFrequency rdf:type owl:DatatypeProperty ;
                      rdfs:range xsd:integer .

:HighlyActivePerson rdf:type owl:Class ;
                    owl:equivalentClass [ rdf:type owl:Restriction ;
                                          owl:onProperty :hasExerciseFrequency ;
                                          owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                               owl:onDatatype xsd:integer ;
                                                               owl:withRestrictions ( [ xsd:minInclusive 7
                                                                                      ]
                                                                                    )
                                                             ]
                                        ] ;
                    rdfs:subClassOf :Person .


:ModeratelyActivePerson rdf:type owl:Class ;
                        owl:equivalentClass [ rdf:type owl:Restriction ;
                                              owl:onProperty :hasExerciseFrequency ;
                                              owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                   owl:onDatatype xsd:integer ;
                                                                   owl:withRestrictions ( [ xsd:minInclusive 3
                                                                                          ]
                                                                                          [ xsd:maxInclusive 6
                                                                                          ]
                                                                                        )
                                                                 ]
                                            ] ;
                        rdfs:subClassOf :Person .

:Person rdf:type owl:Class ;
        owl:equivalentClass [ rdf:type owl:Restriction ;
                              owl:onProperty :hasExerciseFrequency ;
                              owl:someValuesFrom xsd:integer
                            ] .

:SedentaryPerson rdf:type owl:Class ;
                 owl:equivalentClass [ rdf:type owl:Restriction ;
                                       owl:onProperty :hasExerciseFrequency ;
                                       owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                            owl:onDatatype xsd:integer ;
                                                            owl:withRestrictions ( [ xsd:maxInclusive 0
                                                                                   ]
                                                                                 )
                                                          ]
                                     ] ;
                 rdfs:subClassOf :Person .

:SlightlyActivePerson rdf:type owl:Class ;
                      owl:equivalentClass [ rdf:type owl:Restriction ;
                                            owl:onProperty :hasExerciseFrequency ;
                                            owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                 owl:onDatatype xsd:integer ;
                                                                 owl:withRestrictions ( [ xsd:minInclusive 1
                                                                                        ]
                                                                                        [ xsd:maxInclusive 2
                                                                                        ]
                                                                                      )
                                                               ]
                                          ] ;
                      rdfs:subClassOf :Person .

:ann rdf:type owl:NamedIndividual ;
     :hasExerciseFrequency 10 .

:dave rdf:type owl:NamedIndividual ;
      :hasExerciseFrequency 0 .

:pete rdf:type owl:NamedIndividual ;
      :hasExerciseFrequency 3 .

[ rdf:type owl:AllDisjointClasses ;
  owl:members ( :HighlyActivePerson
                :ModeratelyActivePerson
                :SedentaryPerson
              )
] .

If you load this in Protege and run a reasoner, it will classify ann as being highly active, pete as moderately active, and dave as sedentary.

I talk about ways you can do this in my dissertation, which you can download from here .

Ah. I think I see the problem. I needed to make:performsWithFrequency a owl:AnnotationProperty instead of an owl:ObjectProperty. Once I make that change, things work as expected.

I appreciate any further thoughts folks might have on this approach, though. Or if I'm misunderstanding how object properties and annotation properties work here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM