Property talk:P772

Latest comment: 7 months ago by Olea in topic Do we really want postal code (P281)?

Documentation

INE municipality code
identifier for Spanish municipalities, by the Spanish Statistical Office (INE)
Descriptionmunicipality identifier by the National Institute of Statistics (INE) in Spain
Associated itemNational Statistics Institute (Q845937)
Data typeExternal identifier
Template parameter
Domain
According to this template: place - instances of administrative territorial entity of Spain (Q3183364)
According to statements in the property:
administrative territorial entity of Spain (Q3183364)
When possible, data should only be stored as statements
Allowed values(0[1-9]|[1-4][0-9]|5[0-2])(|\d{3}|\d{9})
ExampleChiclana de la Frontera (Q277302) → 11015
Almarail (Q2917693) → 42071000100
Teruel Province (Q54955) → 44
Sourcehttp://www.ine.es/daco/daco42/codmun/codmunmapa.htm
Tracking: sameno label (Q28605274)
Tracking: differencesno label (Q24194655)
Tracking: usageCategory:Pages using Wikidata property P772 (Q24194656)
Tracking: local yes, WD nono label (Q24194654)
Related to country  Spain (Q29) (See 145 others)
See alsoINE ID (Portugal) (P6324)
Lists
Proposal discussionProposal discussion
Current uses
Total16,760
Main statement16,71799.7% of uses
Qualifier350.2% of uses
Reference8<0.1% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Format “(0[1-9]|[1-4][0-9]|5[0-2])(|\d{3}|\d{5}|\d{9}): 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/P772#Format, SPARQL
Item “country (P17): Spain (Q29): Items with this property should also have “country (P17): Spain (Q29)”. (Help)
List of violations of this constraint: Database reports/Constraint violations/P772#Item P17, hourly updated report, search, SPARQL
Item “coordinate location (P625): Items with this property should also have “coordinate location (P625)”. (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/P772#Item P625, SPARQL
Single value: this property generally contains a single value. (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/P772#Single value, 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/P772#Unique value, SPARQL (every item), SPARQL (by value)
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/P772#Item P131, search, SPARQL
Type “administrative territorial entity of Spain (Q3183364): item must contain property “instance of (P31)” with classes “administrative territorial entity of Spain (Q3183364)” or their subclasses (defined using subclass of (P279)). (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/P772#Type Q3183364, SPARQL
Scope is as main value (Q54828448), as reference (Q54828450), as qualifier (Q54828449): the property must be used by specified way only (Help)
List of violations of this constraint: Database reports/Constraint violations/P772#Scope, hourly updated report, 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/P772#Entity types


Property:P772 format edit

The Property:P772 format is set to \d{5} but there are three types of valid formats: \d{2}, \d{5} and \d{11}. this "format" violations are correct. --Kizar (talk) 09:43, 24 August 2014 (UTC)Reply

Kizar I updated the regular expression (same edit as this one). On the next update run, the list should be a bit shorter. Multichill (talk) 10:00, 24 August 2014 (UTC)Reply
Thank u so much! --Kizar (talk) 10:30, 24 August 2014 (UTC)Reply
Let's see if it works first :-) Multichill (talk) 21:25, 24 August 2014 (UTC)Reply
Is this for municipality codes or just any INE code?
I don't think \d{2} is a valid format for municipalities. --- Jura 11:42, 17 November 2014 (UTC)Reply
See also Talk:Q17417920. It seems that the label in Spanish has a meaning different from that of other languages. --- Jura 11:27, 18 November 2014 (UTC)Reply

6 digits edit

In [1] the INE code has 6 digits: 2 (CPRO) + 3 (CMUN) + 1 (DC). This is different from the description that all INE codes have 2, 5 or 11 digits. Is the DC digit a checksum? --Pasleim (talk) 10:10, 18 August 2015 (UTC)Reply

Is P1566 restriction really needed? edit

We have some thousands elements without GeoNames ID (P1566). Now I wonder what's the need to be a mandatory constraint (Q21502408) for P772. I would consider to remove this restriction or, at least, to change as suggestion constraint (Q62026391). —Ismael Olea (talk) 18:56, 6 December 2021 (UTC)Reply

  Notified participants of WikiProject Spain, any opinion here? —Ismael Olea (talk) 10:15, 24 July 2023 (UTC)Reply
I guess it isn't. strakhov (talk) 15:40, 24 July 2023 (UTC)Reply
Sometimes there is no Geonames ID corresponding to the INE code. Davileci (talk) 10:38, 30 July 2023 (UTC)Reply
So, is it fine to remove the restriction at all? —Ismael Olea (talk) 09:25, 31 July 2023 (UTC)Reply
Yes, it is. Davileci (talk) 14:44, 31 July 2023 (UTC)Reply
Done. —Ismael Olea (talk) 08:47, 2 August 2023 (UTC)Reply

IneLink edit

local function ineLink ( id, link, parameter )
	-- representación especial del INE, enlace no estándar con cinco parámetros utilizados
	local ineMainRE, ineTailRE = '^(%d%d)(%d%d%d)', '(%d%d)(%d%d)(%d%d)'
	local codProv, codMuni, codEC, codES, codNUC = string.match( id, ineMainRE .. ineTailRE .. '$' )
	if not codEC or not codES or not codNUC then
		codProv, codMuni = string.match( id, ineMainRE .. '$' )
		if codProv and codMuni then
			codEC, codES, codNUC = '00', '00', '00'
		else
			codProv, codMuni = string.match( id, ineMainRE )
			codEC, codES, codNUC = '', '', ''
		end
	end
	if codProv and codMuni then
		link = 'http://www.ine.es/nomen2/inicio_a.do?accion=busquedaAvanzada&inicio=inicio_a&subaccion=&botonBusquedaAvanzada=Consultar+selecci%C3%B3n&numPag=0&ordenAnios=ASC&comunidad=00&entidad_amb=no&poblacion_amb=T&poblacion_op=%3D&poblacion_txt=&denominacion_op=like&denominacion_txt=&codProv=$1&codMuni=$2&codEC=$3&codES=$4&codNUC=$5'
		link = link:gsub('$1', codProv):gsub('$2', codMuni):gsub('$3', codEC):gsub('$4', codES):gsub('$5', codNUC)
		return generic( id, link, parameter )
	end
	return id
end

Davileci (talk) 08:16, 29 July 2022 (UTC)Reply

@Davileci: I do not know if this is an attempt to fix the link however I know it does not currently work. Maundwiki (talk) 14:22, 25 August 2022 (UTC)Reply
@Maundwiki: Yes, it is. At the Spanish Wikipedia it functions and I wonder why not at Wikidata. Davileci (talk) 15:40, 25 August 2022 (UTC)Reply
@Davileci: Ok, do I have to report the issue on wikidata? Maundwiki (talk) 15:46, 25 August 2022 (UTC)Reply
@Maundwiki: Yes, please. Thank you! Davileci (talk) 15:50, 25 August 2022 (UTC)Reply

This does not work at Wikidata: http://www.ine.es/nomen2/inicio_a.do?accion=busquedaAvanzada&inicio=inicio_a&subaccion=&botonBusquedaAvanzada=Consultar+selecci%C3%B3n&numPag=0&ordenAnios=ASC&comunidad=00&entidad_amb=no&poblacion_amb=T&poblacion_op=%3D&poblacion_txt=&denominacion_op=like&denominacion_txt=&codProv=42071000100&codMuni=$2&codEC=$3&codES=$4&codNUC=$5

However, this does work at Spanish Wikipedia: http://www.ine.es/nomen2/inicio_a.do?accion=busquedaAvanzada&inicio=inicio_a&subaccion=&botonBusquedaAvanzada=Consultar+selecci%C3%B3n&numPag=0&ordenAnios=ASC&comunidad=00&entidad_amb=no&poblacion_amb=T&poblacion_op=%3D&poblacion_txt=&denominacion_op=like&denominacion_txt=&codProv=42&codMuni=071&codEC=00&codES=01&codNUC=00 Davileci (talk) 15:45, 25 August 2022 (UTC)Reply

I've removed the formatter url. That link in es.wikipedia uses 5 different ID's. This can't work in Wikidata as far as I know. strakhov (talk) 15:42, 24 July 2023 (UTC)Reply
Thanks! —Ismael Olea (talk) 10:46, 25 July 2023 (UTC)Reply

Do we really want postal code (P281)? edit

Hi:

We had 5167 violations for the P281 property restriction. Checking in Geographic Nomenclature of Municipalities and Population Entities (Q95877977) there is no postal code column and now I can't remember any other database relating INE code with postal code. If we have this information the violations can be fixed. If not, well, I don't see the point using P281 as a restriction.

Any opinion against removing the postal code (P281) restriction?

  Notified participants of WikiProject Spain —Ismael Olea (talk) 09:36, 2 August 2023 (UTC)Reply

I removed it after waiting some weeks. FYI —Ismael Olea (talk) 11:55, 27 August 2023 (UTC)Reply
Return to "P772" page.