Skip to content
Advertisement

How to get in Jena the exact range of an ObjectProperty with restrictions?

I have an owl/rdf schema with object properties with range restrictions, and I’m unable to get with the Jena API the effective range class.

I would like to get the classes which are defined in the ontology as the range of a property. For example, with the following schema:

JavaScript

And I’m doing:

JavaScript

I expected to get this result:

JavaScript

But I get:

JavaScript

This same code works without any problem if I don’t use restrictions, for example, with the following schema:

JavaScript

I get the expected result:

JavaScript

It looks that I am not handling correctly cases where a property use a restriction. What Am I doing wrong?

Advertisement

Answer

To complete the previous answer, if the restriction is qualified, Jena does not have a direct way to get the range. But you can do:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement