Skip to content

Cross-domain links: registered offices → municipalities, counties → NUTS3, MPs → constituencies - #10

Merged
namedgraph merged 1 commit into
masterfrom
cross-domain-links
Jul 24, 2026
Merged

Cross-domain links: registered offices → municipalities, counties → NUTS3, MPs → constituencies#10
namedgraph merged 1 commit into
masterfrom
cross-domain-links

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Summary

Connects the three previously-disjoint entity islands (admin units, legal entities, Seimas) with deterministic, re-runnable ETL that pulls the join keys from live open-data sources — no hand-authored CSVs. Closes three items from the ONTOLOGY-NOTES backlog (registered office → municipality, NUTS/LAU exactMatch, Seimas constituency).

Legal entity → administrative unit (registered office)

JuridinisAsmuo carries no usable address, so the office resolves JAR Buveine (ja_kodas → aob_kodas) ⋈ AR Pastatas (aob_kodas → savivaldybe.sav_kodas + pasto_kodas) on aob_kodas, keeping the latest office. Modelled as the SEMIC chain org:hasRegisteredSite → org:Site → org:siteAddress → locn:Address, with locn:adminUnit → admin-units/{sav}/#this (committed primary) and locn:postCode. Postcode is an attribute, not a join key — the exact aob_kodas → sav_kodas beats the not-guaranteed-1:1 postcode→municipality. Adds Buveine/Pastatas fetches + institution-scoped awk narrowing, org:Site/locn:Address SHACL shapes, and the :OrganizationsHere inverse view.

County → NUTS3

reconcile.py emits skos:exactMatch → data.europa.eu/nuts/code/LT0xx from Wikidata P605 — a couple of extra columns in the existing WDQS enrichment (10 counties; municipalities are LAU, no P605, and inherit NUTS3 via their county).

MP → electoral constituency (apygarda)

Parses the 71 single-member districts from the members feed (isrinkimo_budas) into a new constituencies/{nr}/ container (ltlod:ElectoralDistrict); the single-member seat tenure links via ltlod:electoralDistrict. An apygarda is not an administrative unit — own container, no dct:isPartOf into admin-units/. Party-list ("Pagal sąrašą") seats have none. New container doc, SHACL shape, :MembersElectedHere view.

Verification

  • Gap A — mapping tested on a 3-entity fixture (latest-office selection; the no-Pastatas fallback degrades cleanly); SHACL conforms; both Makefiles dry-run clean.
  • Gap C — run live: exactly 10 counties get NUTS3 (LT011–LT029), 642 existing matches unchanged.
  • Gap B — run on the cached feed: 71 district graphs, 74 MP links (party-list correctly excluded), 0 dangling references, SHACL conforms.
  • Both new example queries run correctly on sample data; all changed .ttl/.rq/.py syntax-checked.

Not included

Committed datasets/current/ snapshots are not regenerated in this PR — that mixes in heavy national Buveine/Pastatas fetches (offices), unrelated Wikidata image drift (NUTS), and nondeterministic arq ordering. Materialize the data with:

make -C etl BASE=https://linkeddata.lt/

🤖 Generated with Claude Code

Bridge the previously-disjoint entity domains with re-runnable ETL that
pulls the join keys from live sources (no hand-authored CSVs):

- Legal entity -> administrative unit: resolve the registered office via
  JAR Buveine (ja_kodas -> aob_kodas) joined to AR Pastatas (aob_kodas ->
  savivaldybe.sav_kodas + pasto_kodas) on aob_kodas, keeping the latest
  office; model it as the SEMIC chain org:hasRegisteredSite -> org:Site ->
  org:siteAddress -> locn:Address, with locn:adminUnit -> admin-units/{sav}/
  #this and locn:postCode. New Buveine/Pastatas fetches + institution-scoped
  join in legal-entities/Makefile; org:Site/locn:Address SHACL shapes;
  :OrganizationsHere inverse view.

- County -> NUTS3: reconcile.py emits skos:exactMatch ->
  data.europa.eu/nuts/code/LT0xx from Wikidata P605 (counties only;
  municipalities are LAU and inherit via county).

- MP -> electoral constituency: parse the 71 single-member apygardos from
  the members feed (isrinkimo_budas) into a new constituencies/{nr}/
  container (ltlod:ElectoralDistrict); persons.rq links the seat tenure via
  ltlod:electoralDistrict. An apygarda is not an admin unit. New container
  doc, SHACL shape, :MembersElectedHere view.

Docs (URI-SCHEME, ONTOLOGY-NOTES, README) updated and three backlog items
resolved; two cross-domain example queries added.

Pipeline code only -- committed datasets/current/ snapshots are not
regenerated here; run `make -C etl BASE=https://linkeddata.lt/` to materialize.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@namedgraph
namedgraph merged commit da61217 into master Jul 24, 2026
4 checks passed
@namedgraph
namedgraph deleted the cross-domain-links branch July 24, 2026 23:25
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