查询SPARQL不能与" dct:subject"

时间:2017-06-26 14:08:10

标签: sparql dbpedia

SELECT ?name ?birth  ?person ?subject 

WHERE {      ?person dbo:birthPlace :London .      ?person 

dbo:birthDate ?birth .      ?person foaf:name ?name .  

?person dct:subject :English_rock_singers. ?person dct:subject ?

subject.   } ORDER BY ?name

此查询仅在我删除" subject"时才有效。 有没有办法用类别查询dbpedia?

1 个答案:

答案 0 :(得分:0)

虽然您的问题不明确,但我认为您的问题在于格式化查询和定义前缀。这应该有效:

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbc: <http://dbpedia.org/resource/Category:>

SELECT ?name ?birth ?person ?subject WHERE {

  ?person dbo:birthPlace dbr:London.
  ?person dbo:birthDate ?birth.    
  ?person foaf:name ?name.  
  ?person dct:subject dbc:English_rock_singers.  
  ?person dct:subject ?subject.   
} 
ORDER BY ?name