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.
Currently, the
id2url
function in the BERN2 Flask web application uses hard-coded logic for converting from entity identifiers (which I call compact URIs, or CURIEs, throughout this pull request) into URLs that can be used in the web pages of the application.BERN2/app/result_parser.py
Lines 13 to 29 in a16b9c7
Related to the discussion in #3, the
bioregistry
package has a more general version of this function already built-in that can be used likeTherefore, I updated the implementation of
id2url
to do a small amount of string preprocessing on NCBI Taxonomy identifiers (as motivated by #3 (comment)) and defer tobioregistry.get_iri
for the remainder of the implementation.More documentation on
bioregistry.get_iri
can be found here. I'm the creator of the Bioregistry and would be happy to answer any questions about it.