Wikidata:Property proposal/Moroccan geographic code (2015)
Jump to navigation
Jump to search
Moroccan geographic code (2015)
[edit]Originally proposed at Wikidata:Property proposal/Place
Description | Moroccan geographic code since 2015 |
---|---|
Represents | Moroccan Geographic Code (Q2981579) |
Data type | External identifier |
Domain | administrative territorial entity of Morocco (Q4115671) |
Allowed values | (0[1-9]|1[0-2]|[1-9])(\.\d+){0,6}\.? : first two digits 01 to 12 (for 12 administrative regions). Dotting follows a specific pattern, and the length of the code depends on the administrative level as explained below. The code must not be used for former administrative divisions of Morocco, only the current ones. |
Example 1 | Q28880163 → 01.051.03.01.2.04.05 |
Example 2 | Al Hoceima Province (Q1969619) → 01.051 |
Example 3 | Tangier-Tetouan-Al Hoceima (Q19951300) → 01 |
Source | Excel table (xlsx) (ar) from [1] |
Number of IDs in source | 32125, sourcing circumstances (P1480) : more (Q54418095) |
Implied notability | Wikidata property for an identifier that suggests notability (Q62589316) |
Robot and gadget jobs | OpenRefine (Q5583871), QuickStatements 2 (Q29032512) |
Applicable "stated in"-value | no value |
Single-value constraint | yes |
Distinct-values constraint | yes |
Wikidata project | WikiProject Morocco (Q15106931) |
Motivation
[edit]- According to the article in French about the Moroccan geographic code, the Moroccan geographic code is established by the Haut-Commissariat au plan, an independent government statistical institution. The number of digits in the code depends on the level of administrative division, and is as follows:
- two digits for regions;
- three (additional) for the prefecture or province;
- five (additional to the regional code) for circles;
- seven (additional to the regional code) for communes.
For lower level administrative divisions, the code can be longer. I have statistics of Moroccan villages (douars) from the 2014 census in Excel format (see here, hopefully it's accessible to everyone), and their code is 13 digits long. For example, Q28880163 has the Moroccan geo-code 1051030120405. I hope this makes the proposal clearer so it can go through.--Ideophagous (talk) 10:44, 7 July 2023 (UTC)
- Additional note: the code normally should contain dots separating the different subcodes (for region, province, etc), as shown in this report.--Ideophagous (talk) 21:28, 7 July 2023 (UTC)
- Added some clarifications. --Ideophagous (talk) 07:03, 8 July 2023 (UTC)
Discussion
[edit]- Comment @Ideophagous: I did some tehcnical improvments to the proposal template, please check if this is correct. Cheers, VIGNERON (talk) 07:00, 13 July 2023 (UTC)
- Hello @VIGNERON. Thank you for the update. I'm not sure the regex in the "allowed values" is correct though, or maybe I misunderstood something. Shouldn't it be something like
- ^(0[1-9]|1[0-2])(\.[0-9]+){0,4}$ Ideophagous (talk) 13:41, 13 July 2023 (UTC)
- @Ideophagous: ^ and $ is already implied by tool using the regex. For the rest, you're right it's indeed better (and I miscounted the number of groups), I corrected it thanks. Cheers, VIGNERON (talk) 13:58, 13 July 2023 (UTC)
- Hello @VIGNERON, thanks! I added a nowiki tag so the regex and the rest of the text gets displayed correctly (it was truncated in the display for some reason). Ideophagous (talk) 14:08, 13 July 2023 (UTC)
- @VIGNERON Any news here? Ideophagous (talk) 19:47, 30 July 2023 (UTC)
- @Ideophagous: ^ and $ is already implied by tool using the regex. For the rest, you're right it's indeed better (and I miscounted the number of groups), I corrected it thanks. Cheers, VIGNERON (talk) 13:58, 13 July 2023 (UTC)
- Info The file can be found at this address without asking for viewing permission. I added 2015 so that the codes are not taken from the old codes (16 regions). ―Eihel (talk) 15:01, 1 August 2023 (UTC)
- Comment From my research, the codes can be up to 14 digits. In my opinion, RegEx is
(0[1-9]|1[0-2])(\.\d+){0,6}\.?
. 10.261.03.07.2.01.10 is not suitable for the current RegEx. Cordially. ―Eihel (talk) 15:10, 1 August 2023 (UTC)- Hello @Eihel. Do you have an example for an item that should have a 14 digit code? As far as I know, the lowest administrative division of Morocco is a "douar" (village), and they only have 13 digit codes. Ideophagous (talk) 20:17, 11 August 2023 (UTC)
- Hello @Ideophagous:,
- You gave a link where you have to request an access right to have the file. I gave a link where the file is directly accessible (Données démographiques et socio-économiques de la population rurale (hors nomades) par douar selon RGBH 2014.xlsx) and a link to RegEx with many examples. It's the same file, so we see the same thing. Examples, 2 douar:
- line 17311 - تلات نشلوت ⇒
07.041.07.03.2.03.03
- line 31441 - إد همو أوبلا ⇒
10.473.07.03.2.01.47
- line 17311 - تلات نشلوت ⇒
Also, Descriptions always start with a lower case letter, if possible, see link on your talk page.- Do we have the same datas? Cordially. ―Eihel (talk) 21:08, 11 August 2023 (UTC)
- I see your point, I was looking at the undotted code as it appeared in the field above, which had no leading 0. Your regex is correct in any case (though the first example should be fixed). Shall we proceed to approving the property, or is there still something to clear up? Ideophagous (talk) 21:45, 11 August 2023 (UTC)
- The first code (line 17311) can also be written with 14 digits, in the first instance. Ideophagous, It's more about where you found your first example which is not on the Excel table (10.510.30.01.2.04.05). Cordially. ―Eihel (talk) 22:16, 11 August 2023 (UTC)
- Actually it is on the Excel table, but you can't search in it with the code. Search with the name "بني بوكمات". Ideophagous (talk) 22:26, 11 August 2023 (UTC)
- (edit conflict) @Ideophagous:, This is precisely the error we could make without the
0
: it is not10.510.30.01.2.04.05, but1.051.03.01.2.04.05
, or rather01.051.03.01.2.04.05
10.
is another region! Cordially. ―Eihel (talk) 22:34, 11 August 2023 (UTC)- @Ideophagous:, It is better to copy and paste the formatted code of the cell to avoid errors by putting the points back afterwards. ―Eihel (talk) 23:00, 11 August 2023 (UTC)
- It's expected that the codes, along with other properties, will be loaded with a script and added to Wikidata using Openrefine. So hopefully there will be no errors. Ideophagous (talk) 09:03, 12 August 2023 (UTC)
- By the way, the number of IDs in the source includes only the 6th level divisions (douar). Higher level divisions should be counted too, and they're available on other Excel sheets in the main link you provided. Ideophagous (talk) 11:27, 12 August 2023 (UTC)
- @Ideophagous:, It is better to copy and paste the formatted code of the cell to avoid errors by putting the points back afterwards. ―Eihel (talk) 23:00, 11 August 2023 (UTC)
- (edit conflict) @Ideophagous:, This is precisely the error we could make without the
- Actually it is on the Excel table, but you can't search in it with the code. Search with the name "بني بوكمات". Ideophagous (talk) 22:26, 11 August 2023 (UTC)
- The first code (line 17311) can also be written with 14 digits, in the first instance. Ideophagous, It's more about where you found your first example which is not on the Excel table (10.510.30.01.2.04.05). Cordially. ―Eihel (talk) 22:16, 11 August 2023 (UTC)
- I see your point, I was looking at the undotted code as it appeared in the field above, which had no leading 0. Your regex is correct in any case (though the first example should be fixed). Shall we proceed to approving the property, or is there still something to clear up? Ideophagous (talk) 21:45, 11 August 2023 (UTC)
- Hello @Eihel. Do you have an example for an item that should have a 14 digit code? As far as I know, the lowest administrative division of Morocco is a "douar" (village), and they only have 13 digit codes. Ideophagous (talk) 20:17, 11 August 2023 (UTC)
- Support ―Eihel (talk) 22:02, 11 August 2023 (UTC)
- Support Reda benkhadra (talk) 13:46, 12 August 2023 (UTC)
- Support even though I'm not sure if my vote counts -- Ideophagous (talk) 17:16, 13 August 2023 (UTC)
- Support --AyourAchtouk (talk) 19:19, 13 August 2023 (UTC)