How can I get a list of all film ids from Freebase?

非 Y 不嫁゛ 提交于 2019-12-03 15:35:31

There's no replacement planned for film.tsv right now. You can get the current list of film IDs from the RDF dump like this:

zgrep $'\ttype\.object\.type\tfilm\.film' freebase-rdf.gz

Then when you need to update the list you query the MQL Read API for a list of new films that have been added since your last update:

[{
  "type": "/film/film",
  "id": null,
  "name": null,
  "timestamp": null,
  "timestamp>=": "2013-12",
  "sort": "-timestamp"
}]

Since the API returns 200 results at a time you'll need to use a cursor to get the full list of results.

You can try MQL by just opening the following link.

https://www.googleapis.com/freebase/v1/mqlread?query=[{%22type%22:%20%22/film/film%22,%22id%22:%20null,%22limit%22:300}]&cursor=

You will have to make many requests though.

At each response you receive a cursor that you use as parameter for cursor= at the next request. AFAIK the default limit is 200. You can't increase the limit at will. Maybe the query can be optimized so that the response does not contain the type.

You can edit the query here http://tinyurl.com/pn5o52w At the top right corner you have a 'link' button with a 'MQLRead link' shows you the url to execute. I added the 'cursor=' parameter manually. I thought the query editor offers an option for this but I couldn't find it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!