@Override protected void addWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException { try { sailConnection.addStatement(subject, predicate, object, contexts); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override protected void removeWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException { try { if (subject == null && predicate == null && object == null) { sailConnection.clear(contexts); } else { sailConnection.removeStatements(subject, predicate, object, contexts); } } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override public void setNamespace(String prefix, String name) throws RepositoryException { try { boolean local = startLocalTransaction(); sailConnection.setNamespace(prefix, name); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override public void removeNamespace(String prefix) throws RepositoryException { try { boolean local = startLocalTransaction(); sailConnection.removeNamespace(prefix); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override public void clearNamespaces() throws RepositoryException { try { boolean local = startLocalTransaction(); sailConnection.clearNamespaces(); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }
@Override public void clear(Resource... contexts) throws RepositoryException { OpenRDFUtil.verifyContextNotNull(contexts); try { boolean local = startLocalTransaction(); sailConnection.clear(contexts); conditionalCommit(local); } catch (SailReadOnlyException e) { throw new RepositoryReadOnlyException(e.getMessage(), e); } catch (SailException e) { throw new RepositoryException(e); } }