query-a47e81ddc6d275652762cbb39ef1695f

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

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

WHERE {
   {
  SELECT
    (SUM(?score_) AS ?score)
    ?topic
  WHERE {
    { 
      target: wdt:P921 ?topic .
      BIND(20 AS ?score_)
    }
    UNION
    { 
      target: wdt:P921 / wdt:P31 ?topic .
      BIND(5 AS ?score_)
    }
    UNION
    { 
     target: wdt:P921/wdt:P279 ?topic .
     BIND(3 AS ?score_)
    }
    UNION
    {
      # Topic of a cited work
      target: wdt:P2860/wdt:P921 ?topic .
      BIND(1 AS ?score_)
    }
    UNION
    {
      SELECT (1 AS ?score_) ?topic WHERE {
        ?citing_work wdt:P2860 target: .
        ?citing_work wdt:P921 ?topic . 
      }
    }
  }
  GROUP BY ?topic
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,da,de,es,jp,no,ru,sv,zh". }
}
ORDER BY DESC(?score)
LIMIT 200

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?citing_work") v5("?score"):::projected v5("?score_") v2("?topic"):::projected v5("?topicUrl") a1((" ")) a2((" ")) a3((" ")) c1([http://www.wikidata.org/entity/Q113616501]):::iri c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en,da,de,es,jp,no,ru,sv,zh"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P2860"--> c1 v4 --"wdt:P921"--> v2 bind0[/"'1^^xsd:integer'"/] bind0 --as--o v5 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P2860"--> a3 a3 --"wdt:P921"--> v2 bind1[/"'1^^xsd:integer'"/] bind1 --as--o v5 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P921"--> a2 a2 --"wdt:P279"--> v2 bind2[/"'3^^xsd:integer'"/] bind2 --as--o v5 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P921"--> a1 a1 --"wdt:P31"--> v2 bind3[/"'5^^xsd:integer'"/] bind3 --as--o v5 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P921"--> v2 bind4[/"'20^^xsd:integer'"/] bind4 --as--o v5 end union0r <== or ==> union0l end bind6[/"sum(?score_)"/] v5 --o bind6 bind6 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind7[/"concat('#topic/',substring(str(?topic),'32^^xsd:integer'))"/] v2 --o bind7 bind7 --as--o v5