Fixing an OOPS! Error - Defining multiple domains in properties

Published: 24-Jul-2020

This article is focussed at solving the common OOPS! Error - “Results for P19: Defining multiple domains or ranges in properties.”

TL;DR Do not add domains or ranges separately. Instead, make one entry with the “or” condition thereby making sure that only one domain or range can exist!

Problem

So I made an ontology and when I was testing it for common pitfalls using OOPS! (OntOlogy Pitfall Scanner!), it detected the following critical pitfall:

The problem

Initially, I did not understand the issue and didn’t know how to fix it. As far as I looked, I could not find a straightforward fix for this issue. So after I found a solution, I decided to write this small article about it.

When two separate domains (that are disjoint) are mentioned for a specific property, it causes an issue because the individual that is instantiated now belongs to both the (disjoint) domains, essentially an intersection of the disjoint domains! This is not possible and that is what throws the scanner off. Section 4.2 of this paper explains the issue better than I did.

Next, I needed to know how to fix it using Protégé, as that was my primary tool for creating the ontology. That’s when this Stack Overflow post helped me out.

Solution

Step 1: Head over to the “Description” tab of the specific property you’re having issues with (in my case, it is the “hasLoanRecords” property).

Step 1

Step 2: Click on one of the domains you’ve added to open up a window that contains this tab called “Class expression editor”.

Step 2

Step 3: Add an “or” and type in the name of the other domain(s) you wish to add. Then click on the “OK” button.

Step 3

Step 4: Now delete the other domain(s) you originally added by clicking on the “X” button, and you’re done!

Step 4