我试过这个查询,它编译并运行。但它只检索没有它们的值的列名。我怎样才能检索它们的值?有什么特殊的方法吗?
String str = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>"+
"PREFIX dbo: <http://dbpedia.org/ontology/>"+
"PREFIX dbpprop: <http://dbpedia.org/property/>"+
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>"+
"SELECT DISTINCT ?label ?abstract ?placeOfBirth"+
"?birthPlace ?birthDate ?deathDate ?page ?thumbnail WHERE {"+
"OPTIONAL {<http://dbpedia.org/resource/Neil_Simon> dbpprop:placeOfBirth ?placeOfBirth ; dbo:abstract ?abstract ; foaf:page ?page .}"+
"OPTIONAL {<http://dbpedia.org/resource/Neil_Simon> dbpprop:placeOfBirth ?placeOfBirth ; dbpprop:birthPlace ?birthPlace ;}"+
"OPTIONAL {<http://dbpedia.org/resource/Neil_Simon> dbpprop:placeOfBirth ?placeOfBirth ; dbo:birthDate ?birthDate ;}"+
"OPTIONAL {<http://dbpedia.org/resource/Neil_Simon> dbpprop:placeOfBirth ?placeOfBirth ; dbo:deathdate ?deathDate ;}"+
"OPTIONAL {<http://dbpedia.org/resource/Neil_Simon> dbpprop:placeOfBirth ?placeOfBirth ; dbo:thumbnail ?thumbnail .}"+
"FILTER (LANG(?label) = 'en')"+
"FILTER (LANG(?abstract) = 'en')}"+
"LIMIT 1";