query-2ffa9c3e4b009fe5ab9e2a2656f6bdf1

rq turtle/ttl

List for complete episods SELECT DISTINCT ?item ?itemLabel ?itemDescription ?series ?seriesLabel ?NmberOfSeason ?season ?seasonLabel ?NumberInTheSeries ?NumberInTheSeason ?pre ?suc ?imdb WHERE { VALUES ?istanza { wd:Q21191270 wd:Q653916 wd:Q73622 }

?item wdt:P31 ?istanza . ?item wdt:P179 wd:Q438406. #Change here for the series

?item wdt:P179 ?series.
?item p:P179 ?statement . ?statement pq:P1545 ?NumberInTheSeries .

?item wdt:P4908 ?season. ?item p:P4908 ?statement2 . ?statement2 pq:P1545 ?NumberInTheSeason .

OPTIONAL {?item wdt:P155 ?pre.} optional{?item wdt:P156 ?suc.}

OPTIONAL {?season p:P179 ?statement3 .} OPTIONAL {?statement3 pq:P1545 ?NmberOfSeason .}

OPTIONAL { ?item wdt:P345 ?imdb.}

SERVICE wikibase:label { bd:serviceParam wikibase:language "it". } } ORDER BY ?series xsd:integer(?NumberInTheSeries)

Use at

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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# List for complete episods
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?series ?seriesLabel ?NmberOfSeason ?season ?seasonLabel ?NumberInTheSeries ?NumberInTheSeason ?pre ?suc ?imdb WHERE {
  VALUES ?istanza { wd:Q21191270 wd:Q653916 wd:Q73622 } 

  ?item wdt:P31 ?istanza .
  ?item wdt:P179 wd:Q438406. #Change here for the series

  ?item wdt:P179 ?series.  
  ?item p:P179 ?statement .
  ?statement pq:P1545 ?NumberInTheSeries .

  ?item wdt:P4908 ?season.
  ?item p:P4908 ?statement2 .
  ?statement2 pq:P1545 ?NumberInTheSeason .

  OPTIONAL {?item wdt:P155 ?pre.}
  optional{?item wdt:P156 ?suc.}

  OPTIONAL {?season p:P179 ?statement3 .}
  OPTIONAL {?statement3 pq:P1545 ?NmberOfSeason .}

  OPTIONAL { ?item wdt:P345 ?imdb.}

  SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
}
ORDER BY  ?series xsd:integer(?NumberInTheSeries)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?NmberOfSeason"):::projected v8("?NumberInTheSeason"):::projected v2("?NumberInTheSeries"):::projected v13("?imdb"):::projected v3("?istanza") v4("?item"):::projected v9("?pre"):::projected v6("?season"):::projected v1("?series"):::projected v5("?statement") v7("?statement2") v11("?statement3") v10("?suc"):::projected c14(["it"]):::literal c12(["bd:serviceParam"]):::iri c3(["wd:Q438406"]):::iri bind0[/VALUES ?istanza/] bind0-->v3 bind00(["wd:Q21191270"]) bind00 --> bind0 bind01(["wd:Q653916"]) bind01 --> bind0 bind02(["wd:Q73622"]) bind02 --> bind0 v4 --"p:direct/P31"--> v3 v4 --"p:direct/P179"--> c3 v4 --"p:direct/P179"--> v1 v4 --"p:P179"--> v5 v5 --"p:qualifier/P1545"--> v2 v4 --"p:direct/P4908"--> v6 v4 --"p:P4908"--> v7 v7 --"p:qualifier/P1545"--> v8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P155".-> v9 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P156".-> v10 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:P179".-> v11 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v11 -."p:qualifier/P1545".-> v12 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P345".-> v13 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end