query-af08e46e4c0386204972601e4a34f36b
All musicians born in Africa
which have at least a musicbrainz artist ID
SELECT DISTINCT ?musiker ?musikerLabel ?landLabel ?geb ?band ?bandLabel ?img WHERE { ?musiker wdt:P31 wd:Q5; wdt:P434 ?mb; wdt:P19/wdt:P17+ ?land; wdt:P569 ?geb. FILTER NOT EXISTS { ?musiker wdt:P570 ?gest. } ?land wdt:P30 wd:Q15. ?type wdt:P31/wdt:P279* wd:Q66715801. ?musiker wdt:P106 ?type. #FILTER (BOUND(?mb)). OPTIONAL { ?musiker wdt:P361 ?band. } OPTIONAL { ?musiker wdt:P18 ?img. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". } } ORDER BY ASC (?landLabel) 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 musicians born in Africa
# which have at least a musicbrainz artist ID
SELECT DISTINCT ?musiker ?musikerLabel ?landLabel ?geb ?band ?bandLabel ?img
WHERE {
?musiker wdt:P31 wd:Q5;
wdt:P434 ?mb;
wdt:P19/wdt:P17+ ?land;
wdt:P569 ?geb.
FILTER NOT EXISTS { ?musiker wdt:P570 ?gest. }
?land wdt:P30 wd:Q15.
?type wdt:P31/wdt:P279* wd:Q66715801.
?musiker wdt:P106 ?type.
#FILTER (BOUND(?mb)).
OPTIONAL { ?musiker wdt:P361 ?band. }
OPTIONAL { ?musiker wdt:P18 ?img. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
}
ORDER BY ASC (?landLabel)
LIMIT 3000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?band"):::projected
v6("?geb"):::projected
v3("?gest")
v9("?img"):::projected
v5("?land")
v1("?landLabel"):::projected
v4("?mb")
v2("?musiker"):::projected
v7("?type")
a1((" "))
a2((" "))
c18(["#91;AUTO_LANGUAGE#93;,en,fr"]):::literal
c9(["wd:Q15"]):::iri
c16(["bd:serviceParam"]):::iri
c3(["wd:Q5"]):::iri
c11(["wd:Q66715801"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P570"--> e0v2
e0v2("?gest"):::projected
e0v1("?musiker"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"wdt:P570"--> v3
v2 --"wdt:P31"--> c3
v2 --"wdt:P434"--> v4
v2 --"wdt:P19"--> a1
a1 --"wdt:P17"--> v5
v2 --"wdt:P569"--> v6
v5 --"wdt:P30"--> c9
v7 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c11
v2 --"wdt:P106"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P361".-> v8
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P18".-> v9
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end