query-d400d9c8b661de1ddd958f08c45ec656
List of Oscar Best MoviesHi, I was working to create a query to get a list of Oscar Best Movies and their relevant IMDB ID's, so I build this query:
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 ?item ?itemLabel ?IMDb_ID WHERE {
?item wdt:P31 wd:Q11424;
wdt:P166 wd:Q102427.
OPTIONAL { ?item wdt:P345 ?IMDb_ID. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?IMDb_ID"):::projected
v1("?item"):::projected
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
c4(["wd:Q102427"]):::iri
c2(["wd:Q11424"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P166"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P345".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end