BioInterchange / Ontologies

Home of the Genomic Feature and Variation Ontology (GFVO)
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4435477/
16 stars 4 forks source link

ontology_term ObjectProperty range #1

Closed cmungall closed 11 years ago

cmungall commented 11 years ago

The range of this property is a giant UnionOf class expression, none of the elements of which are ontology terms.

For example:

Is not an ontology term. It's the prefix for a URL that when appendex with a GO number will resolve to a page about the ontology term.

KimJBaran commented 11 years ago

Yes. :)

Is that not the right way to express that individuals that are referenced by the "range" property have to come from any of these URI prefixes? I vaguely remember having tested that in HermiT and I think that worked.

Or, to put it otherwise, how would you say that the range property can only refer to certain individuals that have the listed URI prefixes?

cmungall commented 11 years ago

"Is that not the right way to express that individuals that are referenced by the "range" property have to come from any of these URI prefixes" Short answer: no, not even close. Which part of the OWL specs lead you to this conclusion?

"I vaguely remember having tested that in HermiT and I think that worked." To test this in HermiT you would need to have an ontology that deliberately produces an inconsistency or unsatisfiable class.

If you ran HermiT and it didn't complain then you haven't really achieved anything.

"Or, to put it otherwise, how would you say that the range property can only refer to certain individuals that have the listed URI prefixes?"

I'm afraid this is a bit misguided on a few levels. You can't really do this in OWL, at least not without introducing an explicit model of a URI structure which is kind of an odd thing to do and probably wouldn't give you the desired results anyway.

Even if it did, listing every possible URL via which a database can be queried using an ontology term isn't really a good strategy. I think you're confusing the URI of the ontology class vs a URL for a particular database to be able to query an ontology term.

cmungall commented 11 years ago

Alarm bells should ring when you open Protege and see all of those elements of the union appear as owl classes under "Thing"

KimJBaran commented 11 years ago

I am sorry if the representation seems strange. I can go back and revalidate that the chosen union of URIs does indeed what it is intended to do: ensure that only URI prefixes from said union are valid choices for the "range" property. I am quite certain it worked, because I had to remove a similar restriction from other properties to ensure that arbitrary URIs can be picked too.

It is indeed weird that Protege lists all those URIs as classes under "Thing", but then, it also shows them non-bold, which indicates that I did not define those classes explicitly in the ontologies. In fact, every time I save the ontologies with Protege, I have to run a "clean up" script to remove the classes that Protege creates for them.

How would you express that the "range" property can only represent certain URIs as specified in the GFF3/GVF specs?

Thanks.

cmungall commented 11 years ago

I am sorry if the representation seems strange

No need to apologize!

I can go back and revalidate that the chosen union of URIs does indeed what it is intended to do: ensure that only URI prefixes from said union are valid choices for the "range" property. I am quite certain it worked, because I had to remove a similar restriction from other properties to ensure that arbitrary URIs can be picked too.

I recommend treating ontology engineering like software engineering. Create unit tests.

It is indeed weird that Protege lists all those URIs as classes under "Thing",

It isn't weird at all - arguments in a UnionOf expression must be owl classes according to the owl spec. Even if you don't declare them as classes, the RDF/XML parser kindly repairs this omission for you

In fact, every time I save the ontologies with Protege, I have to run a "clean up" script to remove the classes that Protege creates for them.

Protege has a number of bugs, but I think in this case it's doing the right thing and you're doing something wrong

How would you express that the "range" property can only represent certain URIs as specified in the GFF3/GVF specs?

See my comments above. I think OWL is not the right choice for what you want to do.

Let's be clear though. If what you want to say is that the filler for property P must be one of I_1, ..., I_n then say

range OneOf(I_1, ..., I_n)

That is valid. It's not strong enough in itself for effective error checking, there is no Unique Name Assumption in OWL. You have to state this separately.

But in any case, I don't think this helps you, as it sounds like you're trying to express something like "the URI of the individual that is the filler of P must have prefix P_1, P_2, ...." which you can't do in OWL without explicitly modeling the syntactic structure of a URI, which would be an odd thing to do.

What you're trying to do seems like syntactic validation, not logical validation. You'd be better doing this in a scripting language.

KimJBaran commented 11 years ago

Update: the discussion continued per email. The aforementioned object property is going to be changed now.

KimJBaran commented 11 years ago

The property has been changed to an "anyURI" with regular expression matching valid URIs.