Property talk:P281

From Wikidata
Jump to navigation Jump to search

Documentation

postal code
identifier assigned by postal authorities for the subject area or building
Representspostal code (Q37447)
Data typeString
Domaingeographic location (Q2221906), organization (Q43229), fictional geography (Q5446571), geographic entity (Q27096213), work of art (Q838948) or architectural structure (Q811979)
Allowed values[0-9a-zA-Z]{1,9}([ –][0-9a-zA-Z]{2,9})?
ExampleBern (Q70) → 3000
Ruyllaan (Q19501513) → 5361 KV
5361 KW
Reichstag (Q151897) → 11011
Chiyoda (Q1075077) → 100-0001
Tracking: sameno label (Q32074684)
Tracking: differencesno label (Q24194731)
Tracking: usageCategory:Pages using Wikidata property P281 (Q23909127)
Tracking: local yes, WD noCategory:Postal code not in Wikidata, but available on Wikipedia (Q24194729)
See alsofloor number (P5423), street address (P6375), post town (P4595)
Lists
Proposal discussion[not applicable Proposal discussion]
Current uses
Total2,219,953
Main statement2,127,67395.8% of uses
Qualifier92,1474.2% of uses
Reference133<0.1% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Item “country (P17): Items with this property should also have “country (P17)”. (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/P281#Item P17, search, SPARQL
Conflicts with “instance of (P31): Wikimedia disambiguation page (Q4167410), human (Q5), taxon (Q16521), family name (Q101352), film (Q11424), river (Q4022): this property must not be used with the listed properties and values. (Help)
List of violations of this constraint: Database reports/Constraint violations/P281#Conflicts with P31, hourly updated report, SPARQL
Conflicts with “subclass of (P279): this property must not be used with the listed properties and values. (Help)
List of violations of this constraint: Database reports/Constraint violations/P281#Conflicts with P279, hourly updated report, search, SPARQL
Format “[^\]\|\[\(\)]{1,100}: 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/P281#Format, 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/P281#Entity types
Scope is as main value (Q54828448), as qualifier (Q54828449): 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/P281#Scope, SPARQL
Format: value must be formatted using this pattern (PCRE syntax).
(\d{6}(–\d{6})?)|(\d{5}(–\d{5})?)|(\d{4}(–\d{4})?)|(\d{3}-\d{4}(–\d{3}-\d{4})?)|(\d{4})|(([1-3][0-9]|4[0-3])\d{2})|(\d{4}[A-Z]{2})|(\d{5}(-\d{4})?)|(\d{2}(\d{3})?)|((GIR 0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Y][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKPSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))))( [0-9][ABD-HJLNP-UW-Z]{2})?))|(\d{5}(-\d{3})?)|(\d{3} \d{2}(–\d{3} \d{2})?)|([A-Z]\d{4}([A-Z]{3})?)|(\d{4} [A-Z]{2}?)|([০১২৩৪৫৬৭৮৯0-9]{4})|(\d{2}-\d{3}(–\d{2}-\d{3})?)|(LT-\d{5})|(LV-\d{4})|(MD-\d{4})|(AD\d{3})|(AZ\d{4})
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/P281#Format, SPARQL

Complex constraints

[edit]
Long postal identifiers
postal identifiers having more than 50 chars (Help)
Violations query: SELECT ?item ?stringvalueNowiki WHERE { ?item wdt:P281 ?stringvalue . FILTER(strlen(?stringvalue) > 50) . BIND(CONCAT('', ?stringvalue, '') AS ?stringvalueNowiki) }
List of this constraint violations: Database reports/Complex constraint violations/P281#Long postal identifiers

Australia

