Skip to content

Resolve view term labels from /ns instead of the Linked Data proxy - #340

Merged
namedgraph merged 1 commit into
developfrom
view-ns-term-labels
Aug 8, 2026
Merged

Resolve view term labels from /ns instead of the Linked Data proxy#340
namedgraph merged 1 commit into
developfrom
view-ns-term-labels

Conversation

@namedgraph

Copy link
Copy Markdown
Member

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 /ns SPARQL endpoint (ACL-enforced) rather than proxying each term's vocabulary document.

Four view.xsl controls resolved predicate/class labels via GET ?uri=<ac:document-uri(term)> (the proxy) then ac:label:

  • order-by dropdown
  • facet headers (RenderFacets)
  • parallax properties (RELATED RESULTS)
  • rdf:type facet values

Change

  • view-results chain (ldh:view-results-thunk): 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. Reuses the existing ldh:load-property-metadata / ldh:set-property-metadata helpers in block.xsl.
  • order-by + facet headers: render labels synchronously from $property-metadata via ac:label (local-name fallback for terms not in the closure). Drops the per-predicate proxy promises and the now-unused ldh:order-by-response / ldh:facet-filter-response handlers. These controls also become deterministically ordered (no more render races).
  • parallax + rdf:type facet values: swap each per-term proxy GET ?uri= for a POST /ns DESCRIBE $Type VALUES { <term> }. The response is still application/rdf+xml, so ldh: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 LDH ac:property-label/ac:object-label overrides — they already consume the $property-metadata tunnel.

Net: -124 / +62 lines.

Verification

Verified against the running unesco-thesaurus demo (new SEF), comparing before/after HAR captures of the same page /concepts/concept1002/:

Vocab document (?uri= proxy) before after
skos/core
rdf-syntax-ns
prov
total proxy ?uri= 49 43

The SKOS view predicates (skos:broader, skos:related, skos:inScheme, rdf:type, …) now appear in the /ns DESCRIBE $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's 429 (rate-limited /) and 502 (/sparql) from the redundant proxy load are gone — after-capture proxy responses are all 200, all five /ns responses 200, zero console errors.

Note: base is raw-ontology-serving (stacked on #337) because this change assumes the dumb proxy. Re-target to develop if #337 lands first.

🤖 Generated with Claude Code

Base automatically changed from raw-ontology-serving to develop August 7, 2026 16:45
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
namedgraph force-pushed the view-ns-term-labels branch from 1f5ac9a to a80ecfa Compare August 7, 2026 16:49
@namedgraph
namedgraph merged commit 84c27af into develop Aug 8, 2026
1 of 2 checks passed
@namedgraph
namedgraph deleted the view-ns-term-labels branch August 8, 2026 18:40
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