query-11bece7af3401a854499138edc1e1f46
Nested queryI'm trying to build a nested query and don't know how to put it. In the inner query I want to collect all items which I want to work with in the outer query. The inner query is the following:
Use at
- https://query.wikidata.org/sparql
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?ordinal ?film (COUNT(?release_statement) AS ?releases) WHERE {
?film p:P179 ?series .
?series v:P179 wd:Q689438 .
?series pq:P1545 ?ordinal .
?film p:P577 ?release_statement
}
GROUP BY ?ordinal ?film
HAVING (?releases > 1)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?film"):::projected
v4("?ordinal"):::projected
v5("?release_statement"):::projected
v6("?releases")
v3("?series")
c4(["wd:Q689438"]):::iri
f0[["?releases > '1^^xsd:integer'"]]
f0 --> v6
v2 --"p:P179"--> v3
v3 --"p:statement/P179"--> c4
v3 --"p:qualifier/P1545"--> v4
v2 --"p:P577"--> v5
bind2[/"count(?release_statement)"/]
v5 --o bind2
bind2 --as--o v6