use of org.openrdf.sail.SailException in project blueprints by tinkerpop.
the class SailVertex method updateLiteral.
private void updateLiteral(final Literal oldLiteral, final Literal newLiteral) {
try {
final Set<Statement> statements = new HashSet<Statement>();
final CloseableIteration<? extends Statement, SailException> results = this.graph.getSailConnection().get().getStatements(null, null, oldLiteral, false);
while (results.hasNext()) {
statements.add(results.next());
}
results.close();
this.graph.getSailConnection().get().removeStatements(null, null, oldLiteral);
for (Statement statement : statements) {
SailHelper.addStatement(statement.getSubject(), statement.getPredicate(), newLiteral, statement.getContext(), this.graph.getSailConnection().get());
}
} catch (SailException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
Aggregations