I have a class hierarchy like this:
Thing
- ClassA
-ClassC
-ClassD
- ClassB
-ClassC
-ClassE
Class C is a subclass of both, ClassA and ClassB while ClassD and ClassE are only subclasses of either ClassA or ClassB
Now I would like to specify a class which is equivalent to the Intersection of subclasses of ClassA and ClassB. The following doesn't work:
NamedClass a owl:Class
NamedClass owl:equivalentClass (ClassA and ClassB)
The reason is that this sort of rule would be used by the reasoner to classify individuals, i.e. is I had an individual Ind1 which is of type ClassA and ClassB, it would be classified to be also of type NamedClass. This is not (only) what I want. I want ClassC itself to be a subclass of NamedClass.
I know this is achievable using rules (e.g. SPIN) but can it be done without rules?
Let's start with the initial hierarchy, including F, but before we've declared that F is equivalent to the intersection of A and B:
Then we add (A and B) as a class equivalent to F. Protégé is smart enough to render things that are equivalent or subclasses of intersections under each of the intersected classes, so we see F appear in two places here.
A reasoner can confirm the relation, too. Here I've turned on Pellet, entered F into the DL query, and asked for subclasses. Sure enough, C is a subclass of F:
Here's the ontology that you can copy and paste:
@prefix : <http://stackoverflow.com/q/22221549/1281433/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:ontology a owl:Ontology .
:A a owl:Class .
:B a owl:Class .
:C a owl:Class ; rdfs:subClassOf :A , :B .
:D a owl:Class ; rdfs:subClassOf :A .
:E a owl:Class ; rdfs:subClassOf :B .
:F a owl:Class ;
owl:equivalentClass [ a owl:Class ;
owl:intersectionOf ( :A :B ) ] .