Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable overriding auto-generated URLs from registries #641

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/bioregistry/data/bioregistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -6360,6 +6360,20 @@
"homepage": "https://www.biomodels.net",
"name": "Legacy Biomodels URL",
"uri_format": "https://www.biomodels.net/kisao/KISAO#KISAO_$1"
},
{
"code": "ols",
"description": "An override for the default construction of OLS URI patterns, since this ontology does not use OBO PURLs",
"homepage": "https://www.ebi.ac.uk/ols",
"name": "OLS",
"uri_format": "https://www.ebi.ac.uk/ols/ontologies/kisao/terms?iri=http://www.biomodels.net/kisao/KISAO#KISAO_$1"
},
{
"code": "bioportal",
"description": "An override for the default construction of BioPortal URI patterns, since this ontology does not use OBO PURLs",
"homepage": "https://www.ebi.ac.uk/ols",
"name": "BioPortal",
"uri_format": "https://bioportal.bioontology.org/ontologies/KISAO?p=classes&conceptid=kisao:KISAO_$1"
}
],
"publications": [
Expand Down
6 changes: 6 additions & 0 deletions src/bioregistry/resolve_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ def get_iri(
A custom provider is given, which makes the Bioregistry very extensible
>>> get_iri("chebi:24867", provider="chebi-img")
'https://www.ebi.ac.uk/chebi/displayImage.do?defaultImage=true&imageIndex=0&chebiId=24867'

An override for a metaregistry is built-in to the record
>>> get_iri("kisao:0000057", provider="ols")
'https://www.ebi.ac.uk/ols/ontologies/kisao/terms?iri=http://www.biomodels.net/kisao/KISAO#KISAO_0000057'
Copy link
Member Author

Choose a reason for hiding this comment

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

should be able to get base IRI from ols, however, bioportal is a completely different situation

>>> get_iri("kisao:0000057", provider="bioportal")
'https://bioportal.bioontology.org/ontologies/KISAO?p=classes&conceptid=kisao:KISAO_0000057'
"""
return manager.get_iri(
prefix=prefix,
Expand Down