检索多篇文章和放大器;通过新的游离碱API图片 [英] Retrieving multiple articles & images via the new Freebase API

查看:113
本文介绍了检索多篇文章和放大器;通过新的游离碱API图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要得到的文章文字和放大器;图片一束从Freebase主题的。使用旧的API,这是容易的,无论是通过MQL扩展或主题API(现在也去precated?)。不过现在什么是通过新的API这样做的最佳方式?

I want to get the article text & images for a bunch of topics from freebase. Using the old API this was easy, via either MQL extensions or the topic API (also now deprecated?). But what is now the best way of doing this via the new API?

我从文档看,我可以得到文本为个人的话题,像这样的:

I see from the docs I can get the text for an individual topic, like this:

https://www.googleapis.com/freebase/v1/text/ EN / bob_dylan

所以我可以通过每个主题一个接一个,但它似乎慢有打API,因此很多时候,尤其是当我只需要前一个循环。我失去了检索文字/图片多个主题的一些巧妙的方式?

So I could loop through each topic one by one, but it seems slow to have to hit the API so many times, especially when I only needed one before. Am I missing some clever way of retrieving text / images for multiple topics?

干杯,

推荐答案

有可能使用JSON-RPC做了/文多次调用 - 的 http://en.wikipedia.org/wiki/JSON-RPC

It is possible to do multiple calls for /text using JSON-RPC - http://en.wikipedia.org/wiki/JSON-RPC

下面是一个例子:
卷曲https://www.googleapis.com/rpc-d[{方法:freebase.text.get','apiVersion':'V1','参数':{'ID':'恩','bob_dylan']}},{方法:freebase.text.get','apiVersion':'V1','参数':{'编号':[成en,blade_runner']} }]-H内容类型:应用程序/ JSON

Here's an example: curl "https://www.googleapis.com/rpc" -d "[{'method': 'freebase.text.get', 'apiVersion': 'v1', 'params': {'id': ['en','bob_dylan']}},{'method': 'freebase.text.get', 'apiVersion': 'v1', 'params': {'id': ['en','blade_runner']}}]" -H "Content-Type: application/json"

我们正在努力改进我们的文档这样做,但这应该让你去。

We are working on improving our documentation for doing this but this should get you going.

要调用的方法的名称是freebase.text.get和其余参数都记录在这里:
http://wiki.freebase.com/wiki/ApiText#Parameters
你可以通过使用一个id参数的ID。

The name of the method you want to call is freebase.text.get and the rest of the parameters are documented here: http://wiki.freebase.com/wiki/ApiText#Parameters You can pass the id using an "id" parameter.

究竟你在找的图片?你会如何​​取回多个二进制内容?

What exactly are you looking for for images ? How would you get back multiple binary content ?

这篇关于检索多篇文章和放大器;通过新的游离碱API图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