query-cc08ac8fd751916a9a855a7e38ab6976

rq turtle/ttl

Topics through time

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:AreaChart
PREFIX target: <http://www.wikidata.org/entity/Q17012957>

SELECT
  (STR(?year) AS ?year_)
  ?works
  ?topic ?topicLabel
WHERE {
   {
  SELECT
    (COUNT(DISTINCT ?work) AS ?works)
    ?topic
    ?year
  WHERE {
     {
  SELECT
    (COUNT(?work) AS ?works_)
    ?topic
  WHERE {
    ?work wdt:P1433 / wdt:P4745 / wdt:P179 target: ;
          wdt:P921 ?topic .
  }
  GROUP BY ?topic 
  ORDER BY DESC(?works_)
  LIMIT 10
}
    ?work wdt:P1433 / wdt:P4745 / wdt:P179 target: ;
          wdt:P921 ?topic ;
          wdt:P577 ?publication_datetime .
    BIND(YEAR(?publication_datetime) AS ?year)
  }
  GROUP BY ?topic ?year
  ORDER BY DESC(?works)
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh" }
}
ORDER BY DESC(?year)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?publication_datetime") v5("?topic"):::projected v4("?work") v7("?works"):::projected v6("?works_") v7("?year"):::projected v7("?year_") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c10(["en,da,de,es,fr,jp,nl,no,ru,sv,zh"]):::literal c8(["bd:serviceParam"]):::iri c4([http://www.wikidata.org/entity/Q17012957]):::iri v4 --"wdt:P1433"--> a1 a1 --"wdt:P4745"--> a2 a2 --"wdt:P179"--> c4 v4 --"wdt:P921"--> v5 bind1[/"count(?work)"/] v4 --o bind1 bind1 --as--o v6 v4 --"wdt:P1433"--> a3 a3 --"wdt:P4745"--> a4 a4 --"wdt:P179"--> c4 v4 --"wdt:P921"--> v5 v4 --"wdt:P577"--> v6 bind2[/"year-from-dateTime(?publication_datetime)"/] v6 --o bind2 bind2 --as--o v7 bind4[/"count(?work)"/] v4 --o bind4 bind4 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind5[/"str(?year)"/] v7 --o bind5 bind5 --as--o v7