query-a29a5f6692171bced667b835a77ac87c
Topics
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/Q15817015>
SELECT
?count
(CONCAT("#venue/", SUBSTR(STR(target:), 32),
"/topic/", SUBSTR(STR(?topic), 32)) AS ?countUrl)
?topic ?topicLabel
(CONCAT("#topic/", SUBSTR(STR(?topic), 32)) AS ?topicUrl)
?example_work ?example_workLabel
(CONCAT("#work/", SUBSTR(STR(?example_work), 32)) AS ?example_workUrl)
WHERE {
{
SELECT
(COUNT(?work) as ?count)
?topic
(SAMPLE(?work) AS ?example_work)
WHERE {
?work wdt:P1433 target: ;
wdt:P921 ?topic .
}
GROUP BY ?topic
ORDER BY DESC(?count)
LIMIT 200
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count"):::projected
v5("?countUrl")
v4("?example_work"):::projected
v7("?example_workUrl")
v3("?topic"):::projected
v6("?topicUrl")
v2("?work")
c5(["bd:serviceParam"]):::iri
c2([http://www.wikidata.org/entity/Q15817015]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P1433"--> c2
v2 --"wdt:P921"--> v3
bind2[/"count(?work)"/]
v2 --o bind2
bind2 --as--o v4
bind3[/"sample(?work)"/]
v2 --o bind3
bind3 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind4[/"concat('#venue/',substring(str(http://www.wikidata.org/entity/Q15817015),'32^^xsd:integer'),'/topic/',substring(str(?topic),'32^^xsd:integer'))"/]
v3 --o bind4
bind4 --as--o v5
bind5[/"concat('#topic/',substring(str(?topic),'32^^xsd:integer'))"/]
v3 --o bind5
bind5 --as--o v6
bind6[/"concat('#work/',substring(str(?example_work),'32^^xsd:integer'))"/]
v4 --o bind6
bind6 --as--o v7