在GAE上使用python 2.7进行大型Freebase查询

时间:2021-08-14 14:53:56

I need to query about 30000 entities from Freebase using Python on GAE. This has been my evenings journey so far:

我需要在GAE上使用Python从Freebase查询大约30000个实体。到目前为止,这是我的晚上之旅:

Firstly, I attempted to use the solution using the 'cursor' key from here: how to increase freebase API result limit. But I hit the "Key cursor is a reserved word" error described here: Freebase "Key cursor is a reserved word". I followed the solution butI could not see how to get the cursor value back as described here: How to get cursor from mqlread() when using Freebase API?. This post recommends using the python freebase library:

首先,我尝试使用此处使用'cursor'键的解决方案:如何增加freebase API结果限制。但我在这里描述了“Key cursor is a reserved word”错误:Freebase“Key cursor is a reserved words”。我按照解决方案但我无法看到如何获取游标值,如下所述:如何在使用Freebase API时从mqlread()获取游标?这篇文章建议使用python freebase库:

freebase.mqlread(query, extended=True)

So I installed the freebase library on GAE following the instructions here: http://code.google.com/p/freebase-python/wiki/GoogleAppEngine. Next, I got the GAE error:

所以我按照以下说明在GAE上安装了freebase库:http://code.google.com/p/freebase-python/wiki/GoogleAppEngine。接下来,我得到了GAE错误:

No module named uritemplate

So I ran "easy_install uritemplate" on my Mac and copied the installed uritemplate.egg file (no dir was installed) into my GAE app dir. But I still get the same error.

所以我在我的Mac上运行了“easy_install uritemplate”,并将已安装的uritemplate.egg文件(没有安装目录)复制到我的GAE app目录中。但我仍然得到同样的错误。

1 个解决方案

#1


0  

This is an example of how to use cursors: http://wiki.freebase.com/wiki/MQL_Read_Service#cursor:_return_albums_by_Bob_Dylan_3_at_a_time

这是如何使用游标的示例:http://wiki.freebase.com/wiki/MQL_Read_Service#cursor:_return_albums_by_Bob_Dylan_3_at_a_time

You should not use the freebase-python library as it's not updated to deal with the new googleapis yet.

你不应该使用freebase-python库,因为它还没有更新来处理新的googleapis。

#1


0  

This is an example of how to use cursors: http://wiki.freebase.com/wiki/MQL_Read_Service#cursor:_return_albums_by_Bob_Dylan_3_at_a_time

这是如何使用游标的示例:http://wiki.freebase.com/wiki/MQL_Read_Service#cursor:_return_albums_by_Bob_Dylan_3_at_a_time

You should not use the freebase-python library as it's not updated to deal with the new googleapis yet.

你不应该使用freebase-python库,因为它还没有更新来处理新的googleapis。