AhmadAssaf
AhmadAssaf

Reputation: 3654

Query Freebase for a list of data types that match a specific string

I want to query freebase and get a list of datatypes for a string .. for example if i have a string "jordan" then i want a list of types that can be country, basketball player ... etc.

I would appreciate if someone can point out the MQL query as i dont know the type of the result yet.

Thanks

Upvotes: 1

Views: 135

Answers (1)

Philip Kendall
Philip Kendall

Reputation: 4314

[{ "id": null, "name": null, "type": "/type/type", "instance": { "name~=": "jordan", "id": null, "name": null, "limit": 1 } }]

Note that MQL returns only the first 100 results by default; you'll either to have increase the limit or use cursors to get all the results.

While I'm aware it's not an MQL query directly, you may want to consider using the Freebase Search API rather than MQL to do this kind of thing - for example, do you want to find things with an alias of "Jordan" as well as things with the primary name?

Upvotes: 1

Related Questions