0

I want to get the IMDb ID of all films in a list page on Wikipedia, for example: https://en.wikipedia.org/wiki/List_of_neo-noir_films

I've tried making a query like this: (instance of: film, genre: neo-noir)

SELECT ?film ?filmLabel ?IMDb_ID WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?film wdt:P31 wd:Q11424;
    wdt:P136 wd:Q2421031.
  OPTIONAL { ?film wdt:P345 ?IMDb_ID. }
}

but the list it returned is not the same as that list page. Could someone please help me with this?

privil
  • 3
  • 1
  • Can you expand on what the difference is? Are there some films missing from Wikidata that are on the wikipedia list? If so which? You might want to try adding `/wdt:P279*` after `wdt:P31` and `wdt:P136`. This will return works that are classified as some subclass of films with genres that are a subclass of neo-noir. It adds 24 results to what your query showed. – Valerio Cocchi Jan 20 '22 at 10:26
  • @ValerioCocchi Thanks. I've tried your solution, it still doesn't give the complete list of movies. There are 775 titles in that wiki page. An example not in the results is: https://en.wikipedia.org/wiki/Wrath_of_Man – privil Jan 20 '22 at 17:01
  • 1
    It looks like this specific film's genre is listed as 'action film' instead of 'neo-noir'. I suppose that Wikidata and Wikipedia may not always be in sync. – Valerio Cocchi Jan 20 '22 at 17:22
  • @privil You can find the info missing in wikidata using [the petscan query](https://petscan.wmflabs.org/?psid=21312169) and fix the wikidata. – arjunaraoc Jan 25 '22 at 05:49

0 Answers0