Property talk:P836

From Wikidata
Jump to navigation Jump to search

Documentation

GSS code (2011)
nine-character UK Government Statistical Service code, introduced in 2009 to replace older ONS codes
DescriptionUK Government Statistical Service code, a fixed length code of nine characters.
RepresentsONS coding system (Q2242955)
Data typeExternal identifier
Template parameteren:template:infobox settlement see Metropolitan Borough of Bolton infobox, shown in use there.
Domain
According to this template: place
According to statements in the property:
human-geographic territorial entity (Q15642541), development corporation (Q5266682) or Local Resilience Forum (Q6664240)
When possible, data should only be stored as statements
Allowed values([EWSN]92|E[0-5][0-9]|E6[0-8]|W[0-3][0-9]|W4[0-7]|S[0-3][0-9]|S4[0-5]|N[0-2][0-9]|N3[0-4]|J0[1-6]|K0[1-7]|L93|L00|M83|M0[0-1])0[0-9]{5} (9 characters: 3 alphanumeric, followed by "0", then 5 digits)
ExampleBolton (Q1364541)E08000001
Wales (Q25)W92000004
London Borough of Newham (Q208139)E09000025
Formatter URLhttps://statistics.data.gov.uk/atlas/resource?uri=http://statistics.data.gov.uk/id/statistical-geography/$1
Related to country United Kingdom (Q145) (See 326 others)
Lists
Proposal discussionProposal discussion
Current uses
Total22,644
Main statement22,33598.6% of uses
Qualifier3<0.1% of uses
Reference3061.4% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Format “([EWSN]92|E[0-5][0-9]|E6[0-8]|W[0-3][0-9]|W4[0-7]|S[0-3][0-9]|S4[0-5]|N[0-2][0-9]|N3[0-4]|J0[1-6]|K0[1-7]|L93|L00|M83|M0[0-1])0[0-9]{5}: value must be formatted using this pattern (PCRE syntax). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P836#Format, SPARQL
Distinct values: this property likely contains a value that is different from all other items. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P836#Unique value, SPARQL (every item), SPARQL (by value)
Single best value: this property generally contains a single value. If there are several, one would have preferred rank (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P836#single best value, SPARQL
Item “country (P17): United Kingdom (Q145): Items with this property should also have “country (P17): United Kingdom (Q145)”. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P836#Item P17, search, SPARQL
Allowed entity types are Wikibase item (Q29934200): the property may only be used on a certain entity type (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P836#Entity types
Scope is as main value (Q54828448), as reference (Q54828450): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P836#Scope, SPARQL

Please notify projects that use this property before big changes (renaming, deletion, merge with another property, etc.)


Change to url?[edit]

For a while I'd found that the url didn't work for this property (but I thought it may have been because I was working on welsh unitary authorities...). Recently I found that, for Vale of Glamorgan (Q844784), the url should be:

rather than:

Further investigation shows that "nmd" applies to non-metropolitan districts, "ua" - unitary authorities, and a number of others. See here for a list of the area types.

Is it possible to change the url based on data item? If not, make it less specific, like:

so that you can enter the appropriate qualifier, for example "ua/W06000014". Robevans123 (talk) 18:19, 1 October 2016 (UTC)[reply]

After a bit more research I noticed (from the opendatacomunities.org website) that "Administrative geography of England, Wales and Scotland, based on data from the Office for National Statistics", and a quick explore suggests that changing the url to:

giving, for Vale of Glamorgan (Q844784):

This has a number of advantages:

  • it shows more than the opendatacomunities.org (including a map and links to parent/children)
  • it doesn't need to be tailored to the type of administrative area being considered
  • it isn't limited by the gaps in opendatacomunities.org - coverage of the devolved areas of Northern Ireland, Scotland, and Wales isn't as deep as that of England (opendatacomunities.org is run by Department for Levelling Up, Housing and Communities (Q601819) which is primarily concerned with communities and local government in England) Robevans123 (talk) 19:41, 1 October 2016 (UTC)[reply]

Pinging @Danrok:. Hi there. After looking at the history of the property I see that you changed the formatter URL (P1630) back in May 2016. Was there a reason for this as it rather limits the property to only be useful for non-metropolitan districts? Robevans123 (talk) 08:59, 2 October 2016 (UTC)[reply]

Do you know of a URL which will currently work far all? Danrok (talk) 20:14, 2 October 2016 (UTC)[reply]
The one given above at statistics.data.gov.uk has worked on a number of number of samples. I've just done some random checks and it seems to work for counties, non-metropolitan districts, metropolitan districts, unitary authorities, london boroughs. Lower down it works for civil parishes/communities and electoral wards. It seems to work well across Scotland, Wales, and England. Seems to recognise gss codes for Northern Ireland, but doesn't show boundary data. Also shows UK/Welsh etc constituencies.
There are a few less common items like Police Force Area, Local Resilience Forum Area, Communities First Areas etc that are recognised but don't show any boundary data or sub-units...
The gss codes were developed for national statistics, so the statistics.data.gov.uk should be the best place to reference gss codes.
Did you have problems before to prompt the change? Robevans123 (talk) 21:14, 2 October 2016 (UTC)[reply]
@Robevans123: It's fine now. The problem was that they had stopped supporting that URL for some reason, but now it works again. Danrok (talk) 15:45, 10 October 2016 (UTC)[reply]

Development Corporations[edit]

I'm in the process of adding more of these organisations, such as the London Legacy Development Corporation which has the code E51000001. These codes are used by MHCLG's opendatacommunities.org as they act as local planning authorities, and appear in a number of statistical publications. Unfortunately the E51 codes give a (!) warning. I'm weary of changing the regex, so would like some help. Alternatively, are there any tests, and if not, where's the best place for me to contribute some? Psd (talk) 09:25, 26 October 2019 (UTC)[reply]

@Psd: Should be fixed by this: (diff). Jheald (talk) 14:12, 12 December 2019 (UTC)[reply]

Formatter URL no longer working?[edit]

I was looking at how the GSS code for Scotland works, and looking to implement standard codes for Scottish Health Boards, Health and Social Care Partnerships etc. Lists of 9-digit codes for each of these are available.

Checking Scotland I see that the formatter URL - http://statistics.data.gov.uk/doc/statistical-geography/S92000003] returns a 404 error http://statistics.data.gov.uk/atlas/resource?uri=http%3A%2F%2Fstatistics.data.gov.uk%2Fid%2Fstatistical-geography%2FS92000003&inactive=false.

The formatter URL itself http://statistics.data.gov.uk/doc/statistical-geography also seems to be no longer used.

I've had a look but I can't see an obvious new service to use for validation. Not my specialist area - suspect others will know better! :)

Watty62 (talk) 09:37, 13 September 2020 (UTC)[reply]

Visiting - as advised - the home page and searching for "S92000003" returns "no places", so that's unhelpful. For now https://web.archive.org/web/*/http://statistics.data.gov.uk/doc/statistical-geography/$1 will work in many cases, so I've appled that. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 10:02, 13 September 2020 (UTC)[reply]

Deprecating old codes[edit]

@Jheald: (I think this was your batch, apologies if not...). I've been trying to work out the deprecation of old codes here. For example, Aldershot (Q581697) has two GSS codes, E14000001 which was issued in 2009 and ran up to 5 May 2010, and thn E14000530 which is dated from 6 May 2010. The first is deprecated and marked as "withdrawn identifier value", the second is preferred.

However, the first one still resolves (though it is marked as "terminated"), and looking at w:en:Aldershot (UK Parliament constituency) it seems that what happened here is the old constituency was tweaked around a bit at the election, hence the need for a new code to reflect a new geographical reality.

I think in this circumstance - the old one is no longer in use, but isn't "wrong" per se, since it correctly described the entity during that period - the old code should be normal rank (though with an end date) and the new one preferred with no end date - or is there something I'm missing? Andrew Gray (talk) 21:41, 17 February 2021 (UTC)[reply]

@Andrew Gray: Sorry to be late in getting back to you. My ping list got longer than I could cope with!
In principle I would be happy either way, so long as the current value has a higher rank than the old one.
I think (though this should maybe be referred upwards somewhere, because I am not sure that everyone would agree) that there may be a difference in how ranks are used on external IDs, compared to how they are used on other statements . There may be issues as to when one wants a naive wdt: query to return something, and when one doesn't, if a code is no longer in the current set, perhaps because the item is no longer in the 'live' set for such codes. But I am not sure I'd say anything too firm in this area. Jheald (talk) 10:07, 17 March 2021 (UTC)[reply]
@Jheald I think 28 months may set a record for my having put off doing something, but finally sorting these out now:
  • all current values are preferred (or left as normal if there's only one)
  • all expired values are set to normal
729x constituency items have GSS codes (1220x distinct code claims) and all now return only one value with a simple wdt: query. (report)
I haven't yet removed the old "reason for deprecation" qualifiers but am considering if these should perhaps move to "end cause" or similar? Andrew Gray (talk) 18:06, 3 June 2023 (UTC)[reply]