removed duplicated log

This commit is contained in:
Enrico Ottonello 2020-10-30 17:29:18 +01:00
parent 529151828f
commit 075490f4da
1 changed files with 9 additions and 6 deletions

View File

@ -309,25 +309,28 @@ public class GraphDBClient {
manager.setUsernameAndPassword(getWriterUser(), getWriterPwd()); manager.setUsernameAndPassword(getWriterUser(), getWriterPwd());
Repository repository = manager.getRepository(getRepository()); Repository repository = manager.getRepository(getRepository());
ValueFactory factory = repository.getValueFactory(); ValueFactory factory = repository.getValueFactory();
try (RepositoryConnection con = repository.getConnection()) { try {
RepositoryConnection con = repository.getConnection();
con.begin(); con.begin();
IRI contextIRI = factory.createIRI(getGraphDBBaseURI(), context); IRI contextIRI = factory.createIRI(getGraphDBBaseURI(), context);
log.debug("adding data from IRI: "+contextIRI.toString()); log.debug("adding data from: "+dataUrl+" to context: "+contextIRI.toString());
con.add(new URL(dataUrl), null, RDFFormat.TURTLE, contextIRI); con.add(new URL(dataUrl), null, RDFFormat.TURTLE, contextIRI);
result.concat("data added from url: "+dataUrl+" into graph "+context); result.concat("data added from url: "+dataUrl+" into graph "+context);
con.commit(); con.commit();
log.debug("add data from Url executed"); log.debug("add data from Url executed");
} }
catch (RDF4JException | MalformedURLException e) { catch (RDF4JException | MalformedURLException e) {
log.error("error executing query ...", e);
throw new AriadnePlusPublisherException(e); throw new AriadnePlusPublisherException(e);
} catch (IOException e) { } catch (IOException e) {
log.error("error executing query ...", e);
throw new AriadnePlusPublisherException(e); throw new AriadnePlusPublisherException(e);
} }
finally { finally {
repository.shutDown(); try {
manager.shutDown(); repository.shutDown();
manager.shutDown();
} catch (Exception e) {
}
} }
return result; return result;
} }