query-e5c3fe1137d80449060504ab91b68ebe

rq turtle/ttl

Topics

Use at

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/Q20980928>

SELECT
  ?works
  (CONCAT("#author/", SUBSTR(STR(target:), 32), "/topic/", SUBSTR(STR(?topic), 32)) AS ?worksUrl)

  ?topic ?topicLabel
  (CONCAT("#topic/", SUBSTR(STR(?topic), 32)) AS ?topicUrl)
  ?topicDescription

  ?example_work ?example_workLabel
  (CONCAT("#work/", SUBSTR(STR(?example_work), 32)) AS ?example_workUrl)
WHERE {
   {
  SELECT
    (COUNT(?work) AS ?works)
    ?topic
    (SAMPLE(?work) AS ?example_work)
  WHERE {
    ?work wdt:P50 target: ;
          wdt:P921 ?topic .
  }
  GROUP BY ?topic
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh" . } 
}
ORDER BY DESC(?works)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?example_work"):::projected v7("?example_workUrl") v3("?topic"):::projected v6("?topicUrl") v2("?work") v4("?works"):::projected v5("?worksUrl") c7(["en,da,de,es,fr,jp,nl,no,ru,sv,zh"]):::literal c5(["bd:serviceParam"]):::iri c2([http://www.wikidata.org/entity/Q20980928]):::iri v2 --"wdt:P50"--> 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('#author/',substring(str(http://www.wikidata.org/entity/Q20980928),'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