Search code examples
owlprotege

Class query not detecting the corresponding instances in Protégé OWL


I have MultiPetsOwner class in my ontology, and with the current set up I expect 2 Instances to be detected for it (Harry and Alex).

But when I run the DL Query "hasPet min 2 Animal" for it, there are no corresponding instances.

At the same time, the DL Query "hasPet some Animal" seems to work - it gives me the PetOwner class instances I expected.

What am I doing wrong? If the "hasPet min 2 Animal" query is incorrect, what should I use instead to get all the MultiPetsOwners?

The contents of my .owl file can be found here: http://pastebin.com/5xcriLRE


Solution

  • OWL is working in Open World Assumption. In your case, that means than it is not assumed the individuals are different. You have to assert it explicitly. In Protégé, this is done when all individuals are selected, in your case all animals, and then Edit -> "Make all individuals different".

    If you run the hasPet min 2 Animal it will give you the expected results, but you can see them already after running the reasoner in the inferred instances of the class MultiPetsOwner.