使用 Yago 获取 hasLongitude

Get hasLongitude with Yago

我想通过如下查询获取伦敦的经纬度 但它不起作用:

PREFIX e: <http://yago-knowledge.org/resource/hasLatitude>
SELECT DISTINCT ?long ?lat 
FROM <http://yago-knowledge.org>
 WHERE {
    e:London yago:hasLatitude ?long.
    e:London yago:hasLongitude ?lat. }

我做错了什么?

您正在使用的命名空间有 hasLatitude。命名空间只是一个 URI,而且必须是通用的。尝试以下查询:

PREFIX yago: <http://yago-knowledge.org/resource/>
SELECT DISTINCT ?long ?lat 
    FROM <http://yago-knowledge.org>
    WHERE {
        yago:London yago:hasLatitude ?long.
        yago:London yago:hasLongitude ?lat. 
    }