I've been searching around but couldn't find a good way to model the following, I have two classes in owl and one is the base class of the other:
:Base rdf:type owl:Class .
:Sub rdf:type owl:Class;
rdfs:subClassOf :Base .
:hasDescription rdf:type owl:DatatypeProperty .
I want all instances of :Base to have a fixed description (:hasDescription "BASE"), and all instances of :Sub to have a different fixed description (:hasDescription "SUB"). But I want to avoid creating a triple for every instances such as
:Base1 rdf:type :Base;
:hasDescription "BASE" .
I tried using owl:Restriction :
:Base rdf:type owl:Class .
rdf:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty :hasDescription ;
owl:hasValue "BASE"
] .
:Sub rdf:type owl:Class;
rdfs:subClassOf :Base ,
[ rdf:type owl:Restriction ;
owl:onProperty :hasDescription ;
owl:hasValue "SUB"
] .
but this wouldn't work because then :Sub would have both "BASE" and "SUB" as description since it's a subclass of :Base, which in turn is a subclass of the restriction with value "BASE". Anyone has any suggestion on how this can be done in owl? Thanks.