Matt
Matt

Reputation: 57

Getting all of the aliases of a certain object in Freebase

I have a massive list of companies, and I am trying to use Freebase to get rid of the same company repeated but slightly varied. My idea is to get all of the ids for a given name, and then use the first id to get a list of all the different names for that company. The problem is that when I query all of the ids for a name, I get an error because there are multiple results. I'm trying to use the method mysqlread(query), but is there another method that will allow for multiple results?

Upvotes: 1

Views: 207

Answers (1)

Tom Morris
Tom Morris

Reputation: 10540

It would help if you provided the failing query. I presume you're actually using mqlread, not mysqlread.

As a guess, you're probably using something like

[{
  "id":"/en/general_motors",
  "/common/topic/alias": null
}]

​where you should be using

[{
  "id":"/en/general_motors",
  "/common/topic/alias": []
}]​

The array notation allows for multiple values.

By the way, if you use Google Refine, it'll do all the work of reconciling against Freebase and ranking matches, then you can just de-dupe based on the Freebase ID for the reconciled topic.

Upvotes: 3

Related Questions