diff --git a/CLAUDE.md b/CLAUDE.md index 9c716f1..694baac 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -144,7 +144,7 @@ since the rows differ in the image cell. Three files, all mounted over the running image's `ROOT/static` for the **end-user app only** (admin untouched): - `files/overrides.xsl` — the **shared** module: suppresses the n-ary - membership plumbing blocks (`bs2:Row`). Matching is **property-centric via + membership plumbing blocks (`ldh:BlockRow`). Matching is **property-centric via `key()`**, never bare `rdf:type`, so a block is hidden only when it is a rendered target of the `:Memberships` 1:N view *on this page* — a membership whose `org:member` is `key('resources', ac:absolute-path(ldh:request-uri()))`'s @@ -175,7 +175,7 @@ since the rows differ in the image cell. are unaffected, so settlement points stay mappable there. - `files/layout.xsl` — imports base `layout.xsl` + `overrides.xsl`; repoints the client bootstrap (`xhtml:Script` → `client-stylesheet`) at our SEF, and - **replaces the stock `bs2:Footer`** with the LTLOD one (own wordmark, dataset + **replaces the stock `ac:Footer`** with the LTLOD one (own wordmark, dataset shortcuts, source attribution, licence; the developer entry points — SPARQL, example queries, dataset downloads, `{base}ns` — live there instead of on the frontpage). The footer keeps the stock markup contract, since `app.css` styles @@ -183,7 +183,7 @@ since the rows differ in the image cell. exactly one `.brand-col` plus FOUR `.col` children, each a `.ftitle` followed by bare ``s, then `.legal` with two space-between spans. Only the wordmark `.mark` deviates — restyled inline to the Lithuanian tricolour, class-supplied - geometry kept. Footer-only because `bs2:Footer` is applied ONCE server-side + geometry kept. Footer-only because `ac:Footer` is applied ONCE server-side (LDH `layout.xsl`) and never re-rendered by client.xsl — so it belongs here, not in `overrides.xsl`, and needs no SEF rebuild. Mounted at the end-user app's `ac:stylesheet` target `static/xsl/layout.xsl`; imports `overrides.xsl` from diff --git a/Makefile b/Makefile index 07a2d19..22ecd75 100644 --- a/Makefile +++ b/Makefile @@ -52,13 +52,18 @@ sef: find "$$TMP_DIR/static" -name '*.xsl' -print0 | while IFS= read -r -d '' f; do xmlstarlet c14n "$$f" > "$$f.tmp" 2>/dev/null && mv "$$f.tmp" "$$f" || rm -f "$$f.tmp"; done; \ mkdir -p "$$TMP_DIR/static/files" && xmlstarlet c14n ./files/client.xsl > "$$TMP_DIR/static/files/client.xsl"; \ xmlstarlet c14n ./files/overrides.xsl > "$$TMP_DIR/static/files/overrides.xsl"; \ - npx xslt3-he -t -xsl:"$$TMP_DIR/static/files/client.xsl" -export:./files/client.xsl.sef.json -nogo -ns:##html5 -relocate:on; \ + npx xslt3-he -t -xsl:"$$TMP_DIR/static/files/client.xsl" -export:"$$TMP_DIR/client.xsl.sef.json" -nogo -ns:##html5 -relocate:on; \ + if [ $$? -ne 0 ] || [ ! -s "$$TMP_DIR/client.xsl.sef.json" ]; then \ + rm -rf "$$TMP_DIR"; \ + echo "SEF compile FAILED - files/client.xsl.sef.json left unchanged" >&2; \ + exit 1; \ + fi; \ + mv "$$TMP_DIR/client.xsl.sef.json" ./files/client.xsl.sef.json; \ rm -rf "$$TMP_DIR"; \ echo "Wrote files/client.xsl.sef.json" up: secrets cert - mkdir -p datasets/owner datasets/secretary uploads fuseki/admin fuseki/end-user - docker compose up -d + docker compose up @echo "LinkedDataHub starting — first boot takes ~1-2 min (self-signed cert)." @echo "URL: https://localhost:4443/" diff --git a/app/ns.ttl b/app/ns.ttl index a211d87..8149085 100644 --- a/app/ns.ttl +++ b/app/ns.ttl @@ -13,7 +13,7 @@ # the AR-spatial *-geo.trig), so :SubUnits uses ac:MapMode — LDH plots each unit as # a map marker (RDFXML2GeoJSON keys on geo:lat+geo:long). Views that project # image-bearing persons (foaf:depiction portraits from lrs.lt) use ac:GridMode so -# LDH lays them out as a thumbnail grid (bs2:ContainerGrid → foaf:depiction per +# LDH lays them out as a thumbnail grid (ac:Grid → foaf:depiction per # card). Imageless targets (Seimas org-units) keep the default list. # # Filter/sort columns: LDH turns the BGP triples whose subject is the query's diff --git a/app/persons.ttl b/app/persons.ttl index b12b71e..0c3e8e9 100644 --- a/app/persons.ttl +++ b/app/persons.ttl @@ -31,7 +31,8 @@ <#persons-view> a ldh:View ; dct:title "Seimo nariai"@lt, "Members of the Seimas"@en ; spin:query <#persons-query> ; - ac:mode ac:GridMode . + ac:mode ac:GridMode ; + ldh:showWhenEmpty false . # dct:title (not just rdfs:label) is mandatory on sp:Select — LDH enforces # def:MissingTitle as a SPIN constraint and rejects the PUT with 422 otherwise. diff --git a/app/root.ttl b/app/root.ttl index a56a43c..639a8dc 100644 --- a/app/root.ttl +++ b/app/root.ttl @@ -26,7 +26,7 @@ <#intro> a ldh:XHTML ; rdf:value """
-

Oficialių Lietuvos registrų duomenys vienoje vietoje: administraciniai vienetai, Seimo nariai, partijos, juridiniai asmenys ir klasifikatoriai. Duomenys susieti tarpusavyje, tad nuo vieno objekto galite pereiti prie visų su juo susijusių — nuo apskrities prie savivaldybių, nuo Seimo nario prie jo komitetų ir partijos.

+

Oficialių Lietuvos registrų duomenys vienoje vietoje: administraciniai vienetai, Seimo nariai, partijos, juridiniai asmenys ir klasifikatoriai. Duomenys susieti tarpusavyje, tad nuo vieno objekto galite pereiti prie visų su juo susijusių — nuo apskrities prie savivaldybių, nuo Seimo nario prie jo komitetų ir partijos.

Žemiau — keli pjūviai iš duomenų: apskritys žemėlapyje, Seimo frakcijos, partijos ir komitetų pirmininkai. Visi duomenų rinkiniai — puslapio apačioje.

"""^^rdf:XMLLiteral . @@ -42,8 +42,10 @@ rdf:value <#counties-view> . <#counties-view> a ldh:View ; + dct:title "Apskritys"@lt, "Counties"@en ; spin:query <#counties-query> ; - ac:mode ac:GridMode . + ac:mode ac:GridMode ; + ldh:showWhenEmpty false . <#counties-query> a sp:Select ; dct:title "Apskritys"@lt ; @@ -76,8 +78,10 @@ ORDER BY ?label""" . rdf:value <#counties-map-view> . <#counties-map-view> a ldh:View ; + dct:title "Apskritys žemėlapyje"@lt, "Counties on the map"@en ; spin:query <#counties-query> ; - ac:mode ac:MapMode . + ac:mode ac:MapMode ; + ldh:showWhenEmpty false . # rdf:_5 / rdf:_6 — faction sizes bar chart @@ -133,8 +137,10 @@ ORDER BY DESC(?members)""" . rdf:value <#parties-view> . <#parties-view> a ldh:View ; + dct:title "Seimo narius iškėlusios partijos"@lt, "Parties that nominated members of the Seimas"@en ; spin:query <#parties-query> ; - ac:mode ac:TableMode . + ac:mode ac:TableMode ; + ldh:showWhenEmpty false . <#parties-query> a sp:Select ; dct:title "Seimo narius iškėlusios partijos"@lt ; @@ -166,8 +172,10 @@ ORDER BY ?label""" . rdf:value <#table-chairs-view> . <#table-chairs-view> a ldh:View ; + dct:title "Komitetų ir komisijų pirmininkai"@lt, "Committee and commission chairs"@en ; spin:query <#table-chairs-query> ; - ac:mode ac:TableMode . + ac:mode ac:TableMode ; + ldh:showWhenEmpty false . <#table-chairs-query> a sp:Select ; dct:title "Komitetų ir komisijų pirmininkai"@lt ; diff --git a/files/client.xsl b/files/client.xsl index 367ad89..d6ce7ff 100644 --- a/files/client.xsl +++ b/files/client.xsl @@ -22,19 +22,19 @@ + ]> @@ -58,10 +58,10 @@ it wins. Scoped map views (:SubUnits, the frontpage counties map) use their own spin:query and are unaffected — settlement points remain mappable there. --> - -PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> -PREFIX dct: <http://purl.org/dc/terms/> -PREFIX gsp: <http://www.opengis.net/ont/geosparql#> + +PREFIX dct: +PREFIX gsp: SELECT DISTINCT ?resource WHERE @@ -76,7 +76,22 @@ WHERE } } ORDER BY ?title - +]]> + + + - - + mode="ac:ResultsTable" priority="5"> - + - + - + + + + + + +
+ +
+ +
+ - - diff --git a/files/layout.xsl b/files/layout.xsl index 02b494d..bf94e9e 100644 --- a/files/layout.xsl +++ b/files/layout.xsl @@ -10,9 +10,9 @@ 2. import the shared files/overrides.xsl so the membership plumbing blocks are suppressed in the SERVER render too — otherwise the server emits them and the client removes them during CSR, causing a visible flash; - 3. replace the stock LinkedDataHub footer (bs2:Footer) with the LTLOD one — + 3. replace the stock LinkedDataHub footer (ac:Footer) with the LTLOD one — our own wordmark, dataset shortcuts, source attribution and licence. - The footer is server-rendered ONLY (layout.xsl applies bs2:Footer once, + The footer is server-rendered ONLY (layout.xsl applies ac:Footer once, client.xsl never re-renders it), so it lives here and not in overrides.xsl — no SEF rebuild needed after editing it. @@ -37,12 +37,12 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:rdf="&rdf;" xmlns:ldt="&ldt;" + xmlns:ac="https://w3id.org/atomgraph/client#" xmlns:lapp="https://w3id.org/atomgraph/linkeddatahub/apps#" xmlns:srx="http://www.w3.org/2005/sparql-results#" - xmlns:bs2="http://graphity.org/xsl/bootstrap/2.3.2" exclude-result-prefixes="#all"> - + @@ -77,11 +77,11 @@ above), so they land in the XHTML namespace like the surrounding markup — without it the serialiser emits a stray xmlns="" reset on the footer. Footer links are excluded from the client-side click interceptor - (client.xsl's ixsl:onclick match skips ancestor .footer), so internal + (client.xsl's ixsl:onclick match skips ancestor .ldh-footer), so internal ones do a normal page load rather than CSR. --> - -