query-769e26bd707763315fad3733e6187b74

rq turtle/ttl

TODO

Use at

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#>
SELECT DISTINCT ?episode ?episodeLabel ?episodeTraktId ?series ?seriesLabel ?seriesTraktId  ?series_partTraktId
WHERE {  

  ?episode wdt:P31/wdt:P279* wd:Q21191270. 
  OPTIONAL {?episode wdt:P8013 ?episodeTraktId . }
  ?episode wdt:P179 ?series.
  OPTIONAL {?series wdt:P8013 ?seriesTraktId. 

  OPTIONAL {?series wdt:P527 ?series_part .
  ?series_part wdt:P8013 ?series_partTrakID . }
  }
   FILTER(!BOUND(?episodeTraktId) && !BOUND(?seriesTraktId)|| 
          !BOUND(?episodeTraktId) && !BOUND(?series_partTraktId) || 
          !BOUND(?seriesTraktId) && !BOUND(?series_partTraktId) && BOUND(?series_part)
         )

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }
} LIMIT 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?episode"):::projected v1("?episodeTraktId"):::projected v6("?series"):::projected v2("?seriesTraktId"):::projected v4("?series_part") v7("?series_partTrakID") v3("?series_partTraktId"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c10(["en,#91;AUTO_LANGUAGE#93;"]):::literal c3(["wd:Q21191270"]):::iri f0[["(not bound(?episodeTraktId)not bound(?seriesTraktId) || (not bound(?episodeTraktId)not bound(?series_partTraktId) || not bound(?seriesTraktId)not bound(?series_partTraktId)bound(?series_part)))"]] f0 --> v1 f0 --> v2 f0 --> v3 f0 --> v4 v5 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P8013".-> v1 end v5 --"wdt:P179"--> v6 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P8013".-> v2 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P527".-> v4 v4 --"wdt:P8013"--> v7 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end