Skip to content

Explorer: render SKOS prefLabels for facet URIs (#148 step 2)#150

Merged
rdhyee merged 2 commits intoisamplesorg:mainfrom
rdhyee:explorer-vocab-labels
Apr 29, 2026
Merged

Explorer: render SKOS prefLabels for facet URIs (#148 step 2)#150
rdhyee merged 2 commits intoisamplesorg:mainfrom
rdhyee:explorer-vocab-labels

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented Apr 29, 2026

Second step of #148 — wires the canonical `vocab_labels.parquet` artifact (PR #149) into the Interactive Explorer's facet UI.

Summary

  • Loads `https://data.isamples.org/vocab_labels.parquet\` (58KB, now live behind the data-isamples-org Worker) into a URI → prefLabel `Map`.
  • New `prettyLabel(uri)` helper: returns the SKOS prefLabel when known, else falls back to the last URI path segment, else the raw value. Safe against the 4 known unresolved URIs (~169 / ~6M samples — flagged as upstream design debt in Facets show vocabulary URIs instead of human-readable labels (cross-repo) #148).
  • Material / Sampled Feature / Specimen Type checkboxes now render labels instead of URIs. Full URI preserved in a hover tooltip.
  • Preload hint added for cache-warm parity with the other parquets.

Verification

  • `curl -sI https://data.isamples.org/vocab_labels.parquet\` → 200, correct content-type, ETag set.
  • Local Quarto render + Playwright smoke test on `docs/tutorials/isamples_explorer.html`: 0 JS exceptions, 0 console errors, 0 network failures.

What this doesn't do

  • Doesn't fix the upstream root cause (`IdentifiedConcept.label` holds the URI in the wide parquet; `scheme_name` is NULL). That's pqg work — separate PR after we agree on whether the converter populates label from `vocab_labels` at build time, or whether consumers always JOIN.
  • Doesn't yet wire labels into the other facet UIs across the site (notebooks, future detail panels). Same lookup file is reusable when we get there.

File touched

  • `tutorials/isamples_explorer.qmd` — preload hint, `vocab_labels_url`, `vocabLabels` cell, `prettyLabel()` helper, three format-callback edits.

rdhyee and others added 2 commits April 28, 2026 17:13
Wires the vocab_labels.parquet artifact (now live at
data.isamples.org/vocab_labels.parquet, 58KB) into the Material /
Sampled Feature / Specimen Type facets. Adds vocabLabels (URI →
prefLabel Map) and a prettyLabel(uri) helper with last-segment
fallback for any URIs not declared in the TTLs (4 known stragglers,
~169 of ~6M samples — see isamplesorg#148). Each checkbox row now shows the
prefLabel with the full URI in a hover tooltip.

Smoke-tested locally: 0 JS exceptions, 0 console errors, 0 network
failures. Preload hint added for cache-warm parity with the other
parquets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The three OJS pages that import the canonical SOURCE_COLORS palette
were resolving '/assets/js/source-palette.js' against the origin,
which works on isamples.org (custom domain at root) but 404s on
project-pages fork previews like rdhyee.github.io/isamplesorg.github.io/...
The failed import cascades through the OJS reactive graph and breaks
every downstream cell in the Explorer / progressive globe.

Switch to '../assets/...' (and '../../assets/...' for the archived
tutorial one level deeper) so document.baseURI does the right thing
in both deploy modes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rdhyee rdhyee merged commit 7214ab0 into isamplesorg:main Apr 29, 2026
1 check 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