query-1b39062c97f190beba95c81152414a42
List of filmsHello, 00:54, 29 January 2020 (UTC)) talk (Alex BlokhaI need a list of 2019 films, where played Leo Dicaprio, Stallone and Tom Cruz (popular actors). Actually I need a list of 2019 films, where played popular actors, but its hard to automatically find out popular actors . --22:09, 29 January 2020 (UTC)) talk (Dipsacus fullonumBelow is some code. You can add Q-values (wd:Qxxxxxx) in the VALUES part for any actors you will include in the list. --
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?film ?filmLabel ?actorLabel
WHERE {
?film wdt:P31/wdt:P279* ?Q11424.
?film wdt:P577 ?date.
filter(substr(str(?date),1,4) = "2019")
?film wdt:P161 ?actor.
VALUES ?actor {
wd:Q38111 # Leo Dicaprio
wd:Q40026 # Sylvester Stallone
}.
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("?Q11424")
v5("?actor")
v1("?date")
v2("?film"):::projected
a1((" "))
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["substring(str(?date),'1^^xsd:integer','4^^xsd:integer') = '2019'"]]
f0 --> v1
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v3
v2 --"wdt:P577"--> v1
v2 --"wdt:P161"--> v5
bind1[/VALUES ?actor/]
bind1-->v5
bind10(["wd:Q38111"])
bind10 --> bind1
bind11(["wd:Q40026"])
bind11 --> bind1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end