query-7914f01df4de0a2037d7098428d0ef63
Optimize film query to return full-length videos regardless of the presence of a trailer video qualifier). Example retrieving films with full-length videos (but not having any trailer videos) from Japan: (Q622550)trailer (P3831)object of statement has role statement with (P10)video a trailer video (not statement) but (P10)video , I have constructed a very simple query that retrieves films from Wikidata which have a full length video (bare hobby project prototyping a public domain and CC-licensed film browserHi! For a
Use at
- https://query.wikidata.org/sparql
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/>
SELECT ?item ?full_length_video WHERE {
?item (wdt:P31/(wdt:P279*)) wd:Q11424.
?item wdt:P10 ?full_length_video.
?item wdt:P495 wd:Q17.
MINUS { ?item p:P10 [pq:P3831 wd:Q622550]. }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?full_length_video"):::projected
v1("?item"):::projected
a1((" "))
a2((" "))
c6(["wd:Q17"]):::iri
c8(["wd:Q622550"]):::iri
c3(["wd:Q11424"]):::iri
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v1 --"p:direct/P10"--> v2
v1 --"p:direct/P495"--> c6
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
a2 --"p:qualifier/P3831"--> c8
v1 --"p:P10"--> a2
end