嘿伙计们,我的 sparql 查询有问题,谁能帮助我。
String queryString =
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>"+
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+
"PREFIX type: <http://dbpedia.org/class/yago/>"+
"PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>"+
"PREFIX prop: <http://dbpedia.org/property/>"+
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>"+
"SELECT "+
"?description "+
"FROM <http://dbpedia.org/page/Arctic_Monkeys> "+
"WHERE " +
"{"+
"?x foaf:depiction ?description."+
"}";
Query query = QueryFactory.create(queryString);
//initializing queryExecution factory with remote service.
QueryExecution qexec=QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);
//query execution and result processing
try {
//simple select
ResultSet results = qexec.execSelect();
ResultSetFormatter.out(System.out, results, query);
}
finally{
qexec.close();
}
}
它不会从 dbpedia 检索所需的数据。我想从一个特定的 dbpedia 页面检索数据