Exemplo n.º 1
0
  @Override
  protected void commitInternal() throws SailException {
    try {
      triples.commit();
      unlock();
    } catch (SQLException e) {
      throw new RdbmsException(e);
    } catch (InterruptedException e) {
      throw new RdbmsException(e);
    }

    // create a fresh event object.
    triples.setSailChangedEvent(new DefaultSailChangedEvent(sail));
  }
Exemplo n.º 2
0
 @Override
 protected void addStatementInternal(Resource subj, URI pred, Value obj, Resource... contexts)
     throws SailException {
   try {
     if (contexts.length == 0) {
       triples.add(vf.createStatement(subj, pred, obj));
     } else {
       for (Resource ctx : contexts) {
         triples.add(vf.createStatement(subj, pred, obj, ctx));
       }
     }
   } catch (SQLException e) {
     throw new RdbmsException(e);
   } catch (InterruptedException e) {
     throw new RdbmsException(e);
   }
 }
Exemplo n.º 3
0
 @Override
 protected long sizeInternal(Resource... contexts) throws SailException {
   try {
     return triples.size(vf.asRdbmsResource(contexts));
   } catch (SQLException e) {
     throw new RdbmsException(e);
   }
 }
Exemplo n.º 4
0
 @Override
 protected RdbmsResourceIteration getContextIDsInternal() throws SailException {
   try {
     return triples.findContexts();
   } catch (SQLException e) {
     throw new RdbmsException(e);
   }
 }
Exemplo n.º 5
0
 @Override
 protected void removeStatementsInternal(Resource subj, URI pred, Value obj, Resource... contexts)
     throws SailException {
   RdbmsResource s = vf.asRdbmsResource(subj);
   RdbmsURI p = vf.asRdbmsURI(pred);
   RdbmsValue o = vf.asRdbmsValue(obj);
   RdbmsResource[] c = vf.asRdbmsResource(contexts);
   triples.remove(s, p, o, c);
 }
Exemplo n.º 6
0
 @Override
 protected void rollbackInternal() throws SailException {
   try {
     triples.rollback();
   } catch (SQLException e) {
     throw new RdbmsException(e);
   } finally {
     unlock();
   }
 }
Exemplo n.º 7
0
 @Override
 protected CloseableIteration<? extends Statement, SailException> getStatementsInternal(
     Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts)
     throws SailException {
   RdbmsResource s = vf.asRdbmsResource(subj);
   RdbmsURI p = vf.asRdbmsURI(pred);
   RdbmsValue o = vf.asRdbmsValue(obj);
   RdbmsResource[] c = vf.asRdbmsResource(contexts);
   return triples.find(s, p, o, c);
 }
Exemplo n.º 8
0
 @Override
 protected void startTransactionInternal() throws SailException {
   try {
     lock();
     triples.begin();
   } catch (SQLException e) {
     unlock();
     throw new RdbmsException(e);
   } catch (InterruptedException e) {
     unlock();
     throw new RdbmsException(e);
   }
 }
Exemplo n.º 9
0
 @Override
 protected CloseableIteration<BindingSet, QueryEvaluationException> evaluateInternal(
     TupleExpr expr, Dataset dataset, BindingSet bindings, boolean includeInferred)
     throws SailException {
   triples.flush();
   try {
     TupleExpr tupleExpr;
     EvaluationStrategy strategy;
     strategy = factory.createRdbmsEvaluation(dataset);
     tupleExpr = optimizer.optimize(expr, dataset, bindings, strategy);
     return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
   } catch (QueryEvaluationException e) {
     throw new SailException(e);
   }
 }