Ejemplo n.º 1
0
  @Override
  public void remove(Iterable<Statement> triples, String namedGraphURI) {
    for (Statement stmt : triples)
      try {
        if (namedGraphURI == null) {
          connection.removeStatements(stmt.getSubject(), stmt.getPredicate(), stmt.getObject());
        } else {
          connection.removeStatements(
              stmt.getSubject(),
              stmt.getPredicate(),
              stmt.getObject(),
              new ValueFactoryImpl().createURI(namedGraphURI));
        }
      } catch (SailException e) {
        try {
          connection.rollback();
        } catch (SailException e1) {
          e1.printStackTrace();
        }
      }

    try {
      connection.commit();
    } catch (SailException e) {
      e.printStackTrace();
    }
  }
Ejemplo n.º 2
0
 // Note: removing statements does not change the configuration of cached
 // values.
 public void removeStatements(
     final Resource subj, final URI pred, final Value obj, final Resource... contexts)
     throws SailException {
   cacheConnection.removeStatements(subj, pred, obj, contexts);
   baseSailConnection.removeStatements(subj, pred, obj, contexts);
   uncommittedChanges = true;
 }
 protected void removeStatementsInternal(
     final Resource subj, final URI pred, final Value obj, final Resource... contexts)
     throws SailException {
   if (0 == contexts.length) {
     baseSailConnection.removeStatements(subj, pred, obj, singleContext);
   } else {
     for (Resource context : contexts) {
       if (null != context && context.equals(singleContext)) {
         baseSailConnection.removeStatements(subj, pred, obj, singleContext);
         break;
       }
     }
   }
 }
 public void removeStatements(
     final Resource subj, final URI pred, final Value obj, final Resource... contexts)
     throws SailException {
   if (config.logWriteOperations) {
     queryHandler.handle(new RemoveStatementsCall(id, subj, pred, obj, contexts));
   }
   baseSailConnection.removeStatements(subj, pred, obj, contexts);
 }
Ejemplo n.º 5
0
 public Object execute(final SailConnection sc) throws SailException {
   sc.removeStatements(subject, predicate, object, contexts);
   return null;
 }