query-eeba6753994a527a1b9ffef4de5838f9
TODO
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#>
#defaultView:Timeline
# use the earliest publication date in case a film has multiple publication dates, e.g. in different markets
# (and I’m sure the Titanic film was also re-released theatrically, and maybe somebody added that as a statement too)
SELECT ?film ?filmLabel ?filmPublished
WHERE {
{
SELECT ?film (MIN(?filmPublished_) AS ?filmPublished) WHERE {
?film wdt:P31/wdt:P279* wd:Q11424;
p:P161/ps:P161 wd:Q38111;
wdt:P577 ?filmPublished_.
}
GROUP BY ?film
}
{
SELECT (MIN(?titanicPublished_) AS ?titanicPublished) WHERE {
wd:Q44578 wdt:P577 ?titanicPublished_.
}
}
FILTER(?filmPublished < ?titanicPublished)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?film"):::projected
v5("?filmPublished"):::projected
v4("?filmPublished_")
v6("?titanicPublished")
v5("?titanicPublished_")
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c6(["wd:Q38111"]):::iri
c8(["wd:Q44578"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q11424"]):::iri
f0[["?filmPublished < ?titanicPublished"]]
f0 --> v5
f0 --> v6
v3 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v3 --"p:P161"--> a2
a2 --"p:statement/P161"--> c6
v3 --"p:direct/P577"--> v4
bind2[/"min(?filmPublished_)"/]
v4 --o bind2
bind2 --as--o v5
c8 --"p:direct/P577"--> v5
bind4[/"min(?titanicPublished_)"/]
v5 --o bind4
bind4 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end