SPARQL查询不会给出任何结果

时间:2013-10-15 08:47:40

标签: rdf sparql ontology fuseki

我正在尝试使用Fuseki在本地本体上运行SPARQL查询,但我无法获得任何结果。我的本体包含这样的国家列表:

###  http://localhost:2020/country/6

<http://localhost:2020/country/6> rdf:type <http://localhost:2020/vocab/country> , owl:NamedIndividual ;
rdfs:label "country #6" ;
<http://localhost:2020/vocab/country_id> 6 ;
<http://localhost:2020/vocab/country_name_nl> "Nederland" ;                              
<http://localhost:2020/vocab/country_code> "nl" .

属性就像这样:

###  http://localhost:2020/vocab/country_code

<http://localhost:2020/vocab/country_code> rdfs:label "country code" .

我正在尝试运行的测试查询是:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?name WHERE {?name rdfs:type <http://localhost:2020/vocab/country>} LIMIT 50

为什么这不能给我一份国家清单?我得到一个空的“名称”列而不是

1 个答案:

答案 0 :(得分:3)

愚蠢的错误,'类型'是rdf而不是rdfs ...现在就像魅力一样!

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?name WHERE {?name rdf:type <http://localhost:2020/vocab/country>} LIMIT 50
相关问题