@Override public boolean hasNext() throws RepositoryException { return stmts.hasNext(); }
@Override public boolean hasNext() { try { return statements.hasNext(); } catch (org.openrdf.repository.RepositoryException e) { throw new RepositoryException(e); } }
public boolean hasNext() { try { return result.hasNext(); } catch (RepositoryException e) { throw new RepositoryGraphRuntimeException(e); } }
public boolean hasNext() { try { return this.idIterator.hasNext(); } catch (RepositoryException e) { throw new ModelRuntimeException(e); } }
@Override public boolean hasNext() { try { return this.idIterator.hasNext(); } catch(RepositoryException e) { throw new ModelRuntimeException(e); } }
@Override public boolean hasNext() { try { return this.result.hasNext(); } catch(RepositoryException e) { throw new ModelRuntimeException(e); } }
public boolean hasNext() { try { return this.result.hasNext(); } catch (RepositoryException e) { throw new ModelRuntimeException(e); } }
@Override public boolean hasNext() { if(result.isClosed()) { return false; } try { return result.hasNext(); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return false; } }
@Override public boolean hasNext() { try { return this.iteration.hasNext(); } catch (final RepositoryException ex) { close(); throw new ModelException(ex); } }
private static long sizeOf(RepositoryResult<?> repositoryResult) throws RepositoryException { try { long result = 0; while (repositoryResult.hasNext()) { repositoryResult.next(); result++; } return result; } finally { repositoryResult.close(); } }
@Override public boolean hasNext() { if(result.isClosed()) { return false; } try { return result.hasNext(); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return false; } }
private static long sizeOf(RepositoryResult<?> repositoryResult) throws RepositoryException { try { long result = 0; while (repositoryResult.hasNext()) { repositoryResult.next(); result++; } return result; } finally { repositoryResult.close(); } }
@Override public boolean hasStatement(Resource subj, org.openrdf.model.URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException { //Checks whether the repository contains statements with a specific subject, //predicate and/or object, optionally in the specified contexts. RepositoryResult<Statement> stIter = getStatements(subj, pred, obj, includeInferred, contexts); try { return stIter.hasNext(); } finally { stIter.close(); } }
private static void copyNamespacesToModel(RepositoryConnection conn, Model m) throws RepositoryException { RepositoryResult<Namespace> ns = conn.getNamespaces(); while (ns.hasNext()) { m.setNamespace(ns.next()); } }
private Statement first(RepositoryConnection conn, URI pred, Value obj) throws RepositoryException { RepositoryResult<Statement> stmts; stmts = conn.getStatements(null, pred, obj, true); try { if (stmts.hasNext()) return stmts.next(); return null; } finally { stmts.close(); } }
@Override protected T computeNext() { try { if(result.hasNext()) { return result.next(); } } catch (RepositoryException e) { LOGGER.error(MessageCatalog._00025_CUMULUS_SYSTEM_INTERNAL_FAILURE_MSG + " Could not compute next result.", e); } return endOfData(); } };
@Override public T next() { try { T next = result.next(); if(!result.hasNext()) { result.close(); } return next; } catch (RepositoryException e) { handleRepositoryException(e, ResourceUtils.class); return null; } }
@Override protected T computeNext() { try { if(result.hasNext()) { return result.next(); } } catch (RepositoryException e) { LOGGER.error(MessageCatalog._00025_CUMULUS_SYSTEM_INTERNAL_FAILURE_MSG + " Could not compute next result.", e); } return endOfData(); } };
@Override public String getMimeType(RepositoryConnection connection, URI uri) throws RepositoryException { final RepositoryResult<Statement> formats = connection.getStatements(uri, DCTERMS.format, null, false, ldpContext); try { if (formats.hasNext()) return formats.next().getObject().stringValue(); } finally { formats.close(); } return null; } @Override
private void importRepository(RepositoryConnection connection, TripleSink sink) throws RepositoryException { RepositoryResult<Statement> statements = null; try { statements=connection.getStatements(null, null, null, false); SesameModelParser tripleParser=new SesameModelParser(getNamespaces(connection)); while(statements.hasNext()) { sink.addTriple(tripleParser.parseStatement(statements.next())); } } finally { closeQuietly(statements, "Could not close results after parsing statements"); } }