Resolve view term labels from /ns instead of the Linked Data proxy - #340
Merged
Conversation
The four view controls (order-by dropdown, facet headers, parallax
properties, rdf:type facet values) resolved predicate/class labels by
proxying each term's vocabulary document (GET ?uri=<ac:document-uri(term)>),
then applying ac:label to the response. With the proxy no longer serving
ontology terms, route these through the app's /ns SPARQL endpoint instead.
- view-results chain: add a property-metadata load step (mirroring the
existing object-metadata step) that DESCRIBEs the result predicates over
/ns before ldh:render-view, threading $property-metadata through to the
order-by and facet-header rendering.
- order-by + facet headers: render labels synchronously from
$property-metadata via ac:label (local-name fallback for terms absent
from the closure); drop the per-predicate proxy promises and the
ldh:order-by-response / ldh:facet-filter-response handlers.
- parallax + rdf:type facet values: swap each per-term proxy GET for a
POST /ns DESCRIBE $Type VALUES { <term> }; the response is still
application/rdf+xml so the existing handlers are unchanged.
Verified against the unesco-thesaurus demo: on /concepts/concept1002/ the
redundant vocab-document proxy fetches drop (skos/core 9->5, rdf 2->1,
prov 2->1), the SKOS view predicates now resolve via /ns, and the 429/502
the redundant load triggered are gone.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
namedgraph
force-pushed
the
view-ns-term-labels
branch
from
August 7, 2026 16:49
1f5ac9a to
a80ecfa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Client-side counterpart of #337 (the dumb Linked Data proxy). With the proxy no longer serving ontology terms, the view's term-label resolution must go through the app's
/nsSPARQL endpoint (ACL-enforced) rather than proxying each term's vocabulary document.Four
view.xslcontrols resolved predicate/class labels viaGET ?uri=<ac:document-uri(term)>(the proxy) thenac:label:RenderFacets)RELATED RESULTS)Change
ldh:view-results-thunk): add a property-metadata load step (mirroring the existing object-metadata step) that DESCRIBEs the result predicates over/nsbeforeldh:render-view, threading$property-metadatathrough to the order-by and facet-header rendering. Reuses the existingldh:load-property-metadata/ldh:set-property-metadatahelpers inblock.xsl.$property-metadataviaac:label(local-name fallback for terms not in the closure). Drops the per-predicate proxy promises and the now-unusedldh:order-by-response/ldh:facet-filter-responsehandlers. These controls also become deterministically ordered (no more render races).GET ?uri=for aPOST /nsDESCRIBE $Type VALUES { <term> }. The response is stillapplication/rdf+xml, soldh:parallax-property-response/ldh:facet-value-type-response(and their local-name/URI fallbacks) are unchanged.No changes to
ac:label/ac:description(Web-Client, SSR-pure) or the LDHac:property-label/ac:object-labeloverrides — they already consume the$property-metadatatunnel.Net:
-124 / +62lines.Verification
Verified against the running
unesco-thesaurusdemo (new SEF), comparing before/after HAR captures of the same page/concepts/concept1002/:?uri=proxy)skos/corerdf-syntax-nsprov?uri=The SKOS view predicates (
skos:broader,skos:related,skos:inScheme,rdf:type, …) now appear in the/nsDESCRIBE $Type VALUES {…}bodies; the parallax panel renders their real ontology labels ("has broader", "is in scheme", "is top concept in scheme", "type"). The before-capture's429(rate-limited/) and502(/sparql) from the redundant proxy load are gone — after-capture proxy responses are all200, all five/nsresponses200, zero console errors.🤖 Generated with Claude Code