Jump to content

Wikidata:Requests for permissions/Bot/MamouriBot

MamouriBot (talk • contribs • new items • new lexemes • SUL • Block log • User rights log • User rights • xtools)
Operator: Mamouri (talk • contribs • logs) — I maintain the Persian Wikipedia settlement-population templates and modules that this data feeds, and I am familiar with the structure of the Statistical Center of Iran census releases.

Task/s: Add census demographics — population, male population, female population, and number of households — to existing Iranian settlement items identified by Iran statistics ID (P1010), from the Statistical Center of Iran censuses of 1385 (2006) and 1395 (2016).

Community request: This implements a request from the Persian Wikipedia community to show multi-census population data in Iranian settlement articles, sourced centrally from Wikidata so every project can reuse it (discussion on the Persian Wikipedia village pump).

Code: pywikibot-based; source will be published on request.

Function details:

The bot enriches items that already carry Iran statistics ID (P1010) (Iran statistics ID) — the settlement statistical code assigned by the Statistical Center of Iran (SCI). It does not create any items.

For each matched item, and for each census year (2006 and 2016), it adds whichever of the following statements are missing:

Every statement is qualified with point in time (P585) (point in time, year precision — 2006 or 2016) and determination method or standard (P459) = census (Q39825) (census), and carries a reference URL (P854) reference URL to the exact SCI source file. The most recent census (2016) is set to preferred rank.

Data source & licensing: official SCI census releases (amar.org.ir), "Households and Population by Village/Settlement". These are factual numeric counts (not creative works) and are therefore compatible with Wikidata's CC0 requirement.

Scope: a WDQS query for Iran statistics ID (P1010) returns 17,602 items; 17,586 (99.9%) match a settlement present in the census data. Realistic target ≈ 16,000 items and up to ~125,000 statements after skipping unavailable values.

Safeguards:

  • Idempotent. The bot reads each item's existing statements first and adds only a (property, year) that is missing. If a value already exists for that year but differs from the census, the bot skips it and logs it for manual review — it never overwrites existing data.
  • No fabricated values. Settlements whose value SCI privacy-suppresses (≤3 households, marked "*") are skipped; no number is published for them.
  • Verification. A post-run pass reads every edited item back and asserts the stored values equal the source dataset, producing a mismatch report.
  • Emergency stop: User:MamouriBot/Stop.

Edit rate: throttled (about 1 edit/second, adjustable to community preference). I am happy to run a trial of any size the community requests before the full run.

--Mamouri (talk) 11:21, 23 September 2026 (UTC)reply

Please make a few dozens test edits Ymblanter (talk) 18:59, 29 September 2026 (UTC)reply
@Ymblanter Trial complete. Thank you. I have made a trial run of 40 items in one province (Kerman): 230 statements in total — population (P1082), number of households (P1538), female population (P1539) and male population (P1540) for each of the 1385 (2006) and 1395 (2016) censuses. Every statement is qualified with point in time (P585) (point in time, year precision) + determination method or standard (P459) = census (Q39825) and carries a reference URL (P854) reference to the Statistical Center of Iran source, with the 1395 values set to preferred rank. The run was idempotent — it reads each item's existing statements first and adds only what is missing (0 conflicts on this batch; it never overwrites an existing value) — and a post-run verification pass read every edited item back and confirmed all stored values match the source dataset. The diffs are at Special:Contributions/MamouriBot. I'm happy to run a larger trial or adjust anything you'd like. Mamouri (talk) 00:47, 2 October 2026 (UTC)reply
Thank you, this is good enough for me. I will approve the bot in a couple of days provided no objections have been raised. Ymblanter (talk) 18:50, 3 October 2026 (UTC)reply