1

When I go to Freebase.com and search for bush (for example), I get suggestions like George Bush, Kate Bush, George H.W. Bush etc.

How can I get that list as IDs from the query api?

I am trying to get the a list, like this, of ids for a particular name:

[{
 "id": null,
 "name": "bush",
}]
Scott
  • 21,211
  • 8
  • 65
  • 72
Knight
  • 223
  • 2
  • 10

1 Answers1

2

You can use the search API

https://www.googleapis.com/freebase/v1/search?query=bush

or if you want to use MQL, use can use the contains operator (~=)

https://www.googleapis.com/freebase/v1/mqlread?query=[{%22name~=%22:%20%22bush%22,%20%22id%22:null}]

The contains operator does whole word matching by default. If you want partial word matches, you can add additional wild cards, but you risk running into timeouts, particularly for leading wildcards.

https://www.googleapis.com/freebase/v1/mqlread?query=[{%22name~=%22:%20%22*bush*%22,%20%22id%22:null}]
Tom Morris
  • 10,490
  • 32
  • 53
  • Thanks! That was the answer I was looking for! – Knight Sep 17 '12 at 14:34
  • Also, if I wanted to use the $as_of_time$ property here, how can we modify so that we get a specific output? – Knight Sep 17 '12 at 15:19
  • as_of_time is just a URL parameter that you can add onto the end like this: https://www.googleapis.com/freebase/v1/mqlread?query=[{...}]&as_of_time=2009-01-22 – Shawn Simister Sep 18 '12 at 00:32