query-02d423e4c587cdaff380e041c2477d2b
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?sitelink ?place_servedLabel ?iata ?icao WHERE {
?item wdt:P31/wdt:P279* wd:Q1248784. # item must be an instance of an airport, or of a subclass of an airport
optional {?item wdt:P238 ?iata .} # item may have a P238 (IATA) value
optional {?item wdt:P239 ?icao .} # item may have has a P239 (ICAO) value
optional {?item wdt:P931 ?place_served .} # item may have a value for P931, which is put into a variable ?place_served
?item wdt:P17 wd:Q142 . # ?item has country = France
?sitelink schema:about ?item; # item has a sitelink
schema:isPartOf <https://en.wikipedia.org/>. # the sitelink points to en.wikipedia
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } . #this bit gets labels for Qid values
} order by ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?iata"):::projected
v4("?icao"):::projected
v2("?item"):::projected
v1("?itemLabel"):::projected
v5("?place_served")
v6("?sitelink"):::projected
a1((" "))
c11([https://en.wikipedia.org/]):::iri
c3(["wd:Q1248784"]):::iri
c13(["bd:serviceParam"]):::iri
c15(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c8(["wd:Q142"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P238".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P239".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P931".-> v5
end
v2 --"wdt:P17"--> c8
v6 --"schema:about"--> v2
v6 --"schema:isPartOf"--> c11
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end