query-3d8765c737e05be84eae4d21ed0265e5
Topics
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?reports
(CONCAT("#topic/", SUBSTR(STR(?topic), 32), "/eiareport") AS ?reportsUrl)
?topic ?topicLabel
(CONCAT("#topic/", SUBSTR(STR(?topic), 32)) AS ?topicUrl)
?topicDescription
("Scholia ↗" AS ?scholia)
(CONCAT("https://scholia.toolforge.org/topic/", SUBSTR(STR(?topic), 32)) AS ?scholiaUrl)
WHERE {
{
SELECT
(COUNT(DISTINCT ?report) AS ?reports)
?topic
WHERE {
?report wdt:P31 wd:Q64548048 ;
wdt:P921 / wdt:P31? ?topic .
}
GROUP BY ?topic
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?reports)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?report")
v4("?reports"):::projected
v4("?reportsUrl")
v6("?scholia")
v7("?scholiaUrl")
v3("?topic"):::projected
v5("?topicUrl")
a1((" "))
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q64548048"]):::iri
v2 --"wdt:P31"--> c2
v2 --"wdt:P921"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P31"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
bind1[/"count(?report)"/]
v2 --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('#topic/',substring(str(?topic),'32^^xsd:integer'),'/eiareport')"/]
v3 --o bind2
bind2 --as--o v4
bind3[/"concat('#topic/',substring(str(?topic),'32^^xsd:integer'))"/]
v3 --o bind3
bind3 --as--o v5
bind4[/"'Scholia ↗'"/]
bind4 --as--o v6
bind5[/"concat('https://scholia.toolforge.org/topic/',substring(str(?topic),'32^^xsd:integer'))"/]
v3 --o bind5
bind5 --as--o v7