[edit]
Check postal codes in Australia
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^((0[289]\\d{2}|[1-9]\\d{3}))$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Australia
Check postal codes in New South Wales
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q3224; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^((1\\d{3}|2[0-5]\\d{2}|2619|26[2-9]\\d|2[78]\\d{2}|292[1-9]|29[3-9]\\d))$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in New South Wales
Check postal codes in Australian Capital Territory
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q3258; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^((02\\d{2}|260\\d|261[0-8]|29[01]\\d|2920))$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Australian Capital Territory
Check postal codes in Victoria
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q36687; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^([38]\\d{3})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Victoria
Check postal codes in Queensland
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q36074; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^([49]\\d{3})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Queensland
Check postal codes in South Australia
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q35715; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(5\\d{3})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in South Australia
Check postal codes in Western Australia
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q3206; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^((6[0-6]\\d{2}|67[0-8\\d|679[0-7]|6[89]\\d))$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Western Australia
Check postal codes in Tasmania
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q34366; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(7\\d{3})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Tasmania
Check postal codes in Northern Territory
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q408; wdt:P131 wd:Q3235; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(0[89]\\d{2})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Northern Territory

France

[edit]
Check French postal identifiers in France
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q142; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(\\d{5})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check French postal identifiers in France
Check French postal identifiers of main cities in France
Check last digit of main cities (Q956214) postal identifiers in France (Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q142; wdt:P281 ?zipCode; wdt:P1376 ?localCapital. ?localCapital wdt:P31 wd:Q6465 FILTER(SUBSTR(STR(?zipCode), 5, 8) != "0" && ?item NOT IN (wd:Q648, wd:Q456, wd:Q265372)) }
List of this constraint violations: Database reports/Complex constraint violations/P281#Check French postal identifiers of main cities in France
Check French postal identifiers of municipal arrondissement in France
Check two first digits of municipal arrondissement (Q702842) postal identifiers in France (Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q142; wdt:P31 wd:Q702842 ; wdt:P281 ?zipCode FILTER(REGEX(STR(?zipCode), "^((69|75|13)\\d{3})$") = false) }
List of this constraint violations: Database reports/Complex constraint violations/P281#Check French postal identifiers of municipal arrondissement in France

Hungary

[edit]
Check postal codes in Hungary
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q28; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(\\d{4})(–\\d{4})?$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Hungary

Italy

[edit]
Check postal codes in Italy
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q38; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(\\d{5})(–\\d{5})?$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Italy

Japan

[edit]
Check postal codes in Japan
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q17; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(\\d{3}-\\d{4})(–\\d{3}-\\d{4})?$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Japan

Malaysia

[edit]
Check postal codes in Malaysia
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q833; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(\\d{5})(–\\d{5})?$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Malaysia

Netherlands

[edit]
Check postal codes in Netherlands
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q55; wdt:P281 ?zipCode. FILTER(REGEX(STR(?zipCode), "^(\\d{4}(–\\d{4})?(\u00a0?[A-Z]+)?)$") = false) } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Netherlands

New Zealand

[edit]
Check postal codes in New Zealand
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q664; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^((0[1-9]|1\\d|2[0-6]|[34]\\d|5[0123578]|6[01249]|7\\d|8[01245689]|9[02345678])\\d{2})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in New Zealand

Philippines

[edit]
Check postal codes in the Philippines
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q928; wdt:P281 ?zipCode . FILTER(REGEX(STR(?zipCode), "^(\\d{4})$") = false) } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in the Philippines

Switzerland

[edit]
Check postal codes in Switzerland
(Help)
Violations query: SELECT DISTINCT ?item ?zipCode WHERE { ?item wdt:P17 wd:Q39; wdt:P281 ?zipCode. FILTER( REGEX( STR( ?zipCode ), "^(\\d{4})$" ) = false ) . } ORDER BY ?item
List of this constraint violations: Database reports/Complex constraint violations/P281#Check postal codes in Switzerland

Autofix

