Skip to content

Conversation

@gouttegd
Copy link
Contributor

Partially resolves [#1268]

  • docs/ have been added/updated
  • tests have been added/updated
  • mvn verify says all tests pass
  • mvn site says all JavaDocs correct
  • CHANGELOG.md has been updated

When writing to OBO, prefixes added with --add-prefix are ignored. This is because until recently, the OBODocumentFormat was not a prefix-supporting format, and so there is nothing in the OWLAPI to automatically take care of providing the prefixes the document may contain into the OWL2OBO translator.

This PR fixes the issue at least for the case where the --clean-obo option is used. In that case, we are instantiating the OWL2OBO translator ourselves, so we can give it access to the prefixes from the document.

For the case where --clean-obo is not used, the fix needs to happen in the OWLAPI. In that case, we are relying on the ontology manager's save methods, and we have no way to reach the OWL2OBO translator that is, in fine, used by those methods when writing to OBO. (It would be possible to always bypass the manager when writing to OBO, regardless of the --clean-obo option, but that would be a more invasive fix).

When writing to OBO, prefixes added with `--add-prefix` are ignored.
This is because until recently, the OBODocumentFormat was not a
prefix-supporting format, and so there is nothing in the OWLAPI to
automatically take care of providing the prefixes the document may
contain into the OWL2OBO translator.

This commit fixes the issue at least for the case where the
`--clean-obo` option is used. In that case, we are instantiating the
OWL2OBO translator ourselves, so we can give it access to the prefixes
from the document.

For the case where `--clean-obo` is not used, the fix needs to happen in
the OWLAPI. In that case, we are relying on the ontology manager's save
methods, and we have no way to reach the OWL2OBO translator that is, in
fine, used by those methods when writing to OBO. (It would be possible
to always bypass the manager when writing to OBO, regardless of the
`--clean-obo` option, but that would be a more invasive fix).
@gouttegd gouttegd self-assigned this Oct 27, 2025
@gouttegd gouttegd requested a review from matentzn October 27, 2025 11:58
Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the great explanation in particular why the fix must be partial. Even if a full solution would be attempted in the future, this change here seems good. Thank you!

@gouttegd
Copy link
Contributor Author

Even if a full solution would be attempted in the future, this change here seems good.

Just in case it is not completely clear: the “partial fix” here will still be needed anyway even after the issue will have been fixed in the OWLAPI.

We have two paths to export ontologies to OBO: one that is fully managed by the OWLAPI, and one that is mostly managed by ROBOT (when --clean-obo is used). The fix needs to happen in the two paths independently.

What I am trying to say here is that this PR is not a “temporary fix” or a workaround until a better solution is implemented in the OWLAPI. It is a part of the definitive solution (the part that is within ROBOT’s hands).

@jamesaoverton
Copy link
Member

Thanks!

@jamesaoverton jamesaoverton merged commit efcdf7c into ontodev:master Oct 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants