@Override
public CloseableIteration<? extends Statement, SailException> getStatements(
final Resource subj,
final IRI pred,
final Value obj,
final boolean includeInferred,
final Resource... contexts) throws SailException {
if (0 == contexts.length) {
return new ReadableStatementIteration(
super.getStatements(subj, pred, obj, includeInferred));
}
else {
Collection<CloseableIteration<? extends Statement, SailException>>
iterations = new LinkedList<>();
for (Resource context : contexts) {
if (readPermitted(context)) {
iterations.add(super.getStatements(
subj, pred, obj, INCLUDE_INFERRED_STATEMENTS, context));
}
}
return new CompoundCloseableIteration(iterations);
}
}