Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/shacl-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
domain=$(basename "$(dirname "$f")")
echo "::group::$f"
case "$(basename "$f")" in
# overlay files (owl:sameAs/foaf:depiction onto other files' graphs):
# graph invariants intentionally absent, so skip validate.sh
alignments.trig|photos.trig)
# overlay files (owl:sameAs/foaf:depiction/geo onto other files'
# graphs): graph invariants intentionally absent, so skip validate.sh
alignments.trig|photos.trig|*-geo.trig)
etl/lib/shacl.sh "etl/shapes/$domain.ttl" "$f" "$BASE" \
|| { rc=1; echo "::error file=$f::SHACL validation failed"; echo "- FAIL: $f" >> "$GITHUB_STEP_SUMMARY"; } ;;
*)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ etl/tools/.venv/

# bulk generated data — regenerate with `make -C etl admin-units`
datasets/current/admin-units/settlements.trig
datasets/current/admin-units/settlements-geo.trig
datasets/current/admin-units/streets.trig
__pycache__/

Expand Down
18 changes: 18 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,24 @@ plain `SELECT DISTINCT` won't, since the rows differ in the image cell.
header. Only base-internal IRIs relativize; external URIs (Wikidata, Commons, lrs.lt,
EU tables, schema.org, mailto/tel) stay absolute. Round-trip proof:
`riot --base=$BASE --output=nquads file.trig | sort` is base-independent.
- **Admin-unit coordinates live in `*-geo.trig`** (`ltlod-geo`, from the AR spatial
`gra*` models), merged on load like `alignments.trig` — the committed level
`*.trig` carry no geo. LDH map mode (`ac:MapMode`) plots `geo:lat`+`geo:long`
(WGS84 point marker) and/or `gsp:asWKT` (GeoSPARQL polygon). **⚠ EPSG:3346 (LKS-94)
axis order is (Northing, Easting)**: the source WKT stores the ~6·10⁶ northing
first, ~3–6·10⁵ easting second, so `ltlod-geo` feeds pyproj `(easting, northing)`
under `always_xy=True` → `(lon, lat)`. Every point is bounds-checked against
Lithuania's bbox — a swapped axis lands far outside and aborts. Sanity check:
Vilnius ≈ lat 54.6–54.7, lon 25.2–25.3.
- **Geometries are `gsp:asWKT` on `#this`, simplified, coarse levels only**
(`ltlod-geo --simplify <metres>`, set per level in `admin-units/Makefile`). The WKT
must be **bare WGS84 lon-lat** (no leading `<crs>` URI — OpenLayers' `ol.format.WKT`
can't parse one) typed `http://www.opengis.net/ont/geosparql#wktLiteral`; put it
directly on `#this` (not a `geo:hasGeometry` node) so the map feature id is the unit
URI. LDH does **no** client-side simplification (raw polygons are ~160 MB), hence
Douglas–Peucker in ETL. No LTLOD XSL change needed — `map.xsl` ships via the
imported stock `client.xsl`; the committed coarse `*-geo.trig` hold points + WKT,
settlements stay point-only.
- **Fuseki ports are never published to the host** — query via
`https://localhost:4443/sparql` or from inside the network:
`docker compose exec linkeddatahub curl http://varnish-end-user/ds/`.
Expand Down
13 changes: 7 additions & 6 deletions app/ns.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
# semantics (same approach as the northwind-traders demo app).
#
# ac:mode picks the layout LDH renders the projected entities with (ac:ListMode
# default, else Table/Grid/Map/…). Views that project image-bearing entities —
# persons (foaf:depiction portraits from lrs.lt) and admin units (Wikimedia
# photos/coats of arms via the Wikidata alignment) — use ac:GridMode so LDH lays
# them out as a thumbnail grid (bs2:ContainerGrid → foaf:depiction per card).
# Imageless targets (Seimas org-units) keep the default list.
# default, else Table/Grid/Map/…). Admin units carry WGS84 geo:lat/geo:long (from
# 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
# card). Imageless targets (Seimas org-units) keep the default list.

@prefix : <#> .
@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .
Expand Down Expand Up @@ -131,7 +132,7 @@ org:memberDuring a owl:ObjectProperty ;
:SubUnits a ldh:View ;
dct:title "Sudedamieji vienetai"@lt, "Constituent units"@en ;
spin:query :SelectSubUnits ;
ac:mode ac:GridMode ;
ac:mode ac:MapMode ;
rdfs:isDefinedBy : .

:SelectSubUnits a sp:Select ;
Expand Down
37 changes: 25 additions & 12 deletions app/root.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
rdf:_1 <#intro> ;
rdf:_2 <#counties-intro> ;
rdf:_3 <#counties-block> ;
rdf:_4 <#chart-factions-intro> ;
rdf:_5 <#chart-factions-block> ;
rdf:_6 <#parties-intro> ;
rdf:_7 <#parties-block> ;
rdf:_8 <#table-chairs-intro> ;
rdf:_9 <#table-chairs-block> ;
rdf:_10 <#browse-intro> ;
rdf:_11 <#select-children> .
rdf:_4 <#counties-map-block> ;
rdf:_5 <#chart-factions-intro> ;
rdf:_6 <#chart-factions-block> ;
rdf:_7 <#parties-intro> ;
rdf:_8 <#parties-block> ;
rdf:_9 <#table-chairs-intro> ;
rdf:_10 <#table-chairs-block> ;
rdf:_11 <#browse-intro> ;
rdf:_12 <#select-children> .

# rdf:_1 — mission intro (title/description already render above)

Expand Down Expand Up @@ -63,7 +64,19 @@ WHERE
}
ORDER BY ?label""" .

# rdf:_4 / rdf:_5 — faction sizes bar chart
# rdf:_4 — the same counties as a map. Admin units carry WGS84 geo:lat/geo:long
# (AR-spatial *-geo.trig, merged on load); ac:MapMode plots each apskritis as a
# marker over OpenStreetMap. Reuses <#counties-query> — LDH DESCRIBEs each ?unit
# and reads its coordinates.

<#counties-map-block> a ldh:Object ;
rdf:value <#counties-map-view> .

<#counties-map-view> a ldh:View ;
spin:query <#counties-query> ;
ac:mode ac:MapMode .

# rdf:_5 / rdf:_6 — faction sizes bar chart

<#chart-factions-intro> a ldh:XHTML ;
rdf:value """<div xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -105,7 +118,7 @@ WHERE
GROUP BY ?faction
ORDER BY DESC(?members)""" .

# rdf:_6 / rdf:_7 — parties that nominated Seimas members (clickable list)
# rdf:_7 / rdf:_8 — parties that nominated Seimas members (clickable list)

<#parties-intro> a ldh:XHTML ;
rdf:value """<div xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -138,7 +151,7 @@ WHERE
}
ORDER BY ?label""" .

# rdf:_8 / rdf:_9 — committee chairs (single entity type: the chair persons)
# rdf:_9 / rdf:_10 — committee chairs (single entity type: the chair persons)

<#table-chairs-intro> a ldh:XHTML ;
rdf:value """<div xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -181,7 +194,7 @@ WHERE
}
ORDER BY ?person""" .

# rdf:_10 — browse prompt, then rdf:_11 — the container listing (LAST)
# rdf:_11 — browse prompt, then rdf:_12 — the container listing (LAST)

<#browse-intro> a ldh:XHTML ;
rdf:value """<div xmlns="http://www.w3.org/1999/xhtml">
Expand Down
73 changes: 73 additions & 0 deletions datasets/current/admin-units/counties-geo.trig

Large diffs are not rendered by default.

Loading
Loading