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

发布于 2024-07-15 20:01:56 字数 1858 浏览 9 评论 0 原文

我正在尝试编写要使用 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"
  }
]

I'm trying to write an MQL query to be executed using Freebase API's. I would like to retrieve the topic summary and the image for the topic.

I have been able to work out the below query which will get me the images associated with the Bill Gates topic.

MQL:

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "name" : "bill gates",
    "type" : "/people/person"
  }
]

Results:

[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "name" : "Bill Gates",
    "type" : "/people/person"
  }
]

For those that may have not run into MQL in the past but are interested in playing around with it. Check out the Freebase MQL Query Editor.

billg profile page http://i.friendfeed.com/c31a22d9e439eb67b0feeb4ffd64c3b5ed9a8e16

UPDATE

Query that I ended up using:

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "article" : [
      {
        "content" : null
      }
    ],
    "name" : "bill gates",
    "type" : "/common/topic"
  }
]

These results can be combined with narphorium's answer to retrieve the actual data:

[
  {
    "/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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦幻的心爱 2024-07-22 20:01:56

图像和主题摘要单独存储在内容存储中,可通过另一个 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.

执着的年纪 2024-07-22 20:01:56

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文