查询 SPARQL 不适用于 "dct:subject"

Query SPARQL doesn't work with "dct:subject"

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?

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

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