How can I get list of alias from the query with the name in freebase using a python?
For example, this query
[{
"name": "citigroup",
"/common/topic/alias": []
}]
gives
{
"result": [
{
"/common/topic/alias": [
"Citigroup Inc.",
"TRAVELERS GROUP INC",
"CITIGROUP INC",
"TRAVELERS INC",
"Citi"
],
"name": "Citigroup"
},
{
"/common/topic/alias": [],
"name": "Citigroup"
}
]
}
I want a list
["Citigroup Inc.",
"TRAVELERS GROUP INC",
"CITIGROUP INC",
"TRAVELERS INC",
"Citi"]
I tried with
service_url = 'https://www.googleapis.com/freebase/v1/search'
query = { "name": "citigroup", "/common/topic/alias": []}
params = [{ 'query': json.dumps(query), 'key': key, 'limit':5}]
url = service_url + '?' + urllib.urlencode(params)
response = json.loads(urllib.urlopen(url).read())
But the response does not produce anything... Any help will be greatly appreciated! Thanks