query-9a536d18dc98a2fb405a855a55c63c93
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 ?fr_article ?Wfr ?en_article ?Wen ?iata ?icao WHERE {
?item wdt:P31/wdt:P279* wd:Q1248784. # item must be an instance of an airport, or an instance that is a subclass of an airport
?item wdt:P17 wd:Q145 . # item has country = UK
optional {?item wdt:P238 ?iata .} # item may have a P238 (IATA) value
optional {?item wdt:P239 ?icao .} # item may have a P239 (ICAO) value
optional {?Wen schema:about ?item; # item may have a sitelink
schema:isPartOf <https://en.wikipedia.org/>; # the sitelink points to en.wikipedia
schema:name ?en_article.} # and has an article name
optional {?Wfr schema:about ?item; # item may have a sitelink
schema:isPartOf <https://fr.wikipedia.org/>; # the sitelink points to fr.wikipedia
schema:name ?fr_article.} # and has an article name
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;
v5("?Wen"):::projected
v7("?Wfr"):::projected
v6("?en_article"):::projected
v8("?fr_article"):::projected
v3("?iata"):::projected
v4("?icao"):::projected
v2("?item"):::projected
v1("?itemLabel"):::projected
a1((" "))
c12([https://fr.wikipedia.org/]):::iri
c10([https://en.wikipedia.org/]):::iri
c3(["wd:Q1248784"]):::iri
c14(["bd:serviceParam"]):::iri
c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q145"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P17"--> c5
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;
v5 -."schema:about".-> v2
v5 --"schema:isPartOf"--> c10
v5 --"schema:name"--> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v2
v7 --"schema:isPartOf"--> c12
v7 --"schema:name"--> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end