query-865d022d6c9a15b28bc780bdc674ea38
Getting television series (Q5398426) without Trakt.tv ID (P8013)Hey folks. I tried to build my own query for my Pywikibot bot but I can't get it to work to what I want, so I need some help. has one. (Q5398426)television series but the related (P8013)Trakt.tv ID that doesn't have (Q21191270)television series episode I got a query working to get
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?episode ?episodeLabel ?episodeTraktId ?series ?seriesLabel ?seriesTraktId
WHERE {
?episode p:P31 ?instanceOf.
?instanceOf (ps:P31/(wdt:P279*)) wd:Q21191270.
MINUS {
{
?episode p:P8013 ?episodeTraktId.
?episodeTraktId (ps:P8013) _:anyValueP8013.
}
}
?episode wdt:P179 ?series.
?series wdt:P8013 ?seriesTraktId.
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;
v1("?episode"):::projected
v3("?episodeTraktId"):::projected
v2("?instanceOf")
v4("?series"):::projected
v5("?seriesTraktId"):::projected
a2((" "))
a1((" "))
c10(["bd:serviceParam"]):::iri
c12(["en,#91;AUTO_LANGUAGE#93;"]):::literal
c4(["wd:Q21191270"]):::iri
v1 --"p:P31"--> v2
v2 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c4
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:P8013"--> v3
v3 --"p:statement/P8013"--> a2
end
v1 --"p:direct/P179"--> v4
v4 --"p:direct/P8013"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end