query-a386214a82621f3b3a3797730940b200

rq turtle/ttl

television series episode or television pilot without P1545

SELECT ?istanzaLabel ?item ?itemLabel ?serie ?serieLabel ?date ?parte ?parteLabel ?seriesW ?seriesW2 WHERE { VALUES ?istanza { wd:Q21191270 wd:Q653916 wd:Q50062923 wd:Q21664088 wd:Q29197 }

?item wdt:P31 ?istanza . ?item wdt:P179 ?serie. #?item wdt:P361 ?parte. ?item wdt:P4908 ?parte. ?item p:P179 ?statement . #?item p:P361 ?statement2 . ?item p:P4908 ?statement2 . OPTIONAL {?item wdt:P1191 ?date.}

OPTIONAL {?statement pq:P1545 ?seriesW .} OPTIONAL {?statement2 pq:P1545 ?seriesW2 .}

FILTER (!bound( ?seriesW )). FILTER (!bound( ?seriesW2 )). SERVICE wikibase:label { bd:serviceParam wikibase:language "it". } }

ORDER BY ?serie ?date

Use at

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#>
# television series episode or television pilot  without P1545

SELECT ?istanzaLabel ?item ?itemLabel ?serie ?serieLabel ?date ?parte ?parteLabel ?seriesW ?seriesW2 WHERE {
  VALUES ?istanza { wd:Q21191270 wd:Q653916 wd:Q50062923 wd:Q21664088 wd:Q29197 } 

  ?item wdt:P31 ?istanza .
  ?item wdt:P179 ?serie.
  #?item wdt:P361 ?parte.
  ?item wdt:P4908 ?parte.
  ?item p:P179 ?statement .
  #?item p:P361 ?statement2 .
  ?item p:P4908 ?statement2 .
  OPTIONAL {?item wdt:P1191 ?date.}

  OPTIONAL {?statement pq:P1545 ?seriesW .}
  OPTIONAL {?statement2 pq:P1545 ?seriesW2 .}

  FILTER (!bound( ?seriesW )).
  FILTER (!bound( ?seriesW2 )).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
}

ORDER BY  ?serie ?date

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?date"):::projected v5("?istanza") v6("?item"):::projected v7("?parte"):::projected v1("?serie"):::projected v4("?seriesW"):::projected v3("?seriesW2"):::projected v8("?statement") v9("?statement2") c9(["bd:serviceParam"]):::iri c11(["it"]):::literal f0[["not bound(?seriesW2)"]] f0 --> v3 f1[["not bound(?seriesW)"]] f1 --> v4 bind2[/VALUES ?istanza/] bind2-->v5 bind20(["wd:Q21191270"]) bind20 --> bind2 bind21(["wd:Q653916"]) bind21 --> bind2 bind22(["wd:Q50062923"]) bind22 --> bind2 bind23(["wd:Q21664088"]) bind23 --> bind2 bind24(["wd:Q29197"]) bind24 --> bind2 v6 --"p:direct/P31"--> v5 v6 --"p:direct/P179"--> v1 v6 --"p:direct/P4908"--> v7 v6 --"p:P179"--> v8 v6 --"p:P4908"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P1191".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:qualifier/P1545".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:qualifier/P1545".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end