/** * {@inheritDoc} * <p> * Visits elements in the source {@link IAccessPath} plus all entailments * licensed by the {@link InferenceEngine}. */ @Override public IChunkedOrderedIterator<ISPO> iterator() { return iterator(0L/* offset */, 0L/* limit */, 0/* capacity */); }
/** * {@inheritDoc} * <p> * Visits elements in the source {@link IAccessPath} plus all entailments * licensed by the {@link InferenceEngine}. */ @Override public IChunkedOrderedIterator<ISPO> iterator() { return iterator(0L/* offset */, 0L/* limit */, 0/* capacity */); }
@Override public boolean isEmpty() { final IChunkedIterator<ISPO> itr = iterator(0L/* offset */, 1L/* limit */, 1/* capacity */); try { return ! itr.hasNext(); } finally { itr.close(); } }
@Override public boolean isEmpty() { final IChunkedIterator<ISPO> itr = iterator(0L/* offset */, 1L/* limit */, 1/* capacity */); try { return ! itr.hasNext(); } finally { itr.close(); } }
/** * {@inheritDoc} * <p> * When <code>exact == false</code> this does not count the backchained * entailments. When <code>exact == true</code> traverses the * {@link #iterator()} so as to produce an exact count of the #of elements * that would in fact be visited, which combines those from the database * with those generated dynamically (NOT efficient). */ @Override public long rangeCount(boolean exact) { if (!exact) return accessPath.rangeCount(exact); log.warn("Will materialize statements and generate inferences"); final IChunkedIterator<ISPO> itr = iterator(); long n = 0L; try { while (itr.hasNext()) { itr.next(); n++; } } finally { itr.close(); } return n; }
/** * {@inheritDoc} * <p> * When <code>exact == false</code> this does not count the backchained * entailments. When <code>exact == true</code> traverses the * {@link #iterator()} so as to produce an exact count of the #of elements * that would in fact be visited, which combines those from the database * with those generated dynamically (NOT efficient). */ @Override public long rangeCount(boolean exact) { if (!exact) return accessPath.rangeCount(exact); log.warn("Will materialize statements and generate inferences"); final IChunkedIterator<ISPO> itr = iterator(); long n = 0L; try { while (itr.hasNext()) { itr.next(); n++; } } finally { itr.close(); } return n; }
db, db.getAccessPath(NULL, NULL, NULL)).iterator();
db, db.getAccessPath(NULL, NULL, NULL)).iterator();
src = new BackchainAccessPath(database, accessPath).iterator();
src = new BackchainAccessPath(database, accessPath).iterator();