public class BackchainOwlSameAsPropertiesPOIterator extends BackchainOwlSameAsIterator
Note: This is a reverse properties query: we know o and and we want to know all {s,p} tuples that constitute the reverse properties for o.
InferenceEngine
,
InferenceEngine.Options
copyOnly, db, log, sameAs, src
DEFAULT_CHUNK_SIZE
Constructor and Description |
---|
BackchainOwlSameAsPropertiesPOIterator(IChunkedOrderedIterator<ISPO> src,
IV p,
IV o,
AbstractTripleStore db,
IV sameAs)
Create an iterator that will visit all statements in the source iterator
and also backchain any entailments that would have resulted from
owl:sameAs {2,3}.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the object, releasing any associated resources.
|
IKeyOrder<ISPO> |
getKeyOrder()
The natural order in which elements are being visited.
|
boolean |
hasNext() |
ISPO |
next()
First iterate the source iterator and then iterate the sameAs{3}
iterator, which was fully populated in the ctor.
|
ISPO[] |
nextChunk()
Return the next "chunk" from the iterator.
|
ISPO[] |
nextChunk(IKeyOrder<ISPO> keyOrder)
Return the next "chunk" of elements.
|
void |
remove()
Removes the last element visited by
IChunkedIterator.next() (optional operation). |
createTempTripleStore, dumpSPO, getSames, getSames, getSelfAndSames
public BackchainOwlSameAsPropertiesPOIterator(IChunkedOrderedIterator<ISPO> src, IV p, IV o, AbstractTripleStore db, IV sameAs)
src
- The source iterator. nextChunk()
will sort statements
into the IKeyOrder
reported by this iterator (as long
as the IKeyOrder
is non-null
).p
- The predicate of the triple pattern. Can be null.o
- The object of the triple pattern. Cannot be null.db
- The database from which we will read the distinct subject
identifiers (iff this is an all unbound triple pattern).sameAs
- The term identifier that corresponds to owl:sameAs for the
database.public IKeyOrder<ISPO> getKeyOrder()
IChunkedOrderedIterator
null
if not known.public boolean hasNext()
public ISPO next()
public ISPO[] nextChunk()
IChunkedIterator
public ISPO[] nextChunk(IKeyOrder<ISPO> keyOrder)
IChunkedOrderedIterator
IChunkedOrderedIterator.getKeyOrder()
would return non-null
and the request order corresponds to the value that would be returned by
IChunkedOrderedIterator.getKeyOrder()
then the elements in the next chunk are NOT
sorted. Otherwise the elements in the next chunk are sorted before they
are returned. The size of the chunk is up to the implementation.keyOrder
- The natural order for the elements in the chunk.public void close()
ICloseable
ICloseable.close()
once it is known that the object
will no longer be used.public void remove()
IChunkedIterator
IChunkedIterator.next()
(optional operation).
Note: This method is not readily suited for use with IChunkedIterator.nextChunk()
since the latter has already visited everything in the chunk and
IChunkedIterator.remove()
would only remove the last item in the chunk. Normally
you will want to accumulate items to be removed in a buffer and then
submit the buffer to some batch api operation when it overflows.
Alternatively, the IRangeQuery.REMOVEALL
flag may be used with
the source iterator to remove elements from the index as they are
visited.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.