问题
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