Partially fix prefix injection when writing to OBO. #1270
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially resolves [#1268]
docs/have been added/updatedmvn verifysays all tests passmvn sitesays all JavaDocs correctCHANGELOG.mdhas been updatedWhen writing to OBO, prefixes added with
--add-prefixare 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-obooption 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-obois 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-obooption, but that would be a more invasive fix).