Changes and fixes to this module have been made (in part) in association with a proposed upgrade of the Infobox template. Therefore some changes are only relevent if particular parts of that upgrade are implemented.
Examples and testcases for the changes documented here are at Infobox template upgrade population testcases.
The new version makes a significant change to the behaviour of the module regarding how it displays population figures if they are available for a number of different geographies, ie: if they are available in the linked Wikidata item for more than one of Urban Centres and Localities (UCL), Suburbs and Localities (SAL) and Indigenous Communities (ILOC).
Having gathered a list of all Wikidata population claims that meet certain criteria, then reduced that list to the latest claim for each geography, the logic in the current version is:
This means that, if a claim for the preferred geography exists, no claims for any other geography are ever returned.
The suggestion to show multiple population figures has been made in a number of forums (eg: at the module talk page and at the infobox talk page). On the other hand there has started to be use of the module outside the Infobox, for tables of suburbs in LGAs (see City_of_Rockingham, Town_of_Katherine), where showing the population for the wrong geography, or for multiple geographies, would seem to be undesirable.
There are a number of possible solutions for making available options to show populations for either (a) multiple geographies if they are available, or (b) a single specific geography:
Option 2 has been implemented in the new version of function ListForInfobox. When almost all calls to the module are for the Infobox, and that context should show all available geographies, that should become the default behaviour. (Others have suggested this, and I support it.) The (currently small) number of calls wanting a single geography - for showing populations outside the infobox - can be changed to use the new function LatestPopulation, which always requires a geography to be set (see below).
Having gathered a list of all Wikidata population claims that meet certain criteria, then reduced that list to the latest claim for each geography, the logic in the new version is:
Issue | Suggested at | Comments | |
---|---|---|---|
integrated citation references | next steps module talk 1, also module talk 2 | When a population is retrieved for article text, as well as in the infobox, the current version produces separate references to the same source. In the new version, links for the same claim in Wikidata now combine into the same citation reference. The existing version constructed a correct name for the references, but did not pass that name correctly to the citation reference process. | |
fix for merged claims in wikidata | , also | When two census uploads for the same place (but different dates) had the same value (population number), the two claims were merged in wikidata, and incorrect references could be returned. The module now recognises a claim with two point-in-time qualifiers, and splits it (internally) into two normal claims with valid references. | |
latest population | New function, called by <nowiki>{{#invoke:PopulationFromWikidata|LatestPopulation}}</nowiki> , returns the latest population figure for the requsted geography. Always returns the population figure with the reference, but with options to also show the year, and to put supplied text (usually a full stop) between the other returned text and the reference. Intended for use in the text of articles.|-| historic populations| next steps| New function, called by <nowiki>{{#invoke:PopulationFromWikidata|HistoricPopulations}}</nowiki> , returns a table of population figures for all years where census data is in wikidata. By default it has columns for each of the specified geographies (for the | type) that have any population data. can be specified, to return only population figures for that geography. | |
no output for some values | next steps | If or, the new version explicitly returns blank output. It also returns blank if is not recognised. | |
links to explanations of ABS geographic units | next steps | The geographic unit abbreviation is now a link to the Australian Bureau of Statistics article, and a specific anchor for the explanation of the unit. | |
census link linkrot | For census data for 2016 and earlier, data uploaded to Wikidata has reference URLs that are no longer valid. The module now uses eg: to produce a citation reference with the correct URL. For claims in Wikidata that are not from census data, the existing reference URL is used as-is. | ||
new values | New values have been suggested for the infobox, and implemented in the proposed upgrade. The new version of PopulationFromWikidata recognises these values as valid, and allocates one or more ABS geographies to them.
|
Issue | Suggested at | Comments | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
calculate population densities | next steps | Suggestion was to automatically calculate densities from Wikidata information. What will be needed in each area claim is an 'applies to part' property that matches the population claim, and these area claims will need to be kept up-to-date after each census. | |||||||||||||||||
indigenous communty populations | next steps | The initial suggestion was to get ABS ILOC IDs into Wikidata items, as the first step to uploading ILOC census data. The new version of this module will accept, if that is the preferred geography for populations. | |||||||||||||||||
next steps | The current version prefers lga census data for regions, suggestion is SA3 populations may be better. There are 167 articles with in the infobox. It is not yet investigated what populations currently appear in the infobox for these articles. | ||||||||||||||||||
ABS data issue | next steps | Possible differences occur between ABS datapacks (the source for data uploaded to Wikidata) and Quickstats (which reference URLs link to), especially for places with very low populations. This means a link to Quickstats may not support the stated population value. This seems to be an issue that needs to be taken up with the ABS. | |||||||||||||||||
Create template | Is creating a template that calls this module worth doing?
|} Reason for the moduleThe aim is to make it easier to keep population values (and associated references) up-to-date in Australian place article Infoboxes. This module looks at population claims in a linked Wikidata item and filters for the latest and most appropriate population value. It extracts this value, along with all referencing information, and gives this to the article Infobox. Who made the moduleWikimedia Australia designed this project to coincide with the first release of the 2021 census data (in June 2022). This module was created as part of a funded project with work done by in collaboration with (really...HUGE amounts of help from), and . The project was coordinated by . It is an ongoing project and we will continue to refine the module. Of course anyone is welcome to contribute! Head to the page if you have anything to discuss. We wrote a summary of the project for the Wikimedia Australia blog here. What the module doesPopulation sourcesThe module is designed to be invoked from the Infobox Australian place template and gathers data from the Wikidata item linked to each article. The module may be modified and used in other places/cases in the future. Currently, this module is invoked in such a way that it will only give the Infobox a population figure if one isn't manually given for the Infobox Australian place pop argument. This means that initially the module will not impact many articles. Over time, once we're certain it is working well, we can remove the manually added population figures in favour of the Wikidata figures brought in by the module. See line 110 of the Infobox Australian place template for the module invoke. How to see the module in actionCurrently the module will only give a population figure to the Infobox if one has not been manually added via the Infobox Australian place template pop field. This means if you want to see the module in action for a particular place article, you should follow these steps:
Here's an example of an article with Infobox using the module, and the diff of the edit made. The list of articles using population values from Wikidata (via this module) is here. AssumptionsThe module works with the following assumptions:
Population selectionThe high level steps of the module work flow are decribed below. There are three major steps in the process of selecting the population figure to return. Step 1. Check which population claims have enough information to be consideredAs a minimum they are required to have:
After filtering for these requirements a subset of population claims is carried forward. Step 2. Check which population claims have the most recent figures for each geographyCheck within the list of claims and find the most recent population figure for each applies to part value, ie: for each applies to part value (UCL, SAL etc) we find the claim with the latest point in time value (2016, 2011 etc). Step 3. Specify the geography types that can be returned for each place typeIf a geography is specified in the parameter, only the latest population for that geography will be returned. If the parameter is not specified, the possible geographies for the provided are:
Compile the module output, using only latest claims in specified geographiesFor all possible geographies, the latest claims found will be returned. If there is only one matching claim, it is simply output: 100 (UCL 2021)[1] If there is more than one claim, they are output as a bulleted list:
ReferencesThe references for actual census data are formatted using the census template for the appropriate year, eg: Census 2021 AUS. All other references use the Cite web template. The census population figure references take this form:Australian Bureau of Statistics (28 June 2022). "Cosmo Newberry (Indigenous Location)". 2021 Census QuickStats. Retrieved 28 June 2022. The non-census derived population figure references take this form:Australian Bureau of Statistics (29 March 2022). "Population estimates by SA2 and above, 2001 to 2021 (Greater Capital City Statistical Areas)". Australian Regional Population. Retrieved 28 June 2022. The references are named: name = refwork .. "_" .. year .. "_" .. appliespart .. "_" .. reftitle. This is long-winded because we are aiming for a unique reference name for each population claim. Example outputsThere are some example outputs in the Infobox Australian place Sandbox Test Cases page here. What it doesn't do - next stepsThere are some issues that we are aware of, have considered but haven't dealt with yet. These will be tackled in time in collaboration with other place article contributors. (No doubt there are many more to add to the list - please do).
Done. The links are to an ASGS section in Australian Bureau of Statistics.
What if the outputs are incorrectAll the references produced by this module are followed by an Edit at Wikidata pencil icon which links to the relevant Wikidata item (and specific population claim). This is where people should go to fix any errors in the population figure outputs or references. See next section for lists of what should ideally be included in a Wikidata population claim. Population data in WikidataWikipedia - Wikidata linksIn parallel to development of this module and have been working on ensuring all Australian place Wikipedia articles are linked to corresponding Wikidata items (describing that same place). This has largely been done. This enables the use of this module. Census dataPopulation data has historically been manually entered to individual Wikidata items. Recently (since ~2017), and others have used QuickStatements to do bulk imports of population data from Australian Bureau of Statistics datasets. Part of developing this module was to refine the list of metadata (qualifiers and reference fields) that should be imported alongside the population values. As at July 2022 the first release of the 2021 census population data has been uploaded for the geographic areas relevant to Australian place Infoboxes. This includes data for Suburbs and Localities (SAL), Indigenous Locations (ILOC) and Local Government Areas (LGA). The Urban Centres and Localities (UCL) data is due to be released in October 2022. The module requires these qualifiers and reference components to have values in the Wikidata population claim.
An example of a Wikidata item with a correctly filled 2021 population claim (using Census data) is:. Non-census dataBulk uploads have been done for census data. They have not been done for between-census estimated residential population (ERP) or Data by Region figures, for example. These estimates are useful for capital cities, LGAs and regions. The module requires that non-census population claims have these components:
An example of a Wikidata item with a correctly filled 2021 estimated resident population claim (not the other population claims) is:. An example of a Wikidata item with a correctly filled 2020 LGA Data by Region population claim (not the other population claims) is:. UsageThe module exposes three functions. ListForInfobox(type, wikidata, geog)
Parameters:
LatestPopulation(geog, wikidata, year, punc)
Parameters:
HistoricPopulations(type, wikidata, geog)
Returns a table of census populations by year and ABS geography. Parameters:
|