User:Bouzinac/Frontières

Objets transfrontaliers : ont ils une partie de?Edit

select 
  ?item ?itemLabel 
  (SAMPLE(?coor) as ?coor)
  (group_concat(DISTINCT ?natureLabel) as ?NATURE) 
  (group_concat(DISTINCT ?paysLabel; separator=", ") as ?PAYS) 
  (group_concat(DISTINCT ?partiedeLabel; separator=" // ") AS ?partiedeL)
WHERE
{  
  {  SELECT ?item ?itemLabel ?nature ?natureLabel ?coor ?pays ?paysLabel ?partiede ?partiedeLabel 
     WHERE
     {
      ?item wdt:P31/wdt:P279* wd:Q25296884 .
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q4366834. } # exclude cours d'eau
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q218719. } # exclude contr^le frontalier
  MINUS { ?item wdt:P361 wd:Q3089219. } #Remove maritime borders
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q1402443. } # exclude railway station border
  MINUS { ?item wdt:P361 wd:Q1292279. } #Remove political borders (not international)
  MINUS { ?item wdt:P361 wd:Q67457910. } #Remove municipal borders 
  MINUS { ?item wdt:P361 wd:Q67218438. } #Remove air borders
  MINUS { ?item wdt:P576 _:b2. }
  MINUS { ?item p:P361 [ps:P361 wd:Q1292279 ; pq:P576 ?P576 ] . }
      ?item wdt:P31 ?nature.
      ?item wdt:P17 ?pays.
      OPTIONAL { ?item wdt:P361 ?partiede }
      OPTIONAL { ?item wdt:P625 ?coor }
       BIND(COALESCE(?partiede,"vide") AS ?variable).
       filter(?variable="vide")
      SERVICE wikibase:label {       bd:serviceParam wikibase:language "fr,en"   }
     } #
  } #
} group by ?item ?itemLabel

Try it!

Borders between European Union and non European countriesEdit

#defaultView:Map
SELECT distinct ?item ?itemLabel ?coord WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item wdt:P31 wd:Q757292 .#checkpoints
  ?item wdt:P361*/wdt:P31/wdt:P279* wd:Q67147037 . #located on a UE border
  ?item wdt:P17*/wdt:P463* wd:Q458. #in a European Union country
  ?item wdt:P17*/wdt:P463* wd:Q1969730. #Belongs to Schengen zone
  MINUS { ?item wdt:P576 _:b2. } #Remove dissolved
  MINUS { ?item wdt:P361 wd:Q3089219. } #Remove maritime borders
  MINUS { ?item wdt:P361 wd:Q67457910. } #Remove municipal/cities borders
  MINUS { ?item wdt:P361 wd:Q700754. } #Remove RFA-RDA borders
  MINUS { ?item wdt:P361 wd:Q67218438. } #Remove air borders
  OPTIONAL { ?item wdt:P625 ?coord. }
}

Try it!

Borders of country A and BEdit

#defaultView:Map
select 
  ?item ?itemLabel 
  (SAMPLE(?coor) as ?coor)
  (group_concat(DISTINCT ?natureLabel) as ?NATURE) 
  (group_concat(DISTINCT ?paysLabel; separator=", ") as ?PAYS) 
  (group_concat(DISTINCT ?partiedeLabel; separator=" // ") AS ?partiedeL)
 (group_concat(DISTINCT ?adjacentLabel; separator=" // ") AS ?adjacentL)
WHERE
{  
  {  SELECT ?item ?itemLabel ?nature ?natureLabel ?coor ?pays ?paysLabel ?partiede ?partiedeLabel ?adjacent ?adjacentLabel
     WHERE
     {
      ?item wdt:P31/wdt:P279* wd:Q757292 .
       ?item wdt:P361 wd:Q119515.#border of country A AND B
      OPTIONAL { ?item wdt:P3032 ?adjacent}
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q4366834. } # exclude cours d'eau
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q218719. } # exclude contr^le frontalier
  MINUS { ?item wdt:P361 wd:Q3089219. } #Remove maritime borders
  MINUS { ?item (wdt:P31/wdt:P279*) wd:Q1402443. } # exclude railway station border
  MINUS { ?item wdt:P361 wd:Q1292279. } #Remove political borders (not international)
  MINUS { ?item wdt:P361 wd:Q67457910. } #Remove municipal borders 
  MINUS { ?item wdt:P361 wd:Q67218438. } #Remove air borders
  MINUS { ?item wdt:P576 _:b2. }
  MINUS { ?item p:P361 [ps:P361 wd:Q1292279 ; pq:P576 ?P576 ] . }
      ?item wdt:P31 ?nature.
      ?item wdt:P17 ?pays.
      OPTIONAL { ?item wdt:P361 ?partiede }
      OPTIONAL { ?item wdt:P625 ?coor }
      SERVICE wikibase:label {       bd:serviceParam wikibase:language "fr,en"   }
     } # 
  } #
} group by ?item ?itemLabel

Try it!

Borders between Schengen zone and outside SchengenEdit

#defaultView:Map
SELECT distinct ?item ?itemLabel ?coord WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item wdt:P361*/wdt:P31/wdt:P279* wd:Q757292 .#checkpoints
  ?item wdt:P361*/wdt:P31/wdt:P279* wd:Q67371697 . #located on a Schengen border
MINUS { ?item wdt:P576 _:b2. } #Remove dissolved
MINUS { ?item wdt:P361 wd:Q17163396. } #Remove open borders
MINUS { ?item wdt:P361 wd:Q3089219. } #Remove maritime borders
MINUS { ?item wdt:P361 wd:Q700754. } #Remove RFA-RDA borders
MINUS { ?item wdt:P361 wd:Q67218438. } #Remove air borders
MINUS { ?item wdt:P361 wd:Q67457910. } #Remove municipal/cities borders
OPTIONAL { ?item wdt:P625 ?coord. }
}

Try it!

Border dots between North Ireland and IrelandEdit

#defaultView:Map
SELECT ?front ?frontLabel ?nature ?natureLabel ?coord WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?front wdt:P361 wd:Q670200 .
  OPTIONAL { ?front wdt:P31 ?nature. }
  OPTIONAL { ?front wdt:P625 ?coord. }
}       
ORDER BY (?coord )

Try it!

Postes frontières de ChypreEdit

#defaultView:Map
SELECT distinct ?item ?itemLabel ?coord WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  VALUES ?borders { wd:Q91090320 wd:Q15974882 }
  ?item wdt:P361*/wdt:P31*/wdt:P279* wd:Q757292 .#checkpoints
  ?item wdt:P361*/wdt:P31*/wdt:P279* ?borders.
  OPTIONAL { ?item wdt:P625 ?coord. }
}

Try it!