DBpedia Jena查询返回null

我只是试图在DBpedia上运行一个小的查询,查询本身的作品, 在这里看到,但我不明白为什么它回来时,与耶拿这样做,我得到空。

String service = "http://dbpedia.org/sparql"; String queryString = ""; queryString = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label" + "WHERE {" + "<http://dbpedia.org/resource/Quatre_Bornes> <http://dbpedia.org/ontology/country> ?y ."+ "?y rdfs:label ?label ."+ "FILTER (LANG(?label) = 'en')"+ "}"; Query query = QueryFactory.create(queryString); QueryEngineHTTP qexec = QueryExecutionFactory.createServiceRequest(service, query); ResultSet results = qexec.execSelect(); for ( ; results.hasNext() ; ) { QuerySolution soln = results.nextSolution() ; System.out.println(soln.getLiteral("label")); } 

任何build议?

这太尴尬了,查询中有空间问题:

 String service = "http://dbpedia.org/sparql"; String queryString = ""; queryString = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label " + "WHERE {" + "<http://dbpedia.org/resource/Quatre_Bornes> <http://dbpedia.org/ontology/country> ?y ."+ "?y rdfs:label ?label ."+ "FILTER (LANG(?label) = 'en')"+ "}";