Show coat of arms as AdminUnit depiction consistently (P94 → foaf:img)#18
Merged
Conversation
The frontpage AdminUnit grid picked images nondeterministically: reconciliation emitted both the coat of arms (Wikidata P94) and a scenery photo (P18) as foaf:depiction, and LDH's ac:image thumbnail selector renders only the first in DESCRIBE order, so some cards showed the coat of arms and others a photo. Model the coat of arms on foaf:img instead (rdfs:subPropertyOf foaf:depiction, "particularly representative"). LDH's ac:image ranks foaf:img > foaf:logo > foaf:depiction and renders the first, so the coat of arms now wins the card image deterministically while the photo stays a plain foaf:depiction on the entity page. Persons are unaffected (no P94 -> their portrait stays foaf:depiction). Also fix a latent bug in the image-liveness check surfaced while regenerating: Commons rate-limits liveness bursts with HTTP 429, which reachable() treated as "dead" and stripped live images en masse (10/518 reachable). It now retries 429/503 with backoff (honoring Retry-After) at gentler concurrency (518/518). Regenerated datasets/current/admin-units/alignments.trig: 171 foaf:img (coats of arms) + 374 foaf:depiction (photos) = the same 545 images as before, all live, now https (the committed URLs were stale http, which browsers won't render). Parses, round-trips base-independently, SHACL conforms. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The frontpage AdminUnit grid displayed images inconsistently — some cards showed a county's coat of arms, others a scenery photo. Reconciliation emitted both the coat of arms (Wikidata P94) and a photo (P18) as
foaf:depiction, and LDH'sac:imagethumbnail selector renders only the first in nondeterministic DESCRIBE order. The view'sSELECTcan't control it (it's DESCRIBE-wrapped).Fix
Model the coat of arms on
foaf:imginstead offoaf:depiction.foaf:imgisrdfs:subPropertyOf foaf:depiction("particularly representative"), and LDH'sac:imageranksfoaf:img>foaf:logo>foaf:depiction, rendering the first — so the coat of arms now wins the card image deterministically, while the scenery photo stays a plainfoaf:depiction(still shown on the entity's own page).foaf:imgfoaf:depictionschema:logo(unchanged)foaf:depiction.Liveness-check bug (found while regenerating)
Commons rate-limits liveness bursts with HTTP 429, which
images.reachable()treated as "dead" and stripped live images en masse (10/518 reachable on a naive run). It now retries 429/503 with backoff (honoringRetry-After) at gentler concurrency → 518/518.Data
Regenerated
datasets/current/admin-units/alignments.trig:foaf:img(coats of arms) + 374foaf:depiction(photos) = the same 545 images as before — nothing lost, just reclassified.https://(the committed file was stalehttp://, which browsers/GitHub won't render).Notes
make load(or a reload) for the running LDH to serve the new alignments.foaf:imgwin also applies toac:MapModeand the county detail page, so the coat of arms is now the consistent identity image everywhere.docker-compose.override.ymlhad a pre-existing local modification, intentionally left out of this PR.🤖 Generated with Claude Code