Skip to content

Commit 5984426

Browse files
yarikopticcandleindark
authored andcommitted
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 OBOFoundry/purl.obolibrary.org#1066. Our logic requires the representations to be RDF, so we are redirecting the affected PURLs to the corresponding RDF representation manually.
1 parent 78b7700 commit 5984426

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dandi/metadata/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ def parse_purlobourl(
425425
:return: dictionary containing found nodes
426426
"""
427427

428-
req = requests.get(url, allow_redirects=True)
428+
if url.startswith(NCBITAXON_URI_TEMPLATE.format("")):
429+
rdf_content_url = f"https://ontobee.org/ontology/rdf/NCBITaxon?iri={url}"
430+
req = requests.get(rdf_content_url, allow_redirects=True)
431+
else:
432+
req = requests.get(url, allow_redirects=True)
429433
req.raise_for_status()
430434
doc = parseString(req.text)
431435
for elfound in doc.getElementsByTagName("Class"):

0 commit comments

Comments
 (0)