opensanctions / opensanctions/poliloom
Importer creates duplicate citizenship properties for same country with different time periods
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Problem
The importer creates multiple citizenship properties for the same politician-country combination when Wikidata has multiple statements with different start/end time qualifiers. This results in 30 duplicate entries in our database.
Examples
- Edward Leung (Q22094633) - 2x China (Q148)
- Anne Hidalgo (Q2851133) - 2x Spain (Q29)
- George Weah (Q173139) - 2x France (Q142)
- Ricky Martin (Q128799) - 2x Puerto Rico (Q1183)
San Marino (Q238) is particularly affected with 7 politicians having duplicate citizenships.
Expected Behavior
We should only store one citizenship property per politician-country combination. The time period qualifiers (start/end dates) are not relevant for our use case.
Suggested Fix
During import, deduplicate citizenship statements by (politician_id, entity_id) - only import the first one encountered or the one without time qualifiers.
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
Start at the importer code that processes Wikidata citizenship statements and reproduce the duplicate cases listed in the issue. Ensure the import keeps one citizenship per politician-country pair regardless of time qualifiers, then verify that the affected examples no longer create duplicate database entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100