query-5dbfd552bbbefb7c0e87c76f33256d7f
Bates Motel
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 bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT ?episode ?ordinal (CONCAT("S",?season,"E",?episodeInSeason) AS ?SE) ?usPublication ?dePublication ?title ?directorLabel ?duration ?imdb
WHERE {
?seasonQ p:P179 ?seriesBlock .
?seriesBlock v:P179 wd:Q323722 .
?seriesBlock pq:P1545 ?season .
?episode p:P4908 ?seasonBlock .
?seasonBlock v:P4908 ?seasonQ .
?seasonBlock pq:P1545 ?episodeInSeason .
?episode p:P179 ?seriesBlock2 . ?seriesBlock2 v:P179 wd:Q323722 . ?seriesBlock2 pq:P1545 ?ordinal .
OPTIONAL {?episode wdt:P1476 ?title}
OPTIONAL {?episode wdt:P2047 ?duration}
OPTIONAL {?episode wdt:P345 ?imdb}
OPTIONAL {?episode wdt:P57 ?director}
OPTIONAL {?episode p:P577 ?publicationBlock1 . ?publicationBlock1 v:P577 ?usPublication . ?publicationBlock1 pq:P291 wd:Q30}
OPTIONAL {?episode p:P577 ?publicationBlock2 . ?publicationBlock2 v:P577 ?dePublication . ?publicationBlock2 pq:P291 wd:Q183}
SERVICE wikibase:label {bd:serviceParam wikibase:language "en"}
}
ORDER BY ASC(xsd:integer(?ordinal))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v17("?SE")
v16("?dePublication"):::projected
v12("?director")
v10("?duration"):::projected
v5("?episode"):::projected
v7("?episodeInSeason"):::projected
v11("?imdb"):::projected
v1("?ordinal"):::projected
v13("?publicationBlock1")
v15("?publicationBlock2")
v4("?season"):::projected
v6("?seasonBlock")
v2("?seasonQ")
v3("?seriesBlock")
v8("?seriesBlock2")
v9("?title"):::projected
v14("?usPublication"):::projected
c14(["wd:Q30"]):::iri
c19(["en"]):::literal
c17(["bd:serviceParam"]):::iri
c15(["wd:Q183"]):::iri
c3(["wd:Q323722"]):::iri
v2 --"p:P179"--> v3
v3 --"p:statement/P179"--> c3
v3 --"p:qualifier/P1545"--> v4
v5 --"p:P4908"--> v6
v6 --"p:statement/P4908"--> v2
v6 --"p:qualifier/P1545"--> v7
v5 --"p:P179"--> v8
v8 --"p:statement/P179"--> c3
v8 --"p:qualifier/P1545"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P1476".-> v9
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P2047".-> v10
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P345".-> v11
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P57".-> v12
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:P577".-> v13
v13 --"p:statement/P577"--> v14
v13 --"p:qualifier/P291"--> c14
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:P577".-> v15
v15 --"p:statement/P577"--> v16
v15 --"p:qualifier/P291"--> c15
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c17 --"wikibase:language"--> c19
end
bind0[/"concat('S',?season,'E',?episodeInSeason)"/]
v4 --o bind0
v7 --o bind0
bind0 --as--o v17