query-ae45ff7ec70da7e3f9c069e8669e1520

rq turtle/ttl

All Airports with IATA codes, with place and country

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?IATAcode ?placeLabel ?countryLabel
WHERE 
{
  ?item wdt:P31 wd:Q1248784.
  ?item wdt:P238 ?IATAcode.
  OPTIONAL { ?item wdt:P931 ?place. }
  OPTIONAL { ?item wdt:P17 ?country. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
ORDER BY ASC(?IATAcode)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?IATAcode"):::projected v4("?country") v2("?item"):::projected v3("?place") c2(["wd:Q1248784"]):::iri c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;"]):::literal v2 --"wdt:P31"--> c2 v2 --"wdt:P238"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P931".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P17".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end