query-022252afde594c798af4251c81bb2381
Buried composers by works
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX target: <http://www.wikidata.org/entity/Q742670>
SELECT
?works
?composer ?composerLabel
(CONCAT("#composer/", SUBSTR(STR(?composer), 32)) AS ?composerUrl)
?composerDescription
WHERE {
{
SELECT
(COUNT(?work) AS ?works)
?composer
WHERE {
?composer wdt:P119 target: ;
^wdt:P86 ?work .
}
GROUP BY ?composer
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?works)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?composer"):::projected
v4("?composerUrl")
v3("?work")
v4("?works"):::projected
c5(["bd:serviceParam"]):::iri
c2([http://www.wikidata.org/entity/Q742670]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P119"--> c2
v3 --"wdt:P86"--> v2
bind1[/"count(?work)"/]
v3 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind2[/"concat('#composer/',substring(str(?composer),'32^^xsd:integer'))"/]
v2 --o bind2
bind2 --as--o v4