Skip to content

Show coat of arms as AdminUnit depiction consistently (P94 → foaf:img)#18

Merged
namedgraph merged 1 commit into
masterfrom
fix/adminunit-coa-depiction
Jul 25, 2026
Merged

Show coat of arms as AdminUnit depiction consistently (P94 → foaf:img)#18
namedgraph merged 1 commit into
masterfrom
fix/adminunit-coa-depiction

Conversation

@namedgraph

Copy link
Copy Markdown
Member

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's ac:image thumbnail selector renders only the first in nondeterministic DESCRIBE order. The view's SELECT can't control it (it's DESCRIBE-wrapped).

Fix

Model the coat of arms on foaf:img instead of foaf:depiction. foaf:img is rdfs:subPropertyOf foaf:depiction ("particularly representative"), and LDH's ac:image ranks foaf: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 plain foaf:depiction (still shown on the entity's own page).

  • Coat of arms (P94) → foaf:img
  • Photo (P18) → foaf:depiction
  • Logo (P154) → schema:logo (unchanged)
  • Persons unaffected — no P94, so their portrait stays 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 (honoring Retry-After) at gentler concurrency → 518/518.

Data

Regenerated datasets/current/admin-units/alignments.trig:

  • 171 foaf:img (coats of arms) + 374 foaf:depiction (photos) = the same 545 images as before — nothing lost, just reclassified.
  • URLs normalized to https:// (the committed file was stale http://, which browsers/GitHub won't render).
  • Parses, round-trips base-independently, SHACL conforms.

Notes

  • Requires make load (or a reload) for the running LDH to serve the new alignments.
  • The foaf:img win also applies to ac:MapMode and the county detail page, so the coat of arms is now the consistent identity image everywhere.
  • docker-compose.override.yml had a pre-existing local modification, intentionally left out of this PR.

🤖 Generated with Claude Code

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>
@namedgraph
namedgraph merged commit ea9f7f7 into master Jul 25, 2026
4 checks passed
@namedgraph
namedgraph deleted the fix/adminunit-coa-depiction branch July 25, 2026 10:09
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