Wikidata:WikiProject Italy/Administrative divisions

Regions

edit

Italy is divided in 20 administrative regions. Some regions have a special statute and they are considered as a subclass of the most generic region [1]. The query for the list of the italian regions must includes the region of Italy (Q16110) and subclasses (only one indeed, autonomous region with special statute (Q1710033)).

#Italian regions
SELECT ?item ?itemLabel
WHERE 
{
  ?item wdt:P131 wd:Q38.                   # Administrative divisions of Italy
  ?item p:P31/ps:P31/wdt:P279* wd:Q16110 . # Regions (including subclasses for special statute regions)
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Provinces

edit

Each region is administratively divided in provinces. Since 2016 some province of Italy (Q15089) have been replaced by metropolitan city of Italy (Q15110) and free municipal consortium (Q21190155), the next query considers all of them. As of today there are 106 administrative entities: 86 province of Italy (Q15089), 14 metropolitan city of Italy (Q15110) and 6 free municipal consortium (Q21190155).

#Italia: regions, provinces
#defaultView:Tree
SELECT ?italiaLabel ?regione ?regioneLabel ?provincia ?provinciaLabel ?comune ?comuneLabel
WHERE 
{
  ?regione p:P31/ps:P31/wdt:P279* wd:Q16110 .    # Regions of Italia
  ?provincia wdt:P131 ?regione .                 # Administrative divisions in the region
  
  { ?provincia wdt:P31 wd:Q15089 . }             # List of provinces

  UNION
  { ?provincia wdt:P31 wd:Q15110 . }             # metropolitan cities of Italy
  
  UNION
  { ?provincia wdt:P31 wd:Q21190155 . }          # Liberi consorzi comunali of Sicily
 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Unioni Territoriali Intercomunali

edit

The intermunicipal territorial union (Q27961023) can be considered similar to provinces but are not administrative entities and they are used only for statistical purposes. They are a total of 18 and replaced 4 provinces from Friuli Venezia-Giulia since 2016:

#Italia: Unioni territoriali intercomunali
#defaultView:Tree
SELECT ?regione ?regioneLabel ?provincia ?provinciaLabel
WHERE 
{
  ?regione p:P31/ps:P31/wdt:P279* wd:Q16110 .    # Regions of Italia
  ?provincia wdt:P131 ?regione .                 # Administrative divisions in the region
  
  { ?provincia wdt:P31 wd:Q27961023 . }          # Unioni terriotriali
 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Moreover, the region of Val d'Aosta is sometimes referenced as province because of the its level of functionality.

Comuni

edit
 

Each region is divided in provinces and then in comuni (municipalities). Both province of Italy (Q15089) and metropolitan city of Italy (Q15110) have to be considered in order to have a complete set of administrative entities of second level. Since 1-Jan-2018 many comuni have been joined in new entities, so Wikidata items have been (or still have to be) updated. This comuni have been defined as instance of (P31) of abolished municipality in Italy (Q3685476).

Properties

edit

The following properties should be used for a proper and common characterization of a commune of Italy (Q747074):

Please note that sparse municipality (Q954172) is a subclass of commune of Italy (Q747074), do not use both else queries could report the item twice. Although a commune of Italy (Q747074) normally belongs to a province of Italy (Q15089) or to an instance of an its subclass, there could be a case where it could belong to an upper level administrative entity.

#Italia: regions, provinces and comuni
#defaultView:Tree
SELECT ?regione ?regioneLabel ?provincia ?provinciaLabel ?comune ?comuneLabel
WHERE 
{
  ?regione p:P31/ps:P31/wdt:P279* wd:Q16110 .    # Regions of Italia
  ?provincia wdt:P131 ?regione .                 # Administrative divisions in the region
  
  { ?provincia wdt:P31 wd:Q15089 . }             # List of provinces
  UNION
  { ?provincia wdt:P31 wd:Q15110 . }             # metropolitan cities of Italy
  UNION
  { ?provincia wdt:P31 wd:Q21190155 . }          # Liberi consorzi comunali of Sicily
   
  ?comune wdt:P131 ?provincia .                  # Administrative divisions in the province
  {
    ?comune wdt:P31 wd:Q747074 .                 # Italian municipality
  }
  UNION
  {
    ?comune wdt:P31 wd:Q954172 .                 # Italian sparse municipality
  } 
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

The next query reports the number of comuni per region:

#Italia: number of comuni per region
#defaultView:Table
SELECT ?regione ?regioneLabel (COUNT(?comune) AS ?count)
WHERE 
{
  ?regione p:P31/ps:P31/wdt:P279* wd:Q16110 .    # Regions of Italia
  ?provincia wdt:P131 ?regione .                 # Administrative divisions in the region
  
  { ?provincia wdt:P31 wd:Q15089 . }             # List of provinces
  UNION
  { ?provincia wdt:P31 wd:Q15110 . }             # metropolitan cities of Italy
  UNION
  { ?provincia wdt:P31 wd:Q21190155 . }          # Liberi consorzi comunali of Sicily
   
  ?comune wdt:P131 ?provincia .                  # Administrative divisions in the province
  {
    ?comune wdt:P31 wd:Q747074 .                 # Italian municipality
  }
  UNION
  {
    ?comune wdt:P31 wd:Q954172 .                 # Italian sparse municipality
  } 
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?regione ?regioneLabel
ORDER BY DESC(?count)
Try it!

List of all the comuni in a specific region, Q1210-Lombardia in this example

#Italia: Provinces and comuni in a specific region
#defaultView:Table
SELECT ?provincia ?provinciaLabel ?comune ?comuneLabel
WHERE 
{
  ?provincia wdt:P131 wd:Q1210 .                 # Administrative divisions in the region "Lombardia"
  
  { ?provincia wdt:P31 wd:Q15089 . }             # List of provinces
  UNION
  { ?provincia wdt:P31 wd:Q15110 . }             # metropolitan cities of Italy
  UNION
  { ?provincia wdt:P31 wd:Q21190155 . }          # Liberi consorzi comunali of Sicily
   
  ?comune wdt:P131 ?provincia .                  # Administrative divisions in the province
  {
    ?comune wdt:P31 wd:Q747074 .                 # Italian municipality
  }
  UNION
  {
    ?comune wdt:P31 wd:Q954172 .                 # Italian sparse municipality
  } 
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?provinciaLabel ?comuneLabel
Try it!

Number of comuni per province of a specific region (e.g. Lombardia)

#Italia: number of comuni per province of the region Lombardia
#defaultView:Table
SELECT ?provincia ?provinciaLabel (COUNT(?comune) AS ?count)
WHERE 
{
  ?provincia wdt:P131 wd:Q1210 .                 # Administrative divisions in Lombardia
  
  { ?provincia wdt:P31 wd:Q15089 . }             # List of provinces
  UNION
  { ?provincia wdt:P31 wd:Q15110 . }             # metropolitan cities of Italy
  UNION
  { ?provincia wdt:P31 wd:Q21190155 . }          # Liberi consorzi comunali of Sicily
   
  ?comune wdt:P131 ?provincia .                  # Administrative divisions in the province
  {
    ?comune wdt:P31 wd:Q747074 .                 # Italian municipality
  }
  UNION
  {
    ?comune wdt:P31 wd:Q954172 .                 # Italian sparse municipality
  } 
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?provincia ?provinciaLabel
ORDER BY DESC(?count)
Try it!