Freebase Java API全文检索 [英] Freebase Java API full text retrieval
问题描述
是否可以将textMQL扩展名与java api一起使用,这样您就可以获得完整的描述文本。
我的意思是这样的:链接但是对于java api 。
Is it possible to use the "text" MQL extension with the java api, so you can get the full description text. I mean sth like this:link but for the java api.
推荐答案
您可以使用查询信封中的扩展参数在查询中启用MQL扩展名。使用Philip在链接问题中给出的示例查询,如下所示:
You can use the extended parameter in the query envelope to enable MQL extensions in your query. With the example query that Philip gave in the linked question, that would look like this:
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提供文本。
I should point out that MQL extensions are an experimental feature of the Freebase API and they are not supported in the new version of the API. The new API will provide text either through the Topic API or directly from the Text API.
这篇关于Freebase Java API全文检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!