Search code examples
rdfontologyowlrdfs

How to define the domain of a property in OWL?


I want to build an ontology to deal with persons infected or not infected by diseases:

<?xml version="1.0"?>
</rdf:RDF>
    <owl:Class rdf:about="&person;Disease"/>

    <owl:Class rdf:about="&person;HealthyPerson">
        <rdfs:subClassOf rdf:resource="&person;Person"/>
        <owl:disjointWith rdf:resource="&person;SickPerson"/>
    </owl:Class>

    <owl:Class rdf:about="&person;Person"/>

    <owl:Class rdf:about="&person;SickPerson">
        <rdfs:subClassOf rdf:resource="&person;Person"/>
    </owl:Class>
</rdf:RDF>

Graphically:

class hierarchy as tree

How can I define the property has_disease(Person, Disease) in such a way that an individual of type Person related to some Disease by has_disease will be inferred have type SickPerson, too?


Solution

  • How about this?

    <owl:ObjectProperty rdf:ID="hasDisease">
      <rdfs:domain rdf:resource="#SickPerson"/>
      <rdfs:range rdf:resource="#Disease"/>
    </owl:ObjectProperty>