Skip to content

Port the XSLT overrides to LinkedDataHub's new stylesheet API - #25

Merged
namedgraph merged 3 commits into
masterfrom
fix/xslt-overrides-and-sef-build
Sep 11, 2026
Merged

namedgraph merged 3 commits into
masterfrom
fix/xslt-overrides-and-sef-build

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Keeps the LTLOD end-user rendering working against the current LinkedDataHub
image, which dropped the Bootstrap 2.3.2 stylesheet tree, plus two smaller
fixes that came up alongside it.

Retarget every override to the new modes

The modes our overrides hook into moved into the ac: and ldh: namespaces
and the imports lost the bootstrap/2.3.2/ path segment:

was now what it overrides
bs2:Row ldh:BlockRow membership / interval / instant block suppression
bs2:PropertyList ac:PropertyEditor gsp:asWKT suppression
bs2:ContainerTable ac:ResultsTable memberships table columns
xhtml:Table* ac:ResultsTable* org:memberDuring and foaf:depiction cells
bs2:Footer ac:Footer the LTLOD footer

layout.xsl now imports ../com/atomgraph/linkeddatahub/xsl/layout.xsl, and
the bs2 prefix is gone from all three files.

The memberships table can no longer delegate with apply-templates: the stock
table emitter lives in ac:ResultsTable, the same mode this template matches
in, so applying templates there would re-enter it forever. It hands the
restricted column list to the stock emitter with xsl:next-match instead.

The footer follows the new design system's markup: .ldh-footer without the
legacy .footer class, plus role="contentinfo".

Also on this branch

  • ac:langs() instead of the $ac:langs global param in overrides.xsl,
    following LDH. The function is declared for both engines under use-when
    guards, so the skos:altLabel fallback keeps working client-side through the
    SEF and server-side through layout.xsl's import.
  • make sef fails safely — compiles to a temp file and only moves it into
    place on success, so a failed compile leaves the working SEF untouched
    instead of truncating it.
  • One image per foaf:depiction table cell. A Seimas member legitimately
    carries more than one (Wikidata P18 plus the scraped lrs.lt portrait), and
    the stock stacked cell costs ~180px of row height per row to show a second
    image that says nothing the first does not. https: wins over http: when
    both forms of one image are present, since http Commons URLs do not render.
  • Frontpage and persons-container views get dct:title and
    ldh:showWhenEmpty false. 3cc5a5b deliberately skipped these
    document-defined views, but an empty store (or a load still in progress)
    renders them as titleless empty blocks.
  • .lead.lede on the frontpage intro; geo-resources-string written as
    CDATA rather than entity-escaped angle brackets so the query reads as SPARQL.

Note for whoever merges

The matching image pin in docker-compose.override.yml is not in this PR —
it is left uncommitted locally at the author's request. The new stylesheet API
only exists in atomgraph/linkeddatahub:aadd79163412eb1c1316ed4458e4dc654058d1f6
and later, so a checkout of this branch against the older pinned image gets
overrides that match nothing.

Testing

Not verified against a running stack in this session — the mode retargeting is
a mechanical rename against LDH's current stylesheet tree. Worth a make sef
plus docker compose up -d --force-recreate linkeddatahub and an eyeball of a
person page (memberships table, no plumbing blocks), the frontpage (views,
footer) and one filter pill before merging.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rpcs7VhsGAhungG9fjwR1Z

namedgraph and others added 3 commits September 2, 2026 19:35
The design system folds every value of a property into the cell the first one
opens and caps the stack (ldh-bridge.css: table.table td > .values has
max-height 12em, overflow-y auto). Right for literals, wrong for portraits: a
Seimas member legitimately carries more than one foaf:depiction — Wikidata P18
plus the scraped lrs.lt portrait — and the second says nothing the first does
not, while costing ~180px of row height on every row.

Override the cell-opening depiction (the same node the stock priority-1
xhtml:TableDataCell template matches; the stock empty template still swallows
the rest) and emit the design system's own div.values > div.value markup with a
single value, so cell padding, the ~ .value separator and the height cap all
still apply — none of which engage at one value. Deleting the template reverts
to the stacked cell.

https: is preferred over http: when both forms of one image are present: http
Wikimedia Commons URLs do not render in browsers, which is why the reconciler
https-normalises them, so an arbitrary pick could show a knowingly-broken
image. The predicate is a no-op once no http Commons URL survives in the store.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PoiMWyMGtWZos9wWoVUCwg
overrides.xsl: read the browser's languages through the ac:langs() function
instead of the $ac:langs global param, following LinkedDataHub. The function is
declared for both engines under use-when guards — SaxonJS in
linkeddatahub/xsl/bootstrap/2.3.2/imports/default.xsl and SAXON in
client/xsl/functions.xsl — so the skos:altLabel fallback keeps working
client-side through the SEF and server-side through layout.xsl's import.

Makefile: `sef` now compiles to a temp file and only moves it into place on
success, so a failed compile leaves the working SEF untouched instead of
truncating it. `up` runs docker compose in the foreground and no longer
pre-creates the bind-mount directories.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PoiMWyMGtWZos9wWoVUCwg
LDH dropped the Bootstrap 2.3.2 stylesheet tree; the modes our overrides hook
into moved into the ac: and ldh: namespaces and the imports lost the
bootstrap/2.3.2/ path segment. Retarget every override accordingly:

  bs2:Row           -> ldh:BlockRow        (membership/interval/instant blocks)
  bs2:PropertyList  -> ac:PropertyEditor   (gsp:asWKT suppression)
  bs2:ContainerTable-> ac:ResultsTable     (memberships table)
  xhtml:Table*      -> ac:ResultsTable*    (cell overrides)
  bs2:Footer        -> ac:Footer           (LTLOD footer)

layout.xsl now imports ../com/atomgraph/linkeddatahub/xsl/layout.xsl and the
bs2 prefix is gone from all three files.

The memberships table can no longer delegate with apply-templates: the stock
table emitter lives in ac:ResultsTable, the same mode this template matches in,
so applying templates there would re-enter it forever. Hand the restricted
column list to the stock emitter with xsl:next-match instead, which is what
reaches the lower-precedence stock template.

The footer markup follows the new design system: .ldh-footer without the legacy
.footer class, plus role="contentinfo". Cell CSS moved from ldh-bridge.css to
ldh.css under .ldh-results-table — comment-only change.

While here: give the frontpage and persons-container views dct:title and
ldh:showWhenEmpty false. They are document-defined views that commit 3cc5a5b
deliberately skipped, but an empty store (or a load that has not finished)
renders them as titleless empty blocks; the flag costs nothing when they do
have results. Also fix the .lead -> .lede class on the frontpage intro and
write geo-resources-string as CDATA rather than entity-escaped angle brackets,
so the query reads as SPARQL.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rpcs7VhsGAhungG9fjwR1Z
@namedgraph
namedgraph merged commit 7f3ea36 into master Sep 11, 2026
2 checks passed
@namedgraph
namedgraph deleted the fix/xslt-overrides-and-sef-build branch September 11, 2026 17:21
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