query-c48e188b223430868df6cf6e8a58ea12

rq turtle/ttl

Items for episodes 13:30, 7 March 2018 (UTC) Jura--- . Wikidata:WikiProject Movies/reports/TV episodes/completeA report with items for every episodes: 13:35, 13 March 2018 (UTC)) talk (Infovarius? --(Q34316)Doctor Who What's wrong with Some 30 items seem to be missing, try:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?item ?itemLabel 
  ?number_of_episodes_in_P1113
  (COUNT(DISTINCT ?ep) as ?actual_number_of_episodes) 
  (SAMPLE(?wd_episode_list) as ?wd_episode_list)
WHERE
{
    BIND( wd:Q34316 as ?item)             
    ?item wdt:P31 wd:Q5398426 ; wdt:P1113 ?number_of_episodes_in_P1113 .
    ?ep wdt:P31 wd:Q21191270 ; wdt:P179 ?item
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
    OPTIONAL { ?item wdt:P1811 ?eplist . ?wd_episode_list schema:about ?eplist ; schema:isPartOf <https://www.wikidata.org/> } 
}
GROUP BY ?item ?itemLabel ?number_of_episodes_in_P1113

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?actual_number_of_episodes") v3("?ep"):::projected v4("?eplist") v1("?item"):::projected v2("?number_of_episodes_in_P1113"):::projected v7("?wd_episode_list"):::projected c13([https://www.wikidata.org/]):::iri c4(["wd:Q21191270"]):::iri c7(["bd:serviceParam"]):::iri c2(["wd:Q5398426"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/"'wd:Q34316'"/] bind0 --as--o v1 v1 --"wdt:P31"--> c2 v1 --"wdt:P1113"--> v2 v3 --"wdt:P31"--> c4 v3 --"wdt:P179"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P1811".-> v4 v7 --"schema:about"--> v4 v7 --"schema:isPartOf"--> c13 end bind3[/"count(?ep)"/] v3 --o bind3 bind3 --as--o v6 bind4[/"sample(?wd_episode_list)"/] v7 --o bind4 bind4 --as--o v7