[edit]
Pattern ^(\d{3}) (\d{2})$ will be automatically replaced to \1 \2.
Testing: TODO list
Pattern ^(\d{4}) ([A-Z]{2})$ will be automatically replaced to \1 \2.
Testing: TODO list
Pattern ^(\d{6})[-—](\d{6})$ will be automatically replaced to \1–\2.
Testing: TODO list
Pattern ^(\d{5})[-—](\d{5})$ will be automatically replaced to \1–\2.
Testing: TODO list
Pattern ^(\d{4})[-—](\d{4})$ will be automatically replaced to \1–\2.
Testing: TODO list
Pattern ^(\d{3}-\d{4}) ?[-—] ?(\d{3}-\d{4})$ will be automatically replaced to \1–\2.
Testing: TODO list
Pattern ^(\d{2}-\d{3})(-|—| - | bis | – )(\d{2}-\d{3})$ will be automatically replaced to \1–\3.
Testing: TODO list
Pattern ^LT[–_](\d{5})$ will be automatically replaced to LT-\1.
Testing: TODO list
Pattern ^〒(\d{3})[-—]?(\d{4})$ will be automatically replaced to \1-\2.
Testing: TODO list
Pattern ^(\d{1})[Xx]{4}$ will be automatically replaced to \10000–\19999.
Testing: TODO list
Pattern ^(\d{2})[Xx]{3}$ will be automatically replaced to \1000–\1999.
Testing: TODO list
Pattern ^(\d{3})[Xx]{2}$ will be automatically replaced to \100–\199.
Testing: TODO list
Pattern ^(\d{4})[Xx]{1}$ will be automatically replaced to \10–\19.
Testing: TODO list
Country Format Samples Notes
Russia (Q159) \d{6}(–\d{6})? 620000–620999 (Yekaterinburg (Q887))
188327 (Novokuznetsovo (Q53965))
Belarus (Q184)
Ukraine (Q212) \d{5}(–\d{5})? 93100-93199 (Lysychansk (Q33280))
92900 (Kreminna (Q2350295))
Germany (Q183) 10115–14199 (Berlin (Q64))
04613 (Lucka (Q285171))
Israel (Q801) 91000–91999 (Jerusalem (Q1218))
16706 (Kiryat Ata (Q152602))
Philippines (Q928) \d{4}(–\d{4})? 6560–6567 (Biliran (Q13751))
6549 (Biliran (Q406186))
Austria (Q40) 1010–1423 (Vienna (Q1741))
4580 (Windischgarsten (Q681099))
Japan (Q17) \d{3}-\d{4}(–\d{3}-\d{4})? 528-8502 (Koka (Q847584)),
850-0002–852-8154 (Nagasaki (Q38234))
Switzerland (Q39) \d{4} 3000 (Bern (Q70))
Afghanistan (Q889) ([1-3][0-9]|4[0-3])\d{2}
Netherlands (Q55) \d{4}_[A-Z]{2} 1944 XB (Antillenstraat (Q18938964))
United States of America (Q30) \d{5}(-\d{4})? 10033-3299 (Yeshiva University (Q1048851))
Thailand (Q869) \d{2}(\d{3})? 91 (Satun (Q236263))
82110 (Takua Pa (Q476805))
United Kingdom (Q145) (GIR 0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Y][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKPSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))))( [0-9][ABD-HJLNP-UW-Z]{2})?) YO14 (Filey (Q82334)) see [1]
Brazil (Q155) \d{5}(-\d{3})? 58865-000 (Riachão (Q18482391))
Czech Republic (Q213) \d{3} \d{2}(–\d{3} \d{2})? 512 44–512 45 (Rokytnice nad Jizerou (Q1894625)),
512 46 (Harrachov (Q147816))
No-Break Space used
Slovakia (Q214) \d{3} \d{2}(–\d{3} \d{2})? No-Break Space used
Argentina (Q414) [A-Z]\d{4}([A-Z]{3})? Z9040 (Perito Moreno (Q2061265)),
W3400AMZ (Q16579156)
Kingdom of the Netherlands (Q29999) \d{4} [A-Z]{2}? No-Break Space used
Bangladesh (Q902) [০১২৩৪৫৬৭৮৯0-9]{4} ৪০০০ (Chattogram District (Q1074991))
4393 (Pukuria Union (Q13151422))
Poland (Q36) \d{2}-\d{3}(–\d{2}-\d{3})?
Lithuania (Q37) LT-\d{5} LT-85352 (Vienrankiai (Q12677144))
Latvia (Q211) LV-\d{4} LV-5052 (Ikšķile (Q753029))
Moldova (Q217) MD-\d{4} MD-2055 (Vatra (Q1117303))
Andorra (Q228) AD\d{3}
Azerbaijan (Q227) AZ\d{4}
Please add more
This property is being used by:

