query-11a7fb201ff1a251e63bbd478ef2b8be

rq turtle/ttl

list all items with P238 or P239 and only one sitelink and that sitelink goes to mswp SELECT DISTINCT ?airport ?airportLabel WHERE { VALUES ?prop { wdt:P238 wdt:P239 } ?airport ?prop [] . ?article schema:about ?airport; schema:isPartOf https://ms.wikipedia.org/ . ?airport wikibase:sitelinks 1 . SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ms,de". } } ORDER BY ?airportLabel

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#>
# list all items with P238 or P239 and only one sitelink and that sitelink goes to mswp
SELECT DISTINCT ?airport ?airportLabel WHERE 
{
VALUES ?prop { wdt:P238 wdt:P239 }
?airport ?prop [] .
?article schema:about ?airport;
         schema:isPartOf <https://ms.wikipedia.org/> . 
?airport wikibase:sitelinks 1 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ms,de". }
}
ORDER BY ?airportLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?airport"):::projected v1("?airportLabel"):::projected v4("?article") v2("?prop") a1((" ")) c5(["1^^xsd:integer"]):::literal c7(["bd:serviceParam"]):::iri c3([https://ms.wikipedia.org/]):::iri c9(["en,ms,de"]):::literal bind0[/VALUES ?prop/] bind0-->v2 bind00(["wdt:P238"]) bind00 --> bind0 bind01(["wdt:P239"]) bind01 --> bind0 v3 -->v2--> a1 v4 --"schema:about"--> v3 v4 --"schema:isPartOf"--> c3 v3 --"wikibase:sitelinks"--> c5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end