Skip to content

Fall back to site homepage when an xref has no link_base - #142

Merged
Robbie1977 merged 1 commit into
mainfrom
fix/xref-link-fallback
Nov 10, 2026
Merged

Robbie1977 merged 1 commit into
mainfrom
fix/xref-link-fallback

Conversation

@Robbie1977

Copy link
Copy Markdown
Contributor

Xref.link() and the term-info flattener in vfb_queries.py joined the accession onto an empty link_base, so a Site without one emitted the bare accession as a relative URL — e.g. /org.geppetto.frontend/sample-1099 on the Randel2026 dataset page, and the CATMAID skid on each of its 178 activity-tagged neurons (Site larva1099_activity).

Only build the external link when a link_base exists; otherwise use the Site's homepage, then its iri. ha_api._xref_rows already returned an empty link in this case and is unchanged.

Tests: tests/test_xref_link_fallback.py covers link_base present, homepage fallback, iri fallback and a None postfix. tests/test_xref.py still passes.

After release: force-refresh the cached term info for Randel2026 and the 178 neurons (cache keys are per major.minor, so a patch release alone won't evict them).

Xref.link() (and the vfb_queries term-info flattener) joined the accession
onto an empty link_base, so Sites without one emitted the bare accession as
a relative URL, e.g. /org.geppetto.frontend/sample-1099 on the Randel2026
dataset page and the skid on each of its 178 activity-tagged neurons. Only
build the external link when a link_base exists; otherwise use the site's
homepage, then its iri. Tests cover all three cases and a None postfix.
@Robbie1977
Robbie1977 merged commit 75a2827 into main Nov 10, 2026
6 checks passed
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