[Freebase]:查找节点之间的关系 [英] [Freebase]: Finding relationship between nodes

查看:117
本文介绍了[Freebase]:查找节点之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Freebase的新手,我一直在尝试寻找2个节点之间的关系,但没有成功.

I am new to Freebase and I have been trying to find relationships between 2 nodes without success.

例如,我想找到现实生活中的刘易斯·汉密尔顿(/en/lewis_hamilton)和一级方程式(/en/formula_one)之间是否存在联系,但我似乎找不到.

For example, I want to find if there is link between Lewis Hamilton(/en/lewis_hamilton) and Formula One(/en/formula_one), which there is in real life, but I can't seem to find it.

我尝试了以下MQL代码,以及交替的ID:

I have tried the following MQL codes, alternating IDs as well :

1)

[{ 
 "type" : "/type/link", 
 "source" : { "id" : "/en/lewis_hamilton" }, 
 "master_property" : null, 
 "target" : { "id" : "/en/formula_one" }, 
 "target_value" : null 
}]

2)

{
  "id":"/en/lewis_hamilton",
  "/type/reflect/any_master":[{
    "link":null,
    "name":null
  }],
  "/type/reflect/any_reverse":[{
    "link":null,
    "name":null
  }],
  "/type/reflect/any_value":[{
    "link":null,
    "value":null
  }]
}

我也无法使用他们的几个可以执行此操作的应用程序,因为它每次都会返回超出用户速率限制" .应用程序是:

I'm also not able to use a couple of their apps that could do this because it returns "user rate limit exceeded" every time. Apps are:

  1. http://between.freebaseapps.com
  2. http://shortestpath.freebaseapps.com
  1. http://between.freebaseapps.com
  2. http://shortestpath.freebaseapps.com

你们有什么建议吗?

推荐答案

您提供的查询是正确的,只不过它们只查看相距一个链接的关系.出乎意料的是,目前没有从Lewis Hamilton到Freebase中一级方程式的道路.如果有,它可能看起来像这样:

The queries that you gave are correct except that they only look at relationships that are one link apart. Surprisingly there isn't a path from Lewis Hamilton to Formula One in Freebase right now. If there was it might look something like this:

/en/lewis_hamilton → /type/object/type → /base/formula1/formula_1_driver
/base/formula1/formula_1_driver → /type/type/domain → /base/formula1
/base/formula1 → /freebase/domain_profile/equivalent_topic → /en/formula_one

Freebase不支持递归查询,因此找不到在主题之间找到这些多链接路径的好方法.您尝试的应用通过生成嵌套嵌套查询越来越多的查询来模拟递归.不幸的是,它们已经过时,缺少正确的API密钥以立即正常运行.这些嵌套查询如下所示:

Freebase doesn't support recursive queries so there's no good way to find these multi-link paths between topics. The apps that you tried simulate recursion by generating queries with increasingly nested subqueries. Unfortunately they are out of date and missing the proper API keys to run properly right now. Here's what those nested queries look like:

{
  "id": "/en/lewis_hamilton",
  "name": null,
  "/type/reflect/any_master": [{
    "link": {
      "master_property": null,
      "target": {
        "id": null,
        "name": null,
        "/type/reflect/any_master": [{
          "link": {
            "master_property": null,
            "target": {
              "id": "//base/formula1",
              "name": null
            }
          },
          "name": null
        }]
      }
    },
    "name": null
  }]
}

这类查询可能需要很长时间才能运行,并且如果在 Freebase数据上本地运行,则可能会更好.转储.

These sorts of queries can take a long time to run and are probably better if run locally over the Freebase data dumps.

这篇关于[Freebase]:查找节点之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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