谁能告诉我任何 SPARQL 查询以从http://www4.wiwiss.fu-berlin.de/factbook/sparql获取所有国家的所有接壤国家?
例如阿富汗有:factbook:landboundary db:China, factbook:landboundary db:Iran, factbook:landboundary db:Pakistan, factbook:landboundary db:Tajikistan, factbook:landboundary db:Turkmenistan
我尝试获取数据:
SELECT ?country ?name ?neighbour
WHERE {
?country rdf:type factbook:Country .
?country rdfs:label ?name.
OPTIONAL{
?country factbook:landboundary ?neighbour.
}
}
以以下消息结束:
rethrew: de.fuberlin.wiwiss.d2rq.D2RQException: Table 'factbook.neighbors' doesn't exist: SELECT DISTINCT `T0_neighbors`.`name_encoded` FROM `bordercountries` AS `T0_bordercountries`, `neighbors` AS `T0_neighbors`, `countries` AS `T0_countries` WHERE `T0_bordercountries`.`Landboundaries_bordercountries_title` = `T0_neighbors`.`Name` AND `T0_bordercountries`.`Name` = `T0_countries`.`Name` AND `T0_countries`.`name_encoded` = 'Aruba' (E0)
我在http://answers.semanticweb.com上问过同样的问题,但还没有运气,所以我在这里试试运气