小编Mag*_*rek的帖子

rdf:sparql中的集合

我有一个RDF文件rdf:collection.当我有一个作者的集合时,以下查询不返回任何内容.但是,该查询适用于两个或更多作者,但只返回两个作者.我能做些什么来写出所有作者?

<bibo:authorList rdf:parseType="Collection">
 <rdf:Description rdf:about="http://openlibrary.org/authors/OL113143A"/>
 <rdf:Description rdf:about="http://openlibrary.org/authors/OL6784959A"/>
</bibo:authorList>
Run Code Online (Sandbox Code Playgroud)
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dc: <http://purl.org/dc/terms/>

select ?title ?author ?author2
where { 
  ?x dc:title ?title . 

  ?x bibo:authorList ?object.
  ?object rdf:first ?name. 
  ?name rdf:value ?author.

  ?object rdf:rest ?object2.
  ?object2 rdf:first ?name2.
  ?name2 rdf:value ?author2 . 
}
Run Code Online (Sandbox Code Playgroud)

collections rdf semantic-web sparql

4
推荐指数
1
解决办法
1088
查看次数

标签 统计

collections ×1

rdf ×1

semantic-web ×1

sparql ×1