S M Shamimul Hasan
S M Shamimul Hasan

Reputation: 6694

How to define multiple domain and range connection in Protégé?

I am new with Protégé. I am developing an ontology. A part of my ontology classes are connected with other classes by "has" relationship. For example:

Activity has Location
Household has Location
Intervention has CloseWork

I declared Activity, Household, Location, Intervention, and CloseWork as classes in Protege. I declared "has" as an ObjectProperty. To show the relationships between classes I set domain and range of the "has" ObjectProperty. For example: to show "Activity has Location" I set Activity as a domain and Location as a range. I saved my Ontology as RDF/XML Syntax. File is showing my "has" object property like following:

<owl:ObjectProperty rdf:about="www.ndssl.vbi.vt.edu/epidl#has">
    <rdfs:domain rdf:resource="www.ndssl.vbi.vt.edu/epidl#Activity"/>
    <rdfs:domain rdf:resource="www.ndssl.vbi.vt.edu/epidl#Household"/>
    <rdfs:range rdf:resource="www.ndssl.vbi.vt.edu/epidl#Location"/>
    <rdfs:domain rdf:resource="www.ndssl.vbi.vt.edu/epidl#Intervention"/>
    <rdfs:range rdf:resource="www.ndssl.vbi.vt.edu/epidl#CloseWork"/>
</owl:ObjectProperty>

From the above RDF statements, it is not possible to figure out which domain connects to which range (e.g., Activity has Location). Please let me know how to fix it.

Upvotes: 2

Views: 2152

Answers (1)

Jeen Broekstra
Jeen Broekstra

Reputation: 22053

You cannot use rdfs:domain and rdfs:range in this way. By saying that the domain of has consists of Activity, Household and Intervention you are effectively asserting that every individual that uses the has property is an instance of all three of those classes, at the same time. This is probably not what you want.

You instead need to use OWL restrictions. In this case, you want a owl:allValuesFrom restriction. You express these on the class for which they hold. So, for example, on the class Activity you would express something to the effect of (in Turtle syntax):

  :Activity rdfs:subClassOf [ a owl:Restriction ; 
                              owl:onProperty :has ; 
                              owl:allValuesFrom :Location . ]

This says that if an instance of the class Activity uses the has property, the value of that property must be a Location.

Rinse and repeat for the other class-specific restrictions.

An alternative is to use more specific properties, rather than a rather meaningless general 'has'-relation. For example:

:hasLocation a owl:ObjectProperty ;
         rdfs:range :Location .

:hasCloseWork a owl:ObjectProperty ;
         rdfs:domain :Intervention ;
         rdfs:range :CloseWork .

An added advantage of this approach is that your data becomes semantically richer, and easier to query (assuming that that is what you will want to do at some point in the future).

Upvotes: 7

Related Questions