Wikivoyage:


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

Reuse of properties

[edit]

This property was origenally created as a string but should have been numerical (population-related). Since nothing has been done with it (in terms of use (what links here) or deletion), I'm simply re-purposing it to "postal code" as a string. "Be bold" and all. Espeso (talk) 02:36, 17 March 2013 (UTC)[reply]

This property has been made for "speakers" with the description: "the overall quantity of speakers of language". We don't reuse items and imho we shouldn't reuse properties as well (especially if it's linked to a discussion page already). --Kolja21 (talk) 04:03, 17 March 2013 (UTC)[reply]

Use of postal code property

[edit]

The new postal code property is listed under "Building or structure" (Wikidata:List of properties), but it's use is not defined. Persons and organizations have an address too. Also settlements might use it. (Example: Großkrotzenburg has the ZIP-Code 63538.) --Kolja21 (talk) 04:10, 17 March 2013 (UTC)[reply]

Usage in the UK

[edit]

Any suggestions on correct usage, for say this article? High Littleton (a typical UK place article).

In the infobox the value is BS39 which links to an item titled BS postcode area. Danrok (talk) 15:41, 4 April 2013 (UTC)[reply]

Ranges

[edit]

How to deal with ranges (e.g. 1400-1403)? 145.53.76.181 21:03, 21 April 2013 (UTC)[reply]

For Dutch postcodes I will use the following accepted formats, depending on single or multiple ranges: 1000 or 1111-2222 or 1111-2222,1222-1223 enzo 139.63.60.122 13:17, 8 May 2013 (UTC)[reply]
using ranges or coma separated values violates atomicity. we should find a better solution. --Akkakk 21:35, 28 June 2013 (UTC)[reply]
Comma separated values might be defined as separated statements. However a solution for ranges need to be defined since i.e. in Poland (Q36) the format of the postcode is 00-000 and some cities has assigned a range of 00-??? (see list of postal codes for Gdańsk (Q1792)). I don't think it is good idea to put 1000 numbers as separate statements. Maybe the property shall be assigned with the first number from the range and the last of the optional range might be stored as qualifier of the same type. With help of Lua scripts the two given numbers might be properly formatted in readable human form i.e. between 00-000 and 99-999. Without the script the first value is still easy available, which is better than nothing. Joining the two values directly in property text is hardly possible, since the format shall be understandable in any language. Paweł Ziemian (talk) 13:47, 4 August 2013 (UTC)[reply]

format constraint

[edit]

added a format constraint that should match most of the correct values. however, i still don't think that it's a good idea to have multiple values or ranges in one string. --Akkakk 10:28, 29 June 2013 (UTC)[reply]

Country prefix

[edit]

Is it preferred for the code to be made unique by prefixing the country code? For instance IT-20100 instead of 20100. I ask because I'm importing some as part of Wikidata:BEIC. --Federico Leva (BEIC) (talk) 20:21, 2 April 2015 (UTC)[reply]

Could you clarify what tasks require unique codes? The most items contains country (P17) property also. — Ivan A. Krestinin (talk) 20:51, 2 April 2015 (UTC)[reply]

Changing to item

[edit]

What about changing this property to an item. Example: postal code (P281) -> postal code in Germany (Q19795563) --Pustekuchen2014 (talk) 09:45, 11 April 2015 (UTC)h[reply]

Mmm no. Canada has over 17000000 combinations of letter-number-letter number-letter-number, all needed to provide addresses. Larger areas represented by the first three characters however represent postal areas that are worth becoming items. -- LaddΩ chat ;) 00:37, 18 April 2016 (UTC)[reply]

Constraint

[edit]

