query-4b0084222993eef3e613347e6a1a4276
Podcasts
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#>
PREFIX target: <http://www.wikidata.org/entity/Q9027>
SELECT
?episodes
?podcast ?podcastLabel
(CONCAT("#podcast/", SUBSTR(STR(?podcast), 32)) AS ?podcastUrl)
?podcastDescription
WHERE {
{
SELECT
(MAX(?episodes_) AS ?episodes)
?podcast
WHERE {
?podcast wdt:P31 / wdt:P279* wd:Q24634210 ;
wdt:P364| wdt:P407 target:
OPTIONAL { ?podcast wdt:P1113 ?episodes_ }
}
GROUP BY ?podcast
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?episodes)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?episodes"):::projected
v3("?episodes_")
v2("?podcast"):::projected
v4("?podcastUrl")
a1((" "))
c5(["wd:Q9027"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q24634210"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P407"--> c5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P364"--> c5
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1113".-> v3
end
bind1[/"max(?episodes_)"/]
v3 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind2[/"concat('#podcast/',substring(str(?podcast),'32^^xsd:integer'))"/]
v2 --o bind2
bind2 --as--o v4