开发者

Freebase MQL VS Freebase Suggest (n:type) in results

开发者 https://www.devze.com 2023-03-02 17:33 出处:网络
i\'m try to get results from freebase using mql, for example: ht开发者_JAVA技巧tp://api.freebase.com/api/service/mqlread?query={\"query\":{\"name~=\":\"Barack\",\"name\":null,\"type\":[],\"limit\":1

i'm try to get results from freebase using mql, for example:

ht开发者_JAVA技巧tp://api.freebase.com/api/service/mqlread?query={"query":{"name~=":"Barack","name":null,"type":[],"limit":1}}"

And as expected i'm get much types for this topic(Barack Obama).

But when i try to search "Barack" with freebase suggest i'm get only one (n:type or notable type)type for "Barack Obama" - US President. Example: http://www.freebase.com/private/suggest?prefix=barack

My question is - how can i get the same result as suggested using only MQL?


You're pretty much there with the second link you found - it's now just a matter of combining the two queries:

http://api.freebase.com/api/service/mqlread?query={"extended":true,"query":[{"name~=":"^Barack","id":null,"name":null,"type":"/common/topic","notable_for":{}}]}

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消