主题摘要和图像的Freebase MQL查询?

Eri*_*ver 6 freebase mql

我正在尝试编写一个使用Freebase API 执行的MQL查询.我想检索主题摘要和主题的图像.

我已经能够找到下面的查询,它将获得与比尔盖茨主题相关的图像.

MQL:

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "name" : "bill gates",
    "type" : "/people/person"
  }
]
Run Code Online (Sandbox Code Playgroud)

结果:

[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "name" : "Bill Gates",
    "type" : "/people/person"
  }
]
Run Code Online (Sandbox Code Playgroud)

对于那些过去可能没有遇到MQL但又有兴趣玩它的人.查看Freebase MQL查询编辑器.

billg个人资料页面http://i.friendfeed.com/c31a22d9e439eb67b0feeb4ffd64c3b5ed9a8e16

UPDATE

查询我最终使用:

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "article" : [
      {
        "content" : null
      }
    ],
    "name" : "bill gates",
    "type" : "/common/topic"
  }
]
Run Code Online (Sandbox Code Playgroud)

这些结果可以与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"
  }
]
Run Code Online (Sandbox Code Playgroud)

Sha*_*ter 9

图像和主题摘要分别存储在内容存储库中,并可通过其他Web服务API访问.

例如,比尔盖茨的图像可以像这样访问:

http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000004fb4c01

同样,可以通过在查询中用/ common/topic/article替换/ common/topic/image来找到主题摘要的GUID.可以像这样再次访问结果:

http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000008bfed35

您可以在此处阅读有关内容存​​储的更多信息.


vik*_*ing 6

freebase提供的新图像服务现在可用于使用freebase id获取图像,例如,对于Bill Gates,以下是图像URL:

https://usercontent.googleapis.com/freebase/v1/image/en/bill_gates

有关此服务的更多信息,请访问:http://wiki.freebase.com/wiki/Image_Service

  • `https://usercontent.googleapis.com/freebase/v1/image/en/bill_gates?maxwidth = 225&maxheight = 225&mode = fillcropmid`默认图片相当小. (2认同)