是否可以在java api中使用" text“MQL扩展,这样就可以获得完整的描述文本。我的意思是像这样的东西:link,但对于java api。
发布于 2011-10-21 06:03:31
您可以在查询信封中使用MQL 参数来启用查询中的扩展。对于Philip在链接问题中给出的示例查询,将如下所示:
JSON query = o(
"id", "/en/jimi_hendrix",
"/common/topic/article", a(o(
"text", o(
"maxlength", 16384,
"chars", null
)
))
);
JSON envelope = o("extended", 1);
JSON params = o();
Freebase freebase = Freebase.getFreebase();
JSON response = freebase.mqlread(query, envelope, params);
String text = response.get("result")
.get("/common/topic/article")
.get(0).get("text")
.get("chars")
.toString();我应该指出的是,MQL扩展是Freebase API的一个实验性功能,在新版本的API中不支持它们。新的API将通过Topic API或直接从text API提供文本。
https://stackoverflow.com/questions/7820106
复制相似问题