简体   繁体   English

Freebase Search API-获取所有结果

[英]Freebase Search API - Get All Results

Is it possible now to get all results from Freebase Search API? 现在可以从Freebase Search API获取所有结果吗?

Today I was trying 2 approaches in Java: 今天,我正在尝试两种Java方法:

  1) www.googleapis.com/freebase/v1/search?filter=..."
   Using "cursor"(integer) and "limit" options.

  2) www.freebase.com/ajax/156b.lib.www.tags.svn.freebase-site.googlecode.dev/cuecard/mqlread.ajax?&query=
   Try to simulate 'Query Editor' (https://www.freebase.com/query)
   Using "cursor" from the previous results set (String).

But in both of these approaches I got only 但是在这两种方法中,我只有

       - 200 (first option)
       - 500 (second option)

records (should be about 6000 records) ... 记录(应为约6000条记录)...

After several iterations I have got 经过几次迭代,我得到了

            - "Request too large, cursor: 200, limit: 200" (first option, only 1 iteration)
            - "cursor is false" (second option, 6 iterations)

message. 信息。

Is it Freebase problem or may be API limitations? 是Freebase问题还是API限制?

How could I get all results? 我怎么能得到所有结果?

Without specifics it's a little difficult to say what the problem is, but the Search API is definitely not intended to return complete results. 没有细节,很难说出问题是什么,但是Search API绝对不是要返回完整的结果。 The MQLRead API should return complete results, although I'd consider 6K results to be towards the upper end of its intended usage. MQLRead API应该返回完整的结果,尽管我认为6K结果接近其预期用途的上限。 If you're not going an error like "Query too hard," I suspect that there's something in your query which is unintentionally limiting it in ways you don't expect. 如果您没有出现“查询太难”之类的错误,我怀疑您的查询中有某些内容会以您意想不到的方式无意中限制了它。

The other way to get large amounts of information from Freebase is to extract it from the data dumps. 从Freebase获取大量信息的另一种方法是从数据转储中提取信息。

NOTE: Freebase is no longer being updated and both the MQLRead and Search APIs will be going away shortly (although Google has said that the Search API will be replaced with a Knowledge Graph based equivalent). 注意:Freebase不再更新,并且MQLRead和Search API都将很快消失(尽管Google表示Search API将被基于知识图的等效物替代)。

UPDATE: When I run the query from the comment below with "return":"count", I get a value of 536 which matches with the reported results of six iterations using the cursor. 更新:当我从下面的注释中使用“ return”:“ count”运行查询时,我得到的值为536,它与使用游标报告的六次迭代的结果相匹配。

Note that MQLRead does NOT compute the transitive closure for places like birthplace, so querying for people born in Portugal, will not return people listed as being born in Lisbon (another 1143 people.) 需要注意的是MQLRead 计算像发源地的地方传递闭包,所以查询出生在葡萄牙的人,不会返回列为出生在里斯本人(另一人1143)。

The Search API will return the transitive closure, although I'm not sure it's guaranteed to be complete. Search API将返回传递闭包,尽管我不确定它是否一定会完成。 It's really designed & tuned to return the top few best matches, not exhaustive lists, but if you want to experiment with it, you can use this query in the example app: 它确实经过了设计和调整,可以返回前几项最佳匹配,而不是详尽的列表,但是如果您要尝试使用它,可以在示例应用程序中使用以下查询:

http://freebase-search.freebaseapps.com/?filter=(all+type%3A%2Fpeople%2Fperson+%2Fpeople%2Fperson%2Fplace_of_birth%3APortugal)&output=(%2Fpeople%2Fperson%2Fplace_of_birth%7Bintrinsic%7D+(%2Fpeople%2Fperson%2Fplace_of_birth+))&limit=10&scoring=entity&lang=en http://freebase-search.freebaseapps.com/?filter=(all+type%3A%2Fpeople%2Fperson+%2Fpeople%2Fperson%2Fplace_of_birth%3APortugal)&output=(%2Fpeople%2Fperson%2Fplace_of_birth%7Bintrinsic%7D+(%2Fpeople %2Fperson%2Fplace_of_birth +))&限制= 10&得分=实体郎= EN

or it's raw API equivalent: 或等同于原始API:

https://www.googleapis.com/freebase/v1/search?limit=10&scoring=entity&filter=(all+type%3A%2Fpeople%2Fperson+%2Fpeople%2Fperson%2Fplace_of_birth%3APortugal)&output=(%2Fpeople%2Fperson%2Fplace_of_birth%7Bintrinsic%7D+(%2Fpeople%2Fperson%2Fplace_of_birth+))&lang=en&indent=true https://www.googleapis.com/freebase/v1/search?limit=10&scoring=entity&filter=(all+type%3A%2Fpeople%2Fperson+%2Fpeople%2Fperson%2Fplace_of_birth%3APortugal)&output=(%2Fpeople%2Fperson%2Fplace_of_birth %7Bintrinsic%7D +(%2Fpeople%2Fperson%2Fplace_of_birth +))&郎= EN&缩进=真

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM