if (request.getContentLength() == 0)
return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Status.BAD_REQUEST, "content may not be empty in resource update", configurationService, templatingService);
// a intercepting connection that filters out all triples that have
// the wrong subject
InterceptingRepositoryConnection connection = new InterceptingRepositoryConnectionWrapper(sesameService.getRepository(), sesameService.getConnection());
//RepositoryConnection connection = sesameService.getConnection();
try {
connection.begin();
final Resource subject = connection.getValueFactory().createURI(uri);
connection.addRepositoryConnectionInterceptor(new ResourceSubjectMetadata(subject));
// delete all triples for given subject
connection.remove(subject, null, null, (Resource)null);
// add RDF data from input to the suject
connection.add(request.getReader(), configurationService.getBaseUri(), parser, contextService.getDefaultContext());
} finally {
connection.commit();
connection.close();
}
return Response.ok().build();
} catch (RepositoryException e) {
return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Status.INTERNAL_SERVER_ERROR, e.getMessage(), configurationService, templatingService);
} catch (IOException e) {