我正在使用Jena使用DBpedia端点。我发送SPARQL查询来检索对象的对象和谓词(例如,http://dbpedia.org/page/London)。如何获得以下两个结果集: -
String sparqlQueryString1 = "PREFIX owl: <w3.org/2002/07/owl#>" +
"PREFIX xsd:<w3.org/2001/XMLSchema#>" +
"PREFIX rdfs: <w3.org/2000/01/rdf-schema#>" +
"PREFIX rdf: <w3.org/1999/02/22-rdf-syntax-ns#>" +
"PREFIX foaf: <xmlns.com/foaf/0.1/>" +
"PREFIX dc: <purl.org/dc/elements/1.1/>" +
"PREFIX dbr: <dbpedia.org/resource/>" +
"PREFIX dbpedia2: <dbpedia.org/property/>" +
"PREFIX dbo: <dbpedia.org/ontology/>" +
"select ?p ?o where { dbr:London ?p ?o}"