query-b4758788b1af95df56df475a935f545c
Movie titles, original and translationThis is a query to list movies with a particular actor. I'd like to have a list with original titles and translated titles (here: German). The latter is easy because it's just about specifying that language's code (here: "de"). For the original title I only came up with property P1705 (native label). As you can see from this example, this property is rarely defined, even for Lee, who has participated in some well-known movies. Lee has done mostly US/UK movies, but for the French film Q496000 nothing shows up. For this film, there is a title property (P1476) in French, but other movies may have multiple title properties, and I wouldn't know how to pick the right one. Is there a pragmatic way to get the list I want, maybe by querying various properties and merging them in some elegant manner, giving preference to things like 'native label' when available?
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?film ?filmLabel ?label_de ?natLabel (min(year(?publ)) as ?minYear) WHERE {
?film wdt:P31 wd:Q11424.
?film wdt:P161 wd:Q180338.
?film wdt:P577 ?publ.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
OPTIONAL { ?film rdfs:label ?label_de filter (lang(?label_de) = "de")}.
optional { ?film wdt:P1705 ?natLabel }
} group by ?film ?filmLabel ?label_de ?minYear ?natLabel
ORDER BY asc(?minYear)