query-da647db1c50bd4a7830d60d518978fe3
All singer and bands originated from Africa SELECT DISTINCT ?musicians ?musiciansLabel ?landLabel ?geb ?img
# get all singer and bands WITH { SELECT ?musicians WHERE { { ?musicians wdt:P31 wd:Q5; wdt:P106 wd:Q177220. } UNION { ?musicians wdt:P31/wdt:P279* wd:Q215380. } } } AS %m
# take the ones, which are born or started in africa
WITH {
SELECT ?musicians ?land ?geb WHERE {
INCLUDE %m
VALUES ?t { wdt:P571 wdt:P569 }
VALUES ?p { wdt:P19 wdt:P740 }
?musicians ?t ?geb.
?musicians ?p [ wdt:P17 ?land ].
?land wdt:P30 wd:Q15.
}
} AS %results
WHERE { INCLUDE %results. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". } } LIMIT 3000
Use at
- https://query.wikidata.org/sparql
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 singer and bands originated from Africa
SELECT DISTINCT ?musicians ?musiciansLabel ?landLabel ?geb ?img
# get all singer and bands
# take the ones, which are born or started in africa
WHERE {
{
SELECT ?musicians ?land ?geb WHERE {
{
SELECT ?musicians WHERE {
{ ?musicians wdt:P31 wd:Q5;
wdt:P106 wd:Q177220.
}
UNION
{ ?musicians wdt:P31/wdt:P279* wd:Q215380. }
}
} VALUES ?t { wdt:P571 wdt:P569 }
VALUES ?p { wdt:P19 wdt:P740 }
?musicians ?t ?geb.
?musicians ?p [ wdt:P17 ?land ].
?land wdt:P30 wd:Q15.
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
}
LIMIT 3000