如何在Freebase中提取组织的位置?

时间:2012-06-07 08:25:47

标签: freebase

我正在使用Freebase,我想从Freebase找到一些组织。

例如,我想从卡迪夫大学提取位置(城市,国家,......)。为此我创建了此查询以查看实体的所有属性:

 https://www.googleapis.com/freebase/v1/mqlread?
 query=
 [
    {"name":"cardiff%20university",
    "*":[{}],
    "type":"/education/university"}
 ]

Link of query here

但是O看不到英国,加的夫或类似的任何地点。

我认为Freebase没有得到这些信息,但是当我去webpage时,我可以看到“Cardiff”,“Wales” 和“英国”。

如何检索此信息?

1 个答案:

答案 0 :(得分:1)

当您使用* wildcard属性时,您要求指定类型的所有属性值,在本例中为/education/university。您正在寻找的包含属性是/location/location的一部分,因此无法显示。

在查询中有两种显示包含方式的方法。一种是使用完整的属性路径明确地询问该属性,如下所示:

[{
  "name": "Cardiff University",
  "type": "/education/university",
  "/location/location/containedby": [{}]
}]​

另一种方法是将默认类型指定为/location/location,然后使用如下前缀添加/education/university约束:

[{
  "name": "cardiff university",
  "*": [{}],
  "type": "/location/location",
  "f:type": "/education/university"
}]​
相关问题