query-fc193d8fa42657fb95e19959f827b117
TV series episodes list by series ordinal (not season) SELECT ?showLabel ?seriesLabel ?seriesOrdinal WHERE { values ?series {wd:Q15711398} #series is The Flash ?show wdt:P31 wd:Q21191270. #show is a television series episode ?show p:P179 ?statement. #show has a P179 claim ?statement pq:P1545 ?seriesOrdinal. #show has a series ordinal ?statement ps:P179 ?series. #show is part of the series SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY xsd:integer(?seriesOrdinal)
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#TV series episodes list by series ordinal (not season)
SELECT ?showLabel ?seriesLabel ?seriesOrdinal WHERE {
values ?series {wd:Q15711398} #series is The Flash
?show wdt:P31 wd:Q21191270. #show is a television series episode
?show p:P179 ?statement. #show has a P179 claim
?statement pq:P1545 ?seriesOrdinal. #show has a series ordinal
?statement ps:P179 ?series. #show is part of the series
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY xsd:integer(?seriesOrdinal)
Query found at
- https://www.wikidata.org/wiki/User:Gonnym/sandbox
- https://www.wikidata.org/wiki/Wikidata_talk:SPARQL_query_service/queries
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?series")
v1("?seriesOrdinal"):::projected
v3("?show")
v4("?statement")
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q21191270"]):::iri
bind0[/VALUES ?series/]
bind0-->v2
bind00(["wd:Q15711398"])
bind00 --> bind0
v3 --"p:direct/P31"--> c2
v3 --"p:P179"--> v4
v4 --"p:qualifier/P1545"--> v1
v4 --"p:statement/P179"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end