From 5984426ff34623d802572b0571795a550cb77bf6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 15 Dec 2025 18:15:19 -0500 Subject: [PATCH] fix: manually redirect OBO PURLs identifying an NCBITaxon entity to RDF representation on Ontobee obolibrary changed the redirection target of a PURLs identifying an entity on NCBITaxon from an RDF representation on Ontobee to an HTML representation on the NIH official site as of https://github.com/OBOFoundry/purl.obolibrary.org/pull/1066. Our logic requires the representations to be RDF, so we are redirecting the affected PURLs to the corresponding RDF representation manually. --- dandi/metadata/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dandi/metadata/util.py b/dandi/metadata/util.py index ccc7eb161..11ccd1a04 100644 --- a/dandi/metadata/util.py +++ b/dandi/metadata/util.py @@ -425,7 +425,11 @@ def parse_purlobourl( :return: dictionary containing found nodes """ - req = requests.get(url, allow_redirects=True) + if url.startswith(NCBITAXON_URI_TEMPLATE.format("")): + rdf_content_url = f"https://ontobee.org/ontology/rdf/NCBITaxon?iri={url}" + req = requests.get(rdf_content_url, allow_redirects=True) + else: + req = requests.get(url, allow_redirects=True) req.raise_for_status() doc = parseString(req.text) for elfound in doc.getElementsByTagName("Class"):