from wikipedia title to freebase mid

99封情书 提交于 2019-12-11 19:16:29

问题


Is there a way to map Wikipedia title link to Freebase mids?

For example, wikipedia titles are:

From_Russia_with_Love_(film), John_Barry_(composer), Lionel_Bart, Matt_Monro

 [{ "mid": null, "id": "/en/matt_monro" }]

It works for titles like "Matt_Monro", "Lionel_Bart", but not "from_russia_with_love_(film)" or "john_barry_(composer)"

Any suggestions please?


回答1:


The correct key to use is /wikipedia/en_title/Matt_Monro. There's no guarantee that /en/matt_monro points the same place (and newer topics don't have keys in the `/en' namespace).

The Wikipedia titles which contain special characters, they need to be encoded using Freebase's key escaping scheme http://wiki.freebase.com/wiki/MQL_key_escaping For your first example, the key would be /wikipedia/en_title/From_Russia_with_Love_$0028film$0029



来源:https://stackoverflow.com/questions/22276278/from-wikipedia-title-to-freebase-mid

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