opensanctions / opensanctions/poliloom
Suppress redundant place-of-birth suggestions when a more precise location already exists
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Problem
PoliLoom sometimes suggests adding a place of birth (P19) that is a less-precise ancestor of a location already recorded on the politician's Wikidata entry. This creates noise for reviewers and risks adding a redundant statement.
Example: Jonathan Le Tocq (Q923245) has place of birth = Castel (Q2070272) on Wikidata. PoliLoom's enrichment extracted Guernsey as a birthplace from a source. Castel is administratively contained within Guernsey via Wikidata's P131 chain:
Castel (Q2070272) →P131→ Guernsey (Q12348376) →P131→ Bailiwick of Guernsey (Q25230)
The suggestion isn't wrong, but it's less precise than what's already there and would be a downgrade if accepted.
Proposed solution
Use Wikidata's P131 hierarchy — already available from the imported dump — to detect containment relationships between birthplace entities. When an extracted birthplace is an ancestor (via P131 transitive closure) of an already-recorded birthplace, suppress or flag the suggestion as redundant.
The check should handle both directions:
- Existing is more precise than suggestion (Castel → Guernsey): suppress the suggestion — it's a downgrade.
- Existing is less precise than suggestion (Guernsey → Castel): keep the suggestion — it's an improvement.
This is a pure Wikidata-data operation; no LLM call or scraping needed.
Caveats
- P131 coverage is not 100%. Broken chains (a missing P131 link anywhere in the hierarchy) will cause silent misses — the redundant suggestion slips through. This degrades gracefully (status quo is preserved), and coverage for ordinary populated places is good.
- Ambiguous chains. P131 can have multiple values or "applies to part" qualifiers. A depth limit and ignoring qualified statements would mitigate misfires.
- Country-level edges are inconsistent. The top of the P131 chain (country as direct P131 value) is the least reliable, but this only matters for birthplaces already recorded at country granularity.
Related
- #137 (exact-match dedup between extraction and import — complementary but doesn't cover hierarchy)
- #113 (duplicate citizenships — same category of "redundant property" problem)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by locating the imported Wikidata P131 hierarchy and the birthplace suggestion pipeline, then trace how existing and extracted locations are compared. Done means ancestor suggestions are suppressed only when the existing birthplace is more precise, while more precise extracted locations remain available, without an LLM call or scraping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100