Skip to content

fix: parse EBI OLS lookups given with the /ols4/ path - #886

Merged
tkuhn merged 1 commit into
masterfrom
fix/ols4-lookup-api
Nov 3, 2026
Merged

tkuhn merged 1 commit into
masterfrom
fix/ols4-lookup-api

Conversation

@tkuhn

@tkuhn tkuhn commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Problem

A guided choice whose nt:possibleValuesFromApi points at EBI OLS under its current path shows no suggestions, e.g.

https://www.ebi.ac.uk/ols4/api/select?ontology=ncbitaxon&fieldList=iri,label,description&q=

There is no error. The field just stays empty. The same happens in the live template https://w3id.org/np/RAIV7ms4vqtxSccNNQvTT8uiSYGKCtpgUGgUD3O4MbG_U ("Expressing an association between an organism and a nucleotide sequence"), whose "choose the type of sample" field uses https://www.ebi.ac.uk/ols4/api/select?ontology=uberon&q=.

Cause

LookupApiRegistry sends only https://www.ebi.ac.uk/ols/api/select to OlsParser. An /ols4/ URL falls through to CanonicalParser. That parser looks for a top-level array of results with uri/@id fields, but OLS answers {"response": {"docs": [{"iri": …}]}}, so it finds nothing.

The old /ols/ path still works because EBI redirects it (301) to /ols4/, and the answer is the same.

Fix

OlsParser is now registered for both /ols/api/select and /ols4/api/select.

Tests

  • LookupApiRegistryTest: new row checking that an /ols4/ URL is handled by OlsParser.
  • LookupApis.getPossibleValues with the NCBITaxon URL above and the term mouse now returns 10 NCBITaxon terms with labels.
  • On a local instance, the publish form of the template above now suggests UBERON terms (heart, cardiac muscle tissue, …) in "choose the type of sample" when you type heart.

🤖 Generated with Claude Code

Guided choices with nt:possibleValuesFromApi pointing at
https://www.ebi.ac.uk/ols4/api/select showed no suggestions. Only the
older /ols/ path was routed to OlsParser; the /ols4/ path fell through
to CanonicalParser, which finds no top-level results array in the OLS
answer. Both paths now go to OlsParser (/ols/ redirects to /ols4/ and
answers the same).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tkuhn
tkuhn merged commit 388ca8f into master Nov 3, 2026
8 checks passed
@tkuhn
tkuhn deleted the fix/ols4-lookup-api branch November 3, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant