SPARQL没有返回正确的结果

时间:2014-01-02 14:34:38

标签: rdf sparql

有一个关于鸟here的RDF文件。

我正在尝试在其上运行以下sparql:

PREFIX dc:<http://purl.org/dc/terms/>
PREFIX wo:<http://purl.org/ontology/wo/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dc:<http://purl.org/dc/terms/>
PREFIX wo:<http://purl.org/ontology/wo/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf:<http://xmlns.com/foaf/0.1/>
PREFIX po:<http://purl.org/ontology/po/>
PREFIX owl:<http://www.w3.org/2002/07/owl#>

select * where { <http://www.bbc.co.uk/nature/life/Bird#class> dc:description ?y .}

它应该返回一个结果,因为该文件包含以下内容:

<wo:Class rdf:about="/nature/life/Bird#class">
      <rdfs:label>Birds</rdfs:label>
      <wo:name rdf:resource="http://www.bbc.co.uk/nature/class/Bird#name" />
      <foaf:depiction rdf:resource="http://ichef.bbci.co.uk/naturelibrary/images/ic/640x360/b/bi/bird/bird_1.jpg" />
      <dc:description>
         Birds are a class of vertebrates. They are bipedal, warm-blooded, have a covering of feathers, and their front limbs are modified into wings. Some birds, such as penguins and ostriches, have lost the power of flight. All birds lay eggs. Because birds are warm-blooded, their eggs have to be incubated to keep the embryos inside warm, or they will perish.
         <br />
         <br />
         <a href="/nature/19700707">All you need to know about British birds.</a>
      </dc:description>
      <owl:sameAs rdf:resource="http://dbpedia.org/resource/Bird" />
      <wo:phylum rdf:resource="/nature/life/Chordate#phylum" />
      <wo:kingdom rdf:resource="/nature/life/Animal#kingdom" />
   </wo:Class>

但是,它没有返回任何结果。我正在使用twinkle sparql客户端。我正在尝试使用相同的sparql为另一个位于here的Mammal的rdf文件和以下sparql:

select * where { <http://www.bbc.co.uk/nature/life/Mammal#class> dc:description ?y .}

和上面的相同前缀。对于这个,我得到了结果。

所以问题在于鸟的rdf文件。我无法找到问题。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:2)

数据文件Bird.rdf导致验证程序错误:

请参阅http://www.w3.org/RDF/Validator/

使用此操作

http://www.w3.org/RDF/Validator/rdfval?URI=http%3A%2F%2Fwww.bbc.co.uk%2Fnature%2Flife%2FBird.rdf&PARSE=Parse+URI%3A+&TRIPLES_AND_GRAPH=PRINT_TRIPLES&FORMAT=PNG_EMBED

可能是这导致SPARQL中的不匹配。 dc:说明无效。