I am trying to build a simple ontology to check how class expressions are inferred in protege, using the reasoner Hermit 1.4.3.
The ontology is as follows:
There are two classes Robot and Head, one object property hasPart and a class expression that states for something to be an instance of a Robot then it must have exactly 1 Head.
I would like to filter out cases of instantiating a Robot that has none or more than one heads. However, when I set that Alice is a Robot and has 2 heads (head1 and head2), I would expect an inconsistency error given the class expression above, instead the reasoner seems to ignore it. Any help would be deeply appreciated.
The code in OWL Functional Syntax is listed below:
Prefix(:=<http://test#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://test>
Declaration(Class(:Head))
Declaration(Class(:Robot))
Declaration(ObjectProperty(:hasPart))
Declaration(NamedIndividual(:Alice))
Declaration(NamedIndividual(:head1))
Declaration(NamedIndividual(:head2))
############################
# Object Properties
############################
# Object Property: :hasPart (:hasPart)
ObjectPropertyDomain(:hasPart :Robot)
ObjectPropertyRange(:hasPart :Head)
############################
# Classes
############################
# Class: :Robot (:Robot)
EquivalentClasses(:Robot ObjectExactCardinality(1 :hasPart :Head))
############################
# Named Individuals
############################
# Individual: :Alice (:Alice)
ClassAssertion(:Robot :Alice)
ObjectPropertyAssertion(:hasPart :Alice :head1)
ObjectPropertyAssertion(:hasPart :Alice :head2)
# Individual: :head1 (:head1)
ClassAssertion(:Head :head1)
# Individual: :head2 (:head2)
ClassAssertion(:Head :head2)
)