EBISPOT / ols4

Version 4 of the EMBL-EBI Ontology Lookup Service (OLS)
http://www.ebi.ac.uk/ols4/
Apache License 2.0
47 stars 22 forks source link

Better support for punning #7

Open jamesamcl opened 2 years ago

jamesamcl commented 2 years ago

Punning is where the same URI is used for, say, both a Class and an Individual.

Currently, this is handled in owl2json by creating both an entry in "classes" and an entry in "individuals", with the same properties. However, some of these properties only apply to the Class, and some only apply to the Individual, so the current behaviour is wrong; it doesn't lose anything, but it adds properties where they should not be.

We can identify to which types the property applies by looking at the semantics of the property. For example, if the rdfs:domain of the property refers to a Class, the property should not be added to Individuals in the owl2json output.

The other side of this issue is that property might point to something that is punned. Does it refer to the Class or the Individual? Presumably we can look at the range of the property in a similar manner to above, but this would need to be done in json2neo because in the output of owl2json there is no unique identifier for each type of a punned entity (only the URI).

jamesamcl commented 2 years ago

The other side of this issue is that property might point to something that is punned. Does it refer to the Class or the Individual? Presumably we can look at the range of the property in a similar manner to above, but this would need to be done in json2neo because in the output of owl2json there is no unique identifier for each type of a punned entity (only the URI).

This should really be done in owl2json. So we need to add unique IDs to entities in the owl2json output.

jamesamcl commented 2 years ago

From discussion with @dosumis :

If you have a punned Class/Individual and there is a triple using an object property/data property (rather than an annotation), this would be legal on the Individual but not on the Class, so it should be only be rendered for the Individual (and vice versa). Simple triples using an object property/data property only belong on the individual. Otherwise they would need to be annotation properties.

rdf:type only belongs on the Individual.

jamesamcl commented 2 years ago

We can't rely on the domain for this because the type of the object can actually be inferred by the domain (as it is in some of the owl2 primer examples). We can't have both the type of the object determine which properties to include by their domain AND the domain of the properties determining the type of the object as these are contradictory.

Rather need to look at simply whether they are ObjectProperties (i.e. relationships between individuals), DataProperties (values on individuals) or AnnotationProperties (annotations on anything).