@Override protected synchronized void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException { RDFHandler handler = new RDFInserter(removed); try { getDelegate().exportStatements(subject, predicate, object, true, handler, contexts); } catch (RDFHandlerException e) { if (e.getCause() instanceof RepositoryException) throw (RepositoryException) e.getCause(); throw new AssertionError(e); } added.remove(subject, predicate, object, contexts); }
public void close() throws IOException { try { if (writingStarted) { endRDF(); } } catch (RDFHandlerException e) { if (e.getCause() instanceof IOException) { throw (IOException)e.getCause(); } else { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } } finally { writer.close(); } }
} catch (RDFHandlerException e) { try { throw e.getCause(); } catch (IOException e1) { throw e1;
public ParsedQuery parseQuery(String queryStr, String baseURI) throws MalformedQueryException { try { RDFParser parser = Rio.createParser(format); SeRQOHandler handler = new SeRQOHandler(); parser.setPreserveBNodeIDs(true); parser.setRDFHandler(handler); parser.parse(new StringReader(queryStr), ""); return handler.getQuery(); } catch (RuntimeException e) { throw e; } catch (RDFHandlerException e) { try { if (e.getCause() != null) throw e.getCause(); } catch (MalformedQueryException e1) { throw e1; } catch (Exception e1) { throw new MalformedQueryException(e1); } catch (Throwable e1) { } throw new MalformedQueryException(e); } catch (Exception e) { throw new MalformedQueryException(e); } } }
Throwable t = e.getCause(); if (t instanceof SailException) { throw (SailException)t;
@Override protected void removeWithoutCommit(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException { IRI[] archiveContexts = getArchiveContexts(); if (archiveContexts.length > 0) { RDFHandler handler = new RDFInserter(getDelegate()); try { getDelegate().exportStatements(subject, predicate, object, true, handler, archiveContexts); } catch (RDFHandlerException e) { if (e.getCause() instanceof RepositoryException) { throw (RepositoryException)e.getCause(); } throw new AssertionError(e); } } if (isAllContext(contexts)) { getDelegate().remove(subject, predicate, object, getRemoveContexts()); } else { getDelegate().remove(subject, predicate, object, contexts); } }
Throwable cause = e.getCause(); if (cause instanceof SailException) { throw (SailException)cause;
protected void executeLoad(Load load, UpdateContext uc) throws IOException, RDFParseException, SailException { Value source = load.getSource().getValue(); Value graph = load.getGraph() != null ? load.getGraph().getValue() : null; URL sourceURL = new URL(source.stringValue()); RDFSailInserter rdfInserter = new RDFSailInserter(con, vf, uc); if (graph != null) { rdfInserter.enforceContext((Resource)graph); } try { loader.load(sourceURL, source.stringValue(), null, rdfInserter); } catch (RDFHandlerException e) { // RDFSailInserter only throws wrapped SailExceptions throw (SailException)e.getCause(); } }
if (!(e.getCause() instanceof EvaluationStoppedException)) { throw e;
con.rollback(); throw (RepositoryException)e.getCause();
con.rollback(); throw (RepositoryException)e.getCause();
@Override public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException { OpenRDFUtil.verifyContextNotNull(contexts); CombineContextsRdfInserter rdfInserter = new CombineContextsRdfInserter(this); rdfInserter.enforceContext(contexts); boolean localTransaction = startLocalTransaction(); try { RDFLoader loader = new RDFLoader(getParserConfig(), getValueFactory()); loader.load(in, baseURI, dataFormat, rdfInserter); conditionalCommit(localTransaction); } catch (RDFHandlerException e) { conditionalRollback(localTransaction); throw ((RepositoryException) e.getCause()); } catch (RDFParseException e) { conditionalRollback(localTransaction); throw e; } catch (IOException e) { conditionalRollback(localTransaction); throw e; } catch (RuntimeException e) { conditionalRollback(localTransaction); throw e; } }
@Override public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException { OpenRDFUtil.verifyContextNotNull(contexts); CombineContextsRdfInserter rdfInserter = new CombineContextsRdfInserter(this); rdfInserter.enforceContext(contexts); boolean localTransaction = startLocalTransaction(); try { RDFLoader loader = new RDFLoader(getParserConfig(), getValueFactory()); loader.load(reader, baseURI, dataFormat, rdfInserter); conditionalCommit(localTransaction); } catch (RDFHandlerException e) { conditionalRollback(localTransaction); throw ((RepositoryException) e.getCause()); } catch (RDFParseException e) { conditionalRollback(localTransaction); throw e; } catch (IOException e) { conditionalRollback(localTransaction); throw e; } catch (RuntimeException e) { conditionalRollback(localTransaction); throw e; } } }
throw (RepositoryException)e.getCause();
throw (RepositoryException)e.getCause();
throw (RepositoryException)e.getCause();
throw (RepositoryException)e.getCause();
con.rollback(); throw (RepositoryException)e.getCause();