query-af44a33b69c92c1733d286d0442c6ae6
07:32, 15 May 2022 (UTC) 💬 Spinster (if the latter exists). This is beyond my querying skills, and I wonder if it's even possible. Would someone be interested in helping me solve this puzzle? Thanks so much in advance :D ?trailer_video and ?full_length_video a trailer video, and I would like to catch these too, preferably returning both the variables andHowever, this query fails to return those films that have both a full-length video ok? If so:(P3831)object of statement has role Is removing trailers, and other possible
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 DISTINCT ?item ?full_length_video ?t WHERE {
?item (wdt:P31/(wdt:P279*)) wd:Q11424.
?item wdt:P10 ?full_length_video.
?item wdt:P495 wd:Q17.
OPTIONAL { ?item p:P10 [pq:P3831 ?type]. }
# BIND(IF(BOUND(?type), 'trailer (or sth)', 'full (so undefined)') AS ?t )
BIND(IF(BOUND(?type), FALSE, TRUE) AS ?t )
FILTER(?t)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?full_length_video"):::projected
v2("?item"):::projected
v5("?t"):::projected
v4("?type")
a1((" "))
a2((" "))
c6(["wd:Q17"]):::iri
c3(["wd:Q11424"]):::iri
f0[["?t"]]
f0 --> v5
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v2 --"p:direct/P10"--> v3
v2 --"p:direct/P495"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
a2 -."p:qualifier/P3831".-> v4
v2 --"p:P10"--> a2
end
bind1[/"if(bound(?type),'false^^xsd:boolean','true^^xsd:boolean')"/]
v4 --o bind1
bind1 --as--o v5