query-dce09035e6189f5cd6a0af1321ece9b8
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?shortname ?this
WHERE {
?item (wdt:P31/wdt:P279*) wd:Q644371 . # is airport
OPTIONAL {?item wdt:P1813 ?shortname . # has shortname
FILTER(LANG(?shortname)="en")
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?item rdfs:label ?itemLabel. }
BIND(COALESCE(?shortname,?itemLabel) as ?this)
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v1("?itemLabel"):::projected
v2("?shortname"):::projected
v4("?this"):::projected
a1((" "))
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q644371"]):::iri
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P1813".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
v3 --"rdfs:label"--> v1
end
bind0[/"?shortname?itemLabel"/]
v2 --o bind0
v1 --o bind0
bind0 --as--o v4