|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.rules.BackchainAccessPath
public class BackchainAccessPath
A read-only IAccessPath that backchains certain inferences.
Note: Low level methods may not behave quite as expected since some elements
will be generated by the backchainer and hence present in the underlying
SPORelation. See the notes on the various methods in the API for
more details.
| Field Summary | |
|---|---|
protected static boolean |
DEBUG
|
protected static boolean |
INFO
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
BackchainAccessPath(AbstractTripleStore database,
IAccessPath<ISPO> accessPath)
|
|
BackchainAccessPath(AbstractTripleStore database,
IAccessPath<ISPO> accessPath,
Boolean isOwlSameAsUsed)
|
|
| Method Summary | |
|---|---|
IIndex |
getIndex()
The IIndex for the source IAccessPath. |
IKeyOrder<ISPO> |
getKeyOrder()
The order in which the elements will be visited. |
IPredicate<ISPO> |
getPredicate()
The constraints on the IAccessPath. |
IAccessPath<ISPO> |
getSource()
The source IAccessPath. |
boolean |
isEmpty()
True iff the access path is empty (there are no matches for the IPredicate) This is more conclusive than #rangeCount()
since you MAY have a non-zero range count when the key range is in fact
empty (there may be "deleted" index entries within the key range). |
IChunkedOrderedIterator<ISPO> |
iterator()
Visits elements in the source IAccessPath plus all entailments
licensed by the InferenceEngine. |
IChunkedOrderedIterator<ISPO> |
iterator(int limit,
int capacity)
Visits elements in the source IAccessPath plus all entailments
licensed by the InferenceEngine as configured. |
IChunkedOrderedIterator<ISPO> |
iterator(long offset,
long limit,
int capacity)
An iterator visiting elements using the natural order of the index selected for the IPredicate. |
long |
rangeCount(boolean exact)
When exact == false this does not count the backchained
entailments. |
ITupleIterator<ISPO> |
rangeIterator()
Delegated to the source IAccessPath (does not visit any
entailments). |
long |
removeAll()
Delegated to the source IAccessPath. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final transient org.apache.log4j.Logger log
protected static final boolean INFO
protected static final boolean DEBUG
| Constructor Detail |
|---|
public BackchainAccessPath(AbstractTripleStore database,
IAccessPath<ISPO> accessPath)
database - The database whose entailments will be backchained.accessPath - The source IAccessPath.
public BackchainAccessPath(AbstractTripleStore database,
IAccessPath<ISPO> accessPath,
Boolean isOwlSameAsUsed)
database - The database whose entailments will be backchained.accessPath - The source IAccessPath.isOwlSameAsUsed - When non-null, this Boolean indicates
whether the statement pattern (x owl:sameAs y)
is known to be empty in the data. Specify null
if you do not know this up front. This parameter is used to
factor out the test for this statement pattern, but that test
is only performed if Axioms.isOwlSameAs() is
true.| Method Detail |
|---|
public final IAccessPath<ISPO> getSource()
IAccessPath.
public final IIndex getIndex()
IIndex for the source IAccessPath.
getIndex in interface IAccessPath<ISPO>public final IKeyOrder<ISPO> getKeyOrder()
IAccessPath
getKeyOrder in interface IAccessPath<ISPO>public final IPredicate<ISPO> getPredicate()
IAccessPathIAccessPath.
getPredicate in interface IAccessPath<ISPO>public boolean isEmpty()
IAccessPathIPredicate) This is more conclusive than #rangeCount()
since you MAY have a non-zero range count when the key range is in fact
empty (there may be "deleted" index entries within the key range).
isEmpty in interface IAccessPath<ISPO>public IChunkedOrderedIterator<ISPO> iterator()
IAccessPath plus all entailments
licensed by the InferenceEngine.
iterator in interface IAccessPath<ISPO>iterator in interface Iterable<ISPO>IRelation.getAccessPath(IPredicate)
public IChunkedOrderedIterator<ISPO> iterator(long offset,
long limit,
int capacity)
IAccessPathIPredicate.
The offset and limit together describe an optional
slice that will be visited by the iterator. When a slice is
specified, the iterator will count off the elements accepted by the
IPredicate up to the offset, but not materialize them.
Elements by the IPredicate starting with the offset and up
to (but not including) offset+limit will be materialized for the
client. The iterator will halt processing after observing
offset+limit accepted elements. Note that slices for JOINs (vs a
simple IAccessPath scan) are handled by IQueryOptions for
an IRule.
The meaning of "accepted" is that: (a) the elements lie in the key-range
constraint implied by the IPredicate; and (b) the elements pass
any optional constraints that the IPredicate imposes.
iterator in interface IAccessPath<ISPO>offset - The first element accepted by the iterator that it will visit
(materialize for the client). The offset must be non-negative.
This is ZERO (0L) to visit all accepted elements.limit - The last element accepted by the iterator that it will visit
(materialize for the client). The limit must be non-negative.
This is ZERO (0L) to visit all accepted elements (the value
Long.MAX_VALUE is interpreted exactly like ZERO(0L)).capacity - The maximum capacity for the buffer used by the iterator. When
ZERO(0), a default capacity will be used. When a limit
is specified, the capacity will never exceed the limit.
IAccessPath. This way they
will be correctly applied when IAccessPath.isEmpty() is implemented
using the IAccessPath.iterator() to determine if any elements can be
visited.
public IChunkedOrderedIterator<ISPO> iterator(int limit,
int capacity)
IAccessPath plus all entailments
licensed by the InferenceEngine as configured.
iterator in interface IAccessPath<ISPO>limit - The maximum #of elements that will be visited -or- ZERO (0) if
there is no limit.capacity - The maximum capacity for the buffer used by the iterator. When
ZERO(0), a default capacity will be used. When a limit
is specified, the capacity will never exceed the limit.
public long rangeCount(boolean exact)
exact == false this does not count the backchained
entailments. When exact == true traverses the
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).
rangeCount in interface IAccessPath<ISPO>exact - When true, the result will be an exact count
and may require a key-range scan. When false,
the result will be an upper bound IFF delete markers are
provisioned for the backing index (delete markers are required
for transactions and for scale-out indices).IRangeQuerypublic ITupleIterator<ISPO> rangeIterator()
IAccessPath (does not visit any
entailments).
rangeIterator in interface IAccessPath<ISPO>public long removeAll()
IAccessPath.
removeAll in interface IAccessPath<ISPO>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||