Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Freebase Java API全文检索_Java_Freebase_Mql - Fatal编程技术网

Freebase Java API全文检索

Freebase Java API全文检索,java,freebase,mql,Java,Freebase,Mql,是否可以将“text”MQL扩展与JavaAPI一起使用,以便获得完整的描述文本。 我的意思是这样的:但是对于java api。您可以在查询信封中使用extended参数来在查询中启用MQL扩展。Philip在链接问题中给出的示例查询如下: JSON query = o( "id", "/en/jimi_hendrix", "/common/topic/article", a(o( "text", o( "maxlength", 16384, "chars

是否可以将“text”MQL扩展与JavaAPI一起使用,以便获得完整的描述文本。
我的意思是这样的:但是对于java api。

您可以在查询信封中使用extended参数来在查询中启用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将通过主题API或直接从文本API提供文本。

您能告诉我为什么我无法检索某些主题(如“泰晤士河”)的信息(文本),而我可以检索属于同一类别的其他主题(如码头区)?其他查询(如地理位置(lat/long))也会发生同样的情况…您能分享您使用的确切查询吗?我能够获得“泰晤士河”而没有任何类似的问题:JSON query=o(“id”、“/en/River_Thames”、“/common/topic/article”、a(o(“text”,o(“maxlength”,16384,“chars”,null));是的,你对文本的看法是对的,但是地理位置呢?这不仅仅是Java的问题:简短的回答是,泰晤士河还没有输入lat/long。如果您想要更详细的答案,请将此作为单独的问题重新发布。