遍历 Freebase 图
我正在尝试从特定的人那里获取多个级别的影响关系。 粗略地说,这个查询解释了我想要完成的任务
{ "id" : "/en/george_orwell",
"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }],
"influenced_by": [ {"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }],
"influenced_by": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }],
"influenced_by": [ {"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }] }
是否有任何有效的方法使用 MQL 遍历 Freebase 图形?
I'm trying to fetch multiple levels of influence relationships from a particular person.
Roughly, this query explains what I'm trying to accomplish
{ "id" : "/en/george_orwell",
"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }],
"influenced_by": [ {"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }],
"influenced_by": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }],
"influenced_by": [ {"id": null,"name" : null,
"type" : "/influence/influence_node",
"influenced": [{"id": null,"name" : null}],
"influenced_by": [ { "id": null, "name" : null}] }] }
Is there any efficient way of traversing the Freebase graph using MQL ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设你想受到给定数量的层数的影响和影响?不,不可能在 mql 中执行此操作,它需要某种递归和自引用。
但是,您可以使用此语法传递多个 id
[{ 'id|=' : ['id1', 'id2', ...] }]
通过这种方式,您可以通过给定种子第一次运行查询来获取人员列表,然后重新运行查询以抓取所选任何给定 id 的图表。
如果这不是要以交互方式(由人)完成,那么您可能应该使用 freebase 数据转储来离线预先计算整个过程。
I assume you want to get influenced and influenced_by for a given number of plies out ? No it's not possible to do this in mql, it would require some sort of recursion and self-referencing.
However, you can pass multiple ids using this syntax
[{ 'id|=' : ['id1', 'id2', ...] }]
In that way you can get the list of people from running the query the first time given a seed, and then re-run the query to crawl the graph for any given id selected.
If this is not aimed to be done interactively (by a person) then you should probably use the freebase data dumps to pre-calculate the whole thing offline.