Port the XSLT overrides to LinkedDataHub's new stylesheet API - #25
Merged
Merged
Conversation
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
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.
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:andldh:namespacesand the imports lost the
bootstrap/2.3.2/path segment:bs2:Rowldh:BlockRowbs2:PropertyListac:PropertyEditorgsp:asWKTsuppressionbs2:ContainerTableac:ResultsTablexhtml:Table*ac:ResultsTable*org:memberDuringandfoaf:depictioncellsbs2:Footerac:Footerlayout.xslnow imports../com/atomgraph/linkeddatahub/xsl/layout.xsl, andthe
bs2prefix is gone from all three files.The memberships table can no longer delegate with
apply-templates: the stocktable emitter lives in
ac:ResultsTable, the same mode this template matchesin, so applying templates there would re-enter it forever. It hands the
restricted column list to the stock emitter with
xsl:next-matchinstead.The footer follows the new design system's markup:
.ldh-footerwithout thelegacy
.footerclass, plusrole="contentinfo".Also on this branch
ac:langs()instead of the$ac:langsglobal param inoverrides.xsl,following LDH. The function is declared for both engines under
use-whenguards, so the
skos:altLabelfallback keeps working client-side through theSEF and server-side through
layout.xsl's import.make seffails safely — compiles to a temp file and only moves it intoplace on success, so a failed compile leaves the working SEF untouched
instead of truncating it.
foaf:depictiontable cell. A Seimas member legitimatelycarries 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 overhttp:whenboth forms of one image are present, since http Commons URLs do not render.
dct:titleandldh:showWhenEmpty false. 3cc5a5b deliberately skipped thesedocument-defined views, but an empty store (or a load still in progress)
renders them as titleless empty blocks.
.lead→.ledeon the frontpage intro;geo-resources-stringwritten asCDATA rather than entity-escaped angle brackets so the query reads as SPARQL.
Note for whoever merges
The matching image pin in
docker-compose.override.ymlis not in this PR —it is left uncommitted locally at the author's request. The new stylesheet API
only exists in
atomgraph/linkeddatahub:aadd79163412eb1c1316ed4458e4dc654058d1f6and 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 sefplus
docker compose up -d --force-recreate linkeddatahuband an eyeball of aperson 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