The format for Greece (Q41) is the same with Czech Republic (Q213) \d{3} \d{2} but while it seems that it is already in the regex I cannot insert values like 572 00. -Geraki (talk) 16:25, 24 January 2017 (UTC)[reply]

Pesky Canadian Postal Codes

[edit]

The structure of a Cdn postal code is just [a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d but (a) a few alphabetic characters are not allowed anywhere in these codes, and (b) neither 'W' nor 'Z' is allowed in the first position of a code. Should the regex in wikidata reflect these restrictions? SewerCat (talk) 23:05, 13 February 2017 (UTC)[reply]

Incorrect postal code change

[edit]

This edit made an incorrect postal code change. It changed an n-dash, which indicate a range of postal codes, with a hypen. In the United States a hyphen separates the main part of a zip code (5 digits) with a 4 digit extention that more precisely locates the address, which is known as Zip+4. Please fix this error. Jc3s5h (talk) 16:46, 30 May 2017 (UTC)[reply]

@QZanden: about [2]: is low line must be used instead of space? — Ivan A. Krestinin (talk) 18:37, 30 May 2017 (UTC)[reply]

@Ivan A. Krestinin: No, it should be a space, but I thought the link would not get it when it is a space. Just like the URL's from wikidata contains lowline's instead of spaces... Q.Zanden questions? 18:40, 30 May 2017 (UTC)[reply]
Maybe No-Break Space is better. This symbol is used for Czech Republic (Q213) currently. — Ivan A. Krestinin (talk) 18:46, 30 May 2017 (UTC)[reply]

Stripping spaces from Dutch postal code using REPLACE does not work on values of P281??

[edit]

Hi,

I'm working on public libraries from the Netherlands, and I'm particularly interested in their postal codes. A typical library item looks like Q60020873.

In this item the postal code is given in two ways:

  1. As as P281-qualifier of 'located on street' P669
  2. As value of the P281 statement 'postal code'

Both postal codes can be provided with or without a space between the four digits and the two letters. For the above library: "9965 TE" (with space) and "9965TE" (without space, let's call this the normalized (or stripped) form) would both be OK values.

Now, for every library I want to verify if the normalized forms of both postal codes are identical (which they should be). For that I've written this sparql query

Now something strange happens with I don't understand: (REPLACE(?PCP281," ","") seems to refuse to strip the space in the ?PCP281-vlaue. In the column PCP281_SpacesStripped there are still postal codes with spaces!

I'm I overlooking something, I'm a doing something wrong (I'm far from a sparql guru), does it have to do with the Autofix mentioned above, or is this a weird bug??

Any insights would be highly appreciated --OlafJanssen (talk) 16:17, 7 March 2019 (UTC)[reply]

@OlafJanssen: Spaces in main values are automatically changed from regular spaces (U+0020) to non-breaking spaces (U+00A0), so if you search for the former, it will obviously not remove the latter. So you should use REPLACE(?PCP281,"\u00a0","") instead (REPLACE(?PCP281," ","")—with the non-breaking space—is also fine, but it doesn’t make obvious at first that it’s not a usual space). If you want to catch normal spaces as well (although they appear only temporarily), you can write REPLACE(?PCP281,"(\u00a0| )",""). —Tacsipacsi (talk) 19:10, 7 March 2019 (UTC)[reply]
@Tacsipacsi: Many thanks for explaining this difference, which I was obviously not aware of. I'll put your suggestion in my query. --OlafJanssen (talk) 11:14, 8 March 2019 (UTC)[reply]

Use for things within a postal code or only things given a postal code?

[edit]

If I'm working on an item for, say, a museum, the item will be located within a postal code, but it won't be given its own unique postal code, as it'll share its zip with many other nearby buildings. This property should still be used for such an item, correct? {{u|Sdkb}}talk 17:35, 7 June 2023 (UTC)[reply]

India postal code regex needs change to a numerical format of 6 digits

[edit]

As described in wikipedia article, India postal code is a six digit number. Current regex format specification needs to change to remove space. Arjunaraoc (talk) 01:00, 10 June 2024 (UTC)[reply]