use of org.eclipse.rdf4j.repository.RepositoryResult in project rdf4j by eclipse.
the class SPARQLConnection method getStatementsSingleTriple.
private RepositoryResult<Statement> getStatementsSingleTriple(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException {
if (hasStatement(subj, pred, obj, includeInferred, contexts)) {
Statement st = getValueFactory().createStatement(subj, pred, obj);
CloseableIteration<Statement, RepositoryException> cursor;
cursor = new SingletonIteration<Statement, RepositoryException>(st);
return new RepositoryResult<Statement>(cursor);
} else {
return new RepositoryResult<Statement>(new EmptyIteration<Statement, RepositoryException>());
}
}
Aggregations