query-93eeb61c2b6aa410fa7b47a9a8313fa0

rq turtle/ttl

Look after a/some specific ICAO code(s)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?natureLabel WHERE {
{?item wdt:P239 ?ICAO 
VALUES ?ICAO { "HKKG" }.} #item has a P239 value  
OPTIONAL { ?item wdt:P31 ?nature. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } . #this bit gets labels for Qid values
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?ICAO") v1("?item"):::projected v3("?nature") c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P239"--> v3 bind0[/VALUES ?ICAO/] bind0-->v3 bind00(["HKKG"]) bind00 --> bind0 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P31".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end