如何从Freebase获取别名? [英] How to get aliases from Freebase?
本文介绍了如何从Freebase获取别名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只想从Freebase获得一个人可以拥有的不同别名.我的PHP查询是:
I just want to get from Freebase the different aliases a person can have. My PHP query is :
$query = array(
array(
'id' => NULL,
'alias' => NULL,
'name' => "Barack Obama",
'type' => "/people/person"
)
);
结果是:
Array (
[code] => /api/status/error
[messages] => Array (
[0] => Array (
[code] => /api/status/error/mql/type
[info] => Array (
[expected_type] => /people/person
[property] => alias
)
[message] => Type /people/person does not have property alias
[path] =>
[query] => Array (
[0] => Array (
[alias] =>
[error_inside] => .
[id] =>
[name] => Barack Obama
[type] => /people/person
)
)
)
)
[status] => 200 OK
[transaction_id] => cache;cache01.p01.sjc1:8101;2012-05-11T16:17:29Z;0082
)
有人可以帮助我吗?
推荐答案
该属性的全名是/common/topic/alias.除非该属性属于您正在使用的类型或者是/type/object的属性,否则您需要完全指定它.
The full name of the property is /common/topic/alias. Unless the property belongs to the type you're working with or is a property of /type/object, you need to fully specify it.
您可以将类型更改为/common/topic(因为您似乎根本没有使用/people/person),也可以将属性更改为/common/topic/alias.
You can either change the type to /common/topic (since you don't appear to be using /people/person at all) or change the property to be /common/topic/alias.
这篇关于如何从Freebase获取别名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文