public CloseableIteration<? extends Statement, RepositoryException> call(RepositoryConnection member) throws RepositoryException { return member.getStatements(subj, pred, obj, includeInferred, contexts); } });
public CloseableIteration<? extends Statement, RepositoryException> call( RepositoryConnection member) throws RepositoryException { return member.getStatements(subj, pred, obj, includeInferred, contexts); } });
@Override public Set<Value> objects() { Function<Statement, Value> f = new Function<Statement, Value>() { @Override public Value apply(Statement statement) { return statement.getObject(); } }; return toSet(rc.getStatements(null, null, null), f); }
@Override public CloseableIterator<Atom> iterator() { try { return new AtomIterator(this.connection.getStatements(null, null, null, false)); } catch (RepositoryException e) { if (LOGGER.isErrorEnabled()) { LOGGER.error("Error during iterator creation", e); } } return null; }
@Override public boolean contains(Resource resource, IRI iri, Value value, Resource... resources) { try (CloseableIteration<Statement, RepositoryException> iter = rc.getStatements(resource, iri, value, resources)) { return iter.hasNext(); } }
@Override public Set<IRI> predicates() { Function<Statement, IRI> f = new Function<Statement, IRI>() { @Override public IRI apply(Statement statement) { return statement.getPredicate(); } }; return toSet(rc.getStatements(null, null, null), f); }
@Override public Set<Resource> subjects() { Function<Statement, Resource> f = new Function<Statement, Resource>() { @Override public Resource apply(Statement statement) { return statement.getSubject(); } }; return toSet(rc.getStatements(null, null, null), f); }
@Override public Iterator<Statement> iterator() { try { return new StatementIterator(con.getStatements(null, null, null, false)); } catch (RepositoryException e) { throw new ModelException(e); } }
@Override public Iterator<Statement> iterator() { try { return new StatementIterator(con.getStatements( (Resource) subj, (URI) pred, obj, false, cast(contexts))); } catch (RepositoryException e) { throw new ModelException(e); } } };
protected CloseableIteration<? extends Statement, SailException> getStatementsInternal( Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException { try { return new RepositoryStatementIteration( repoConnection.getStatements(subj, pred, obj, includeInferred && !inferenceDisabled, contexts)); } catch (RepositoryException e) { throw new SailException(e); } }
@Override public Iterator<Statement> match(Resource s, IRI p, Value o, Resource... c) { RepositoryResult<Statement> result; try { result = rc.getStatements(s, p, o, INFER, c); } catch (RepositoryException e) { throw new RepositoryGraphRuntimeException(e); } return new RepositoryResultIterator(result); }
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r, property, null, true, contexts)); } catch (RepositoryException ex) { ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class); return Iterators.emptyIterator(); } } };
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 public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(null, property, r, true, contexts)); } catch (RepositoryException ex) { ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r,rdf_type,null,true,contexts)); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return Iterators.emptyIterator(); } } },
public static SailRepository exportRepoToNativeStore(Repository rep, String dirPath) throws RepositoryException, FileNotFoundException, RDFHandlerException{ File f = new File(dirPath); if(f.exists()) f.delete(); f.mkdirs(); NativeStore nativeStore = new NativeStore(f); SailRepository nativeRepo = new SailRepository(nativeStore); nativeRepo.initialize(); RepositoryResult<Statement> rr = rep.getConnection().getStatements((Resource)null, null, null, false, (Resource)null); nativeRepo.getConnection().add(rr.asList(), (Resource)null); return nativeRepo; }
public static SailRepository exportRepoToNativeStore(Repository rep, String dirPath) throws RepositoryException, FileNotFoundException, RDFHandlerException{ File f = new File(dirPath); if(f.exists()) f.delete(); f.mkdirs(); NativeStore nativeStore = new NativeStore(f); SailRepository nativeRepo = new SailRepository(nativeStore); nativeRepo.initialize(); RepositoryResult<Statement> rr = rep.getConnection().getStatements((Resource)null, null, null, false, (Resource)null); nativeRepo.getConnection().add(rr.asList(), (Resource)null); return nativeRepo; }
public ClosableIterator<Statement> iterator() { assertModel(); try { CloseableIteration<? extends org.openrdf.model.Statement, RepositoryException> statements = connection.getStatements( null, null, null, true, openRdfContext); return new StatementIterator(statements, this); } catch (RepositoryException e) { throw new ModelRuntimeException(e); } }
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r,rdf_type,null,true,contexts)); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return Iterators.emptyIterator(); } } },
@Override public CloseableIterator<Atom> atomsByPredicate(Predicate p) throws AtomSetException { try { return new AtomIterator(this.connection.getStatements(null, this.createURI(p), null, false)); } catch (RepositoryException e) { throw new AtomSetException(e); } }