From 57cb98a9be03cf00551fa1022bb2c2680b08d684 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Sat, 17 Sep 2022 13:59:00 +0200 Subject: [PATCH 1/2] First step to enabling override of default OLS and BioPortal URI construction --- src/bioregistry/data/bioregistry.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json index 06881cca6..a20d75dbc 100644 --- a/src/bioregistry/data/bioregistry.json +++ b/src/bioregistry/data/bioregistry.json @@ -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%3A%2F%2Fwww.biomodels.net%2Fkisao%2FKISAO%23KISAO_$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": [ From 2f7f6a335073b855c950a758764d7aafd7ff66d6 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 25 Oct 2022 15:17:58 +0200 Subject: [PATCH 2/2] Update tests --- src/bioregistry/data/bioregistry.json | 2 +- src/bioregistry/resolve_identifier.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json index a20d75dbc..645f86544 100644 --- a/src/bioregistry/data/bioregistry.json +++ b/src/bioregistry/data/bioregistry.json @@ -6366,7 +6366,7 @@ "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%3A%2F%2Fwww.biomodels.net%2Fkisao%2FKISAO%23KISAO_$1" + "uri_format": "https://www.ebi.ac.uk/ols/ontologies/kisao/terms?iri=http://www.biomodels.net/kisao/KISAO#KISAO_$1" }, { "code": "bioportal", diff --git a/src/bioregistry/resolve_identifier.py b/src/bioregistry/resolve_identifier.py index bde731ffa..20bce8704 100644 --- a/src/bioregistry/resolve_identifier.py +++ b/src/bioregistry/resolve_identifier.py @@ -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' + >>> get_iri("kisao:0000057", provider="bioportal") + 'https://bioportal.bioontology.org/ontologies/KISAO?p=classes&conceptid=kisao:KISAO_0000057' """ return manager.get_iri( prefix=prefix,