-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Description
generateSKOSInOwl in OntologyParser.java (line 379) attempts to add identifier metadata for classes in prefix-aware OWL ontologies.
The method uses this fallback path:
- If the class already has
skos:notation, do nothing - Else if the class has
oboInOwl:id, copy that value intoskos:notation - Else call
prefixFormat.getPrefixIRI(cls.getIRI())and store the result as BioPortalprefixIRI
This fails for some valid OWL class IRIs whose local part is not a valid XML QName local name.
Example from the Emotion Response Ontology (EMRO):
- Class IRI:
http://purl.bioontology.org/ontology/EMRO/0000000 - Registered namespace prefix exists:
EMRO -> http://purl.bioontology.org/ontology/EMRO/ skos:notationandoboInOwl:idare absent on that classprefixFormat.getPrefixIRI(cls.getIRI())returnsnull
As a result, the loop continues without adding either skos:notation or prefixIRI metadata for that class.
Why this happens
OWL API getPrefixIRI() is trying to generate a compact prefixed form such as EMRO:0000000.
That compacted value must be QName-safe. In this case the local part is 0000000, which starts with a digit, so it isn't a valid QName local name. OWLAPI therefore returns null.
Impact
Some classes in valid source ontologies do not receive BioPortal identifier metadata during parsing, even when their namespace prefix is known. This makes identifier normalization inconsistent across ontologies and across classes within the same ontology.
Expected behavior
If a class doesn't already have skos:notation and doesn't have oboInOwl:id, the parser should still derive a usable prefixIRI when the namespace prefix is known, even if the local part isn't QName-safe.
For the EMRO example, a reasonable derived value would be:
EMRO:0000000
... stored as BioPortal metadata prefixIRI.
Notes
The issue is specific to the prefixIRI fallback path in generateSKOSInOwl. It doesn't affect the OBO-specific path in generateSKOSInObo.