query-2ff951bfe5b2ca3f887217192d5ef44d

rq turtle/ttl

All musicians born in Africa

which have been nominated or received a grammy award

SELECT DISTINCT ?item ?itemLabel ?landLabel ?birth ?img WHERE { VALUES ?g { wdt:P1411 wdt:P166 } # nominated or received VALUES ?p { wdt:P740 wdt:P19 } # place of birth or formation VALUES ?d { wdt:P569 wdt:P571 } ?item ?g [ wdt:P361 wd:Q41254 ]. # part of grammy award ?item ?p ?place. ?place wdt:P17+ ?land. ?land wdt:P30 wd:Q15. OPTIONAL { ?item wdt:P569 ?b. } OPTIONAL { ?item wdt:P571 ?i. } BIND(COALESCE(?i, ?b) AS ?birth). OPTIONAL { ?item wdt:P18 ?img. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". } } ORDER BY ASC ( ?birth ) LIMIT 300

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#>
# All musicians born in Africa
# which have been nominated or received a grammy award
SELECT DISTINCT ?item ?itemLabel ?landLabel ?birth ?img
WHERE {
  VALUES ?g { wdt:P1411 wdt:P166 } # nominated or received
  VALUES ?p { wdt:P740 wdt:P19 }   # place of birth or formation
  VALUES ?d { wdt:P569 wdt:P571 }
  ?item ?g [ wdt:P361 wd:Q41254 ]. # part of grammy award
  ?item ?p ?place. 
  ?place wdt:P17+ ?land. 
  ?land wdt:P30 wd:Q15. 
  OPTIONAL { ?item wdt:P569 ?b. }
  OPTIONAL { ?item wdt:P571 ?i. }
  BIND(COALESCE(?i, ?b) AS ?birth).
  OPTIONAL { ?item wdt:P18 ?img. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
}
ORDER BY ASC ( ?birth )
LIMIT 300

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?b") v10("?birth"):::projected v4("?d") v2("?g") v9("?i") v10("?img"):::projected v5("?item"):::projected v7("?land") v3("?p") v6("?place") a1((" ")) c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en,fr"]):::literal c2(["wd:Q41254"]):::iri c5(["wd:Q15"]):::iri bind0[/VALUES ?g/] bind0-->v2 bind00(["wdt:P1411"]) bind00 --> bind0 bind01(["wdt:P166"]) bind01 --> bind0 bind1[/VALUES ?p/] bind1-->v3 bind10(["wdt:P740"]) bind10 --> bind1 bind11(["wdt:P19"]) bind11 --> bind1 bind2[/VALUES ?d/] bind2-->v4 bind20(["wdt:P569"]) bind20 --> bind2 bind21(["wdt:P571"]) bind21 --> bind2 a1 --"wdt:P361"--> c2 v5 -->v2--> a1 v5 -->v3--> v6 v6 --"wdt:P17"--> v7 v7 --"wdt:P30"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P569".-> v8 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P571".-> v9 end bind3[/"?i?b"/] v9 --o bind3 v8 --o bind3 bind3 --as--o v10 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P18".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end