旧的Freebase MQL读取查询无法在新的Google API中使用

时间:2012-07-23 15:07:31

标签: freebase

以下是使用api.freebase.com的旧mqlread查询的示例,该查询返回了一些结果:

https://api.freebase.com/api/service/mqlread?queries={"q0":{"query":{"/common/topic/article":[{"id":null}],"name":"Ethanol","type":"/medicine/drug"}}}

但是,使用新的Google API(www.googleapis.com),此查询会返回一个空的结果对象:

https://www.googleapis.com/freebase/v1/mqlread?query=[{"/common/topic/article":[{"id":null}],"name":"Ethanol 1","type":"/medicine/drug"}]

没有任何关于将应用程序移动到新API的文档,因为我认为它应该非常简单。我错过了一些明显的东西吗?

2 个答案:

答案 0 :(得分:4)

更改您正在查找的主题的名称会被视为“显而易见的东西吗?”它是旧查询中的“乙醇”和新查询中的“乙醇1”(不存在)。

BTW,BLOB API尚未转移到新的API,所以如果你想使用你要提取的文章ID,你需要使用新的Text API。

以下是更正的网址和生成的文字API调用

https://www.googleapis.com/freebase/v1/mqlread?query=[{%22/common/topic/article%22:[{%22id%22:null}],%22name%22:%22Ethanol%22,%22type%22:%22/medicine/drug%22}]&indent=1
https://www.googleapis.com/freebase/v1/text/m/02qw8

编辑:p.s.风中还有一个变化,虽然还没有完全形式化http://markmail.org/message/tjfmhbb3thd5aqrt

答案 1 :(得分:1)

http://wiki.freebase.com/wiki/Freebase_API告诉我们旧的已被弃用。 2012年10月30日应该是最后一次约会..它在日期之前已经停止运作..

我尝试了下面的查询来查看以E开头的所有内容。我找不到您要查找的实体。查询是正确的,可能是实体不再在该域中。

[{
  "/common/topic/article": [{
    "id": null
  }],
  "name" :[]
  "name~=": "E*",
  "type": "/medicine/drug"
}​]​