A set of SPARQL examples that are used in different TGX resources
License: https://www.gnu.org/licenses/gpl-3.0
Uses method in: https://github.com/WDscholia/scholia/tree/master/scholia/app/templates/podcast_topics.sparql
Podcast aspect: topics
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#defaultView:BubbleChart
PREFIX target: <http://www.wikidata.org/entity/Q124262264>
SELECT ?score ?topic ?topicLabel
WITH {
SELECT
(SUM(?score_) AS ?score)
?topic
WHERE {
{
target: wdt:P921 ?topic .
BIND(20 AS ?score_)
}
UNION
{
SELECT (3 AS ?score_) ?topic WHERE {
?episode wdt:P179 target: ;
wdt:P921 ?topic .
}
}
}
GROUP BY ?topic
} AS %results
WHERE {
INCLUDE %results
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
ORDER BY DESC(?score)
LIMIT 200
graph TD