query-dffb3b119e1cd0a4a5c9b3da11937162

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?ISO639_1 ?ISO639_2 ?ISO639_3 ?country ?countryLabel
WHERE 
{
  { SELECT ?item (SAMPLE(?ISO639_1_) as ?ISO639_1) (SAMPLE(?ISO639_2_) as ?ISO639_2) (SAMPLE(?ISO639_3_) as ?ISO639_3) WHERE
    {
      {?item wdt:P218 ?ISO639_1_ .}
      UNION 
      {?item wdt:P219 ?ISO639_2_ .}
      UNION
      {?item wdt:P220 ?ISO639_3_ .}
      } group by ?item }
  ?country wdt:P463 wd:Q1065. 
  ?country wdt:P37 ?item.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?ISO639_1"):::projected v2("?ISO639_1_") v6("?ISO639_2"):::projected v3("?ISO639_2_") v7("?ISO639_3"):::projected v4("?ISO639_3_") v8("?country"):::projected v1("?item"):::projected c8(["bd:serviceParam"]):::iri c5(["wd:Q1065"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P220"--> v4 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P219"--> v3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P218"--> v2 end union0r <== or ==> union0l end bind3[/"sample(?ISO639_1_)"/] v2 --o bind3 bind3 --as--o v5 bind4[/"sample(?ISO639_2_)"/] v3 --o bind4 bind4 --as--o v6 bind5[/"sample(?ISO639_3_)"/] v4 --o bind5 bind5 --as--o v7 v8 --"wdt:P463"--> c5 v8 --"wdt:P37"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end