How to get cursor from mqlread() when using Freebase API?

我的未来我决定 提交于 2019-12-01 13:42:28

I found that the Freebase-Python module actually includes a method that takes care of cursoring for you. Just call mqlreaditer(query, extended=true), and that will return a Python generator that you can iterate through. Behind the scenes the Freebase module will query and keep track of the cursor, return results on demand until a "false" cursor is reached.

Very simple!

Support for MQL envelope parameters was dropped, presumably accidentally, in the 1.0.8 release of the Freebase Python library.

If not don't need MQL extensions, you can just drop the parameter extended=True parameter and use mqlreaditer(query).

If you need MQL extensions (or other envelope parameters), you'll have to fall back to 1.0.6 until someone fixes the problem and does a new release.

 sudo easy_install freebase==1.0.6
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!