如何从Freebase获取别名?

时间:2012-05-11 16:20:23

标签: php freebase mql

我只是想从Freebase获得一个人可以拥有的不同别名。我的PHP查询是:

$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 
)

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

该属性的全名是/ common / topic / alias。除非属性属于您正在使用的类型或属于/ type / object属性,否则您需要完全指定它。

您可以将类型更改为/ common / topic(因为您似乎根本不使用/ people / person)或将属性更改为/ common / topic / alias。