In the contrived example below, I have a class :Car and an object property :hasCarType. In the definition of :Car, I want to specify a universal property restriction on :hasCarType using the class :CarType.
Intuitively, I also thought it made sense to say that :hasCarType had a domain of :Car and a range of :CarType.
However, if I say either :hasCarType rdfs:domain :Car or :hasCarType rdfs:range :CarType, I get unwanted inferences. Namely, every class in the ontology is inferred to be a subclass of the class expression 'has car type' only CarType. If I remove the domain/range (or, say, remove the domain and change the range to something else, e.g., :hasCarType rdfs:range skos:Concept), then the unwanted inferences disappear (i.e., the only subclass of the class expression is :Car).
What explains this interaction between domain/range and universal property restriction? The default explanations in Protégé aren't particularly illuminating. Example:
Explanation for: Appellation SubClassOf 'has car type' only CarType
1) 'has car type' Range CarType
Here are the results in Protégé using the HermiT reasoner:
@prefix : <urn:example/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
:hasCarType rdf:type owl:ObjectProperty ;
rdfs:domain :Car ;
rdfs:range :CarType ;
rdfs:label "has car type" .
:CarType rdf:type owl:Class ; rdfs:subClassOf skos:Concept .
:Car rdf:type owl:Class ;
owl:equivalentClass [ owl:intersectionOf ( :FourWheeledVehicle
:MotorVehicle
[ rdf:type owl:Restriction ;
owl:onProperty :hasCarType ;
owl:allValuesFrom :CarType
]
) ;
rdf:type owl:Class
] ;
rdfs:label "Car" .
:car1 rdf:type owl:NamedIndividual ,
:Car ;
:name [ rdf:type :Appellation ;
:content "My car"
] .
