0
Я пытаюсь получить информацию о странах из dbpedia, используя следующий код. Тем не менее, я не получаю. Также можно найти такую информацию.Не удается получить данные из dbpedia с помощью запроса SPARQL
public void getCountriesInformation() throws FileNotFoundException, IOException {
{
System.out.println(listOfCountries);
ParameterizedSparqlString qs = new ParameterizedSparqlString("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n "
+ "SELECT * { ?Subject rdf:type <http://dbpedia.org/page/" + listOfCountries.get(0) +"> . ?Subject ?Predicate ?Object } ORDER BY ?Subject LIMIT 10000 OFFSET 10000");
QueryExecution exec = QueryExecutionFactory.sparqlService("https://dbpedia.org/sparql", qs.asQuery());
//exec.setTimeout(10000000);
exec.setTimeout(10, TimeUnit.MINUTES);
ResultSet results = exec.execSelect();
ResultSetFormatter.outputAsCSV(new FileOutputStream(new File("C:/Users/leons/Desktop/CountryData.csv")), results);
//ResultSetFormatter.out(results);
}
//CSVCountryNameFetcher countryNameFetcher = new CSVCountryNameFetcher();
//countryNameFetcher.fetchDataFromCSV();
}
откуда у вас этот вопрос? – AKSW