query-2daa3ea45816d66b05b6b97926b7f675

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select distinct ?item ?itemLabel ?iata ?icao ?countryLabel ?ms_Sitelink where {
   {select ?item ?ms_Sitelink WHERE {
  {?item wdt:P238 ?iata .}
  UNION
  {?item wdt:P239 ?icao .}
  ?ms_Sitelink schema:about ?item; schema:isPartOf <https://ms.wikipedia.org/> .
  filter not exists { ?enSitelink schema:about ?item; schema:isPartOf <https://en.wikipedia.org/> .}
  } group by ?item ?ms_Sitelink }  optional {?item wdt:P17 ?country.}
  optional {?item wdt:P238 ?iata .}
  optional {?item wdt:P239 ?icao .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} order by ?country ?ms_Sitelink

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?country") v3("?enSitelink") v5("?iata"):::projected v6("?icao"):::projected v4("?item"):::projected v2("?ms_Sitelink"):::projected c3([https://en.wikipedia.org/]):::iri c9(["bd:serviceParam"]):::iri c6([https://ms.wikipedia.org/]):::iri c11(["en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:isPartOf"--> e0c3 e0v1("?enSitelink"):::projected e0v2("?item"):::projected e0c3([https://en.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> v3 f0 --> c1 f0 --> v4 f0 --> c2 f0 --> c3 v3 --"schema:about"--> v4 v3 --"schema:isPartOf"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P239"--> v6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P238"--> v5 end union0r <== or ==> union0l end v2 --"schema:about"--> v4 v2 --"schema:isPartOf"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P17".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P238".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P239".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end