1

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)


)
logi-kal
  • 7,107
  • 6
  • 31
  • 43
epd
  • 11
  • 4
  • Declare :head1 and :head2 to be different individuals. Otherwise, Hermit will infer that :head1 and :head2 are the same individual. OWL rejects UNA (Unique Name Assumption). – Stanislav Kralin Mar 16 '21 at 21:43
  • 1
    Thank you so much for this detail. I have two follow up questions: A) is there a way to force protege to consider every instance unique? B) Since the class expression states exactly 1 head, why does a robot instance without a head is accepted by the reasoner? – epd Mar 17 '21 at 10:55
  • A) Well, modern versions of Pellet can ignore UNA, but it's hard to use them in Protege; B) There is also OWA — Open World Assumption :). – Stanislav Kralin Mar 17 '21 at 11:28
  • To get an inconsistency for a robot for which you did not state it has a head, you have to make an explicit statement saying that the robot does not have a head rather than omitting adding a head. I explain this [here](https://henrietteharmse.com/2019/02/23/understanding-owl-min-vs-max-vs-exactly-property-restrictions/) and [here](https://henrietteharmse.com/2018/03/09/why-does-the-reasoner-ignore-my-constraint/) in detail. – Henriette Harmse Mar 17 '21 at 12:31
  • 1
    @HenrietteHarmse Thank you for this great material. Your suggestions were quite valuable. – epd Mar 22 '21 at 11:00

0 Answers0