How to get aliases from Freebase?

佐手、 提交于 2019-12-23 03:54:11

问题


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"
    )
);

The result is:

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 
)

Can someone help me?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/10555098/how-to-get-aliases-from-freebase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!