Adding multiple domains to objectProperty in Protege 5
Asked Answered
C

1

8

I have created an ontology using Protege 5-beta-17. In my ontology I have some classes:

Mountain, Lake, Location etc...

I also have an object property:

hasLocation.

For this object property I have set the range the "Location" class, and the domain the "Mountain" and "Lake" classes.

When I try to view the ontology using the CMap tool it shows that only the

"Mountain" "hasLocation" "Location".

The "Lake" class is presented without the "hasLocation" object property.

Did I do something wrong? Ore do I have do something else in Protege?

Compagnie answered 17/8, 2015 at 13:38 Comment(3)
Did you have a look at the OWL/XML (or whatever you save it as) and checked if the two domains are there?Marathon
Yes I have seen the file. The domains where there.Compagnie
But in Cmap just one of them appears.Compagnie
C
11

I found out what the problem was.

When adding a domain/range to object property in protege you have to click the following buttons and select one of your classes:

enter image description here

If you want to add another domain/range you simply click one of the buttons again and add another class. If you are doing it like this your telling Protege that the domain/range of your object property is an INTERSECTION of two classes. This means that the individual that will take the domains/ranges place is an INSTANCE OF BOTH CLASSES and NOT EXCLUSIVELY OF ONE OF THEM. This was my mistake. I was adding the classes to the domain in the wrong way.

So... The correct way for adding multiple distinct domains for an object property is the following:

Simply click the domain/range button again and select the "Class expression editor" tab: enter image description here

And in the "Class expression editor" type in your classes like this: "ClassA or ClassB or ClassC or ...".

In my case it was "Mountain or Lake".

After that click "ok" and thats it.

Compagnie answered 18/8, 2015 at 8:25 Comment(1)
This is the right way to accomplish what you're trying to do, but I'd quibble with the description. If a property P has a a class D as a domain, then whenever we have an assertion P(x,y), we can infer that x is an instance of D. If P has multiple domains, say D1 and D2, then from P(x,y) we can infer that x is both a D1 and is a D2. That's what happens if P has multiple domains. What you're actually trying to do is add a single domain that is a union class. If P has the union class "(D1 or D2)" as a domain, then from P(x,y) we can infer that x is a "(D1 or D2)". That's a single domain.Livy

© 2022 - 2024 — McMap. All rights reserved.