Gebruiker:Bdijkstra/Wikidata/Luchthavens

Uit Wikipedia, de vrije encyclopedie

Luchthavens met een artikel op nlwiki met dichtstbijzijnde stad, IATA-code, ICAO-code, aantal (ingevoerde) startbanen en website. Voor lijst van luchthavens.

Te doen: voormalige luchthavens eruit filteren.

SELECT 
    ?item
    (GROUP_CONCAT(DISTINCT(?landLabel); separator=", ") as ?landen) 
    (GROUP_CONCAT(DISTINCT(?stadLabel); separator=", ") as ?steden)
    (GROUP_CONCAT(DISTINCT(?iataLabel); separator=", ") as ?IATAs)
    (GROUP_CONCAT(DISTINCT(?icaoLabel); separator=", ") as ?ICAOs)
    (COUNT(DISTINCT(?startbaan)) AS ?banen)
    (GROUP_CONCAT(DISTINCT(?website); separator=", ") as ?websites)
WHERE {
  ?article schema:about ?item ;
  schema:isPartOf <https://nl.wikipedia.org/> .
  ?item (wdt:P31/wdt:P279*) wd:Q1248784.
  OPTIONAL { ?item wdt:P17 ?land. }
  OPTIONAL { ?item wdt:P931 ?stad. }
  OPTIONAL { ?item wdt:P238 ?IATA. }
  OPTIONAL { ?item wdt:P239 ?ICAO. }
  OPTIONAL { ?item wdt:P529 ?startbaan. }
  OPTIONAL { ?item wdt:P856 ?website. }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
	?land rdfs:label ?landLabel .
    ?stad rdfs:label ?stadLabel .
    ?IATA rdfs:label ?iataLabel .
    ?ICAO rdfs:label ?icaoLabel
  }
}
GROUP BY ?item
ORDER BY ?item