2016-08-29 106 views
0

我是RDF的新手,所以如果你可以帮助我的话,这将是非常好的!SPARQL查询不返回任何数据

我想查询主题泡菜称为“梅干”(这是日本泡菜),如下所示:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX type: <http://dbpedia.org/class/yago/>  
PREFIX prop: <http://dbpedia.org/property/> 
PREFIX onto: <http://dbpedia.org/ontology/> 

SELECT ?label ?subject 
WHERE { 

?Thing 
     rdfs:label ?label; 
     prop:subject?subject. 
FILTER (?label = "Umeboshi") 
} 

此查询不给我任何数据。

由于我不知道在哪里可以找到我这里指的是梅干页面上DBpedia中http://live.dbpedia.org/page/Umeboshi可用的属性。

非常感谢您的帮助!

回答

3

两件事情,我发现:

  1. 在你给的页面,标签将用英语表示,但在你的查询您省略语。
  2. subject有不同的命名空间。这是一个dcterm的概念,而不是dbpedia属性。

这导致了以下更改的查询,which results in three bindings

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX dct: <http://purl.org/dc/terms/> 

SELECT ?label ?subject 
WHERE { 

?Thing 
     rdfs:label ?label; 
     dct:subject ?subject. 

FILTER (?label = "Umeboshi"@en) 
} 
+0

非常感谢您!这非常有帮助! – janeloulou

+0

@ user2267486如果解决了您的问题,请接受答案。 – AKSW