Freebase MQL 查询主题摘要和图像?
我正在尝试编写要使用 MQL 查询 ://www.freebase.com/" rel="noreferrer">Freebase API。 我想检索主题摘要和该主题的图像。
我已经能够计算出以下查询,它将为我提供与比尔·盖茨 主题。
MQL:
[
{
"/common/topic/image" : [
{
"id" : null
}
],
"name" : "bill gates",
"type" : "/people/person"
}
]
结果:
[
{
"/common/topic/image" : [
{
"id" : "/guid/9202a8c04000641f8000000004fb4c01"
},
{
"id" : "/wikipedia/images/commons_id/4486276"
}
],
"name" : "Bill Gates",
"type" : "/people/person"
}
]
适合那些过去可能没有接触过 MQL 但有兴趣使用它的人。 查看 Freebase MQL 查询编辑器。
账单个人资料页面http://i.friendfeed.com/c31a22d9e439eb67b0feeb4ffd64c3b5ed9a8e16
更新
查询我最终使用的:
[
{
"/common/topic/image" : [
{
"id" : null
}
],
"article" : [
{
"content" : null
}
],
"name" : "bill gates",
"type" : "/common/topic"
}
]
这些结果可以与 narphorium 的答案结合起来检索实际数据:
[
{
"/common/topic/image" : [
{
"id" : "/guid/9202a8c04000641f8000000004fb4c01"
},
{
"id" : "/wikipedia/images/commons_id/4486276"
}
],
"article" : [
{
"content" : null
},
{
"content" : "/guid/9202a8c04000641f800000000903535d"
}
],
"name" : "Bill Gates",
"type" : "/common/topic"
}
]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
图像和主题摘要单独存储在内容存储中,可通过另一个 Web 服务 API。
例如,比尔盖茨的图像可以这样访问:
http://www. freebase.com/api/trans/raw/guid/9202a8c04000641f8000000004fb4c01
同样,可以通过在查询中将 /common/topic/image 替换为 /common/topic/article 来找到主题摘要的 GUID。 可以像这样再次访问结果:
http://www.freebase.com/ api/trans/raw/guid/9202a8c04000641f8000000008bfed35
您可以在此处了解有关内容存储的更多信息< /a>.
The images and topic summaries are stored separately in the content store and are accessible via another web service API.
For example, Bill Gates' image can be accessed like this:
http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000004fb4c01
Similarly, the GUID for the topic summary can be found by replacing /common/topic/image with /common/topic/article in your query. The results can be accessed again like this:
http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000008bfed35
You can read more about the content store here.
freebase 提供的新图像服务现在可用于使用 freebase id 获取图像,例如,对于 Bill Gates,以下是图像 URL:
https://usercontent.googleapis.com/freebase/v1/image/en/bill_gates
有关此服务的更多信息,请访问:http://wiki.freebase.com/wiki/Image_Service
The new image service provided by freebase can now be used to get the images using the freebase ids, e.g., for Bill Gates following is the image URL:
https://usercontent.googleapis.com/freebase/v1/image/en/bill_gates
More about this service can be found at: http://wiki.freebase.com/wiki/Image_Service