query-bea65eef4e94b9ecdbf38b6c3b2678a7

rq turtle/ttl

TODO

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT distinct ?l ?iso
WHERE {
  ?w wdt:P50 wd:Q692 .
  ?w wdt:P407 ?l .
  OPTIONAL { ?l wdt:P219 ?iso_ }
  OPTIONAL { ?l wdt:P279*/wdt:P219 ?iso2_ }
  BIND(IF(!BOUND(?iso_),?iso2_,?iso_) as ?iso) 
}
ORDER BY ?iso

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?iso"):::projected v5("?iso2_") v4("?iso_") v3("?l"):::projected v2("?w") a1((" ")) c2(["wd:Q692"]):::iri v2 --"wdt:P50"--> c2 v2 --"wdt:P407"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P219".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P279".-> a1 a1 --"wdt:P219"--> v5 end bind0[/"if(not bound(?iso_),?iso2_,?iso_)"/] v4 --o bind0 v5 --o bind0 bind0 --as--o v6