Class QueryRewriteIndex
java.lang.Object
org.apache.jena.geosparql.implementation.index.QueryRewriteIndex
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQueryRewriteIndex
(String queryRewriteLabel, int maxSize, long expiryInterval) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
clear()
Empty the index.static final QueryRewriteIndex
Create QueryRewriteIndex using the default global settings.final long
boolean
static final void
Prepare a Dataset with the default QueryRewriteIndex settings.static final void
Prepare a Dataset with the provided QueryRewriteIndex settings.void
reset
(int maxSize, long expiryInterval) Reset the index to the provided max size and expiry interval.
All contents will be lost.static final QueryRewriteIndex
Retrieve the QueryRewriteIndex from the Dataset Context.
If no index has been setup then QueryRewriteIndex is created.static final QueryRewriteIndex
retrieve
(ExecutionContext execCxt) Retrieve the QueryRewriteIndex from the Context.
If no index has been setup then QueryRewriteIndex is created.static final QueryRewriteIndex
Retrieve the QueryRewriteIndex from the Dataset Context.
If no index has been setup then QueryRewriteIndex is created.final void
setActive
(boolean indexActive) Sets whether the index is active.static final void
setExpiry
(long mapExpiryIntervalDefault) Set the maximum default expiry interval in millisecond of QueryRewriteIndexes.final void
setMapExpiry
(long expiryInterval) Sets the expiry time in milliseconds of the Query Rewrite Index, if active.final void
setMapSize
(int maxSize) Sets whether the Query Rewrite Index is active.static final void
setMaxSize
(int mapSizeDefault) Set the maximum default size of QueryRewriteIndexes.final Boolean
test
(Node subjectGeometryLiteral, Node predicate, Node objectGeometryLiteral, GenericPropertyFunction propertyFunction) toModel()
COnverts the index to a model of asserted spatial relation statements.static final Dataset
Wrap Model in a Dataset and include QueryRewriteIndex.
-
Field Details
-
QUERY_REWRITE_INDEX_SYMBOL
-
-
Constructor Details
-
QueryRewriteIndex
public QueryRewriteIndex() -
QueryRewriteIndex
-
-
Method Details
-
test
public final Boolean test(Node subjectGeometryLiteral, Node predicate, Node objectGeometryLiteral, GenericPropertyFunction propertyFunction) - Parameters:
subjectGeometryLiteral
-predicate
-objectGeometryLiteral
-propertyFunction
-- Returns:
- Result of relation between subject and object.
-
clear
public final void clear()Empty the index. -
setMapSize
public final void setMapSize(int maxSize) Sets whether the Query Rewrite Index is active.
The index will be empty after this process.- Parameters:
maxSize
- : use -1 for unlimited size
-
setMapExpiry
public final void setMapExpiry(long expiryInterval) Sets the expiry time in milliseconds of the Query Rewrite Index, if active.- Parameters:
expiryInterval
- : use 0 or negative for unlimited timeout
-
isIndexActive
public boolean isIndexActive()- Returns:
- True if index is active.
-
toModel
COnverts the index to a model of asserted spatial relation statements.- Returns:
- Model containing all true assertions.
-
setActive
public final void setActive(boolean indexActive) Sets whether the index is active.- Parameters:
indexActive
-
-
getIndexSize
public final long getIndexSize()- Returns:
- Number of items in the index.
-
reset
public void reset(int maxSize, long expiryInterval) Reset the index to the provided max size and expiry interval.
All contents will be lost.- Parameters:
maxSize
-expiryInterval
-
-
setMaxSize
public static final void setMaxSize(int mapSizeDefault) Set the maximum default size of QueryRewriteIndexes. -1 for no limit, 0 for no storage.- Parameters:
mapSizeDefault
-
-
setExpiry
public static final void setExpiry(long mapExpiryIntervalDefault) Set the maximum default expiry interval in millisecond of QueryRewriteIndexes. 0 for no expiry.- Parameters:
mapExpiryIntervalDefault
-
-
createDefault
Create QueryRewriteIndex using the default global settings.- Returns:
- Query Rewrite Index using default global settings.
-
prepare
Prepare a Dataset with the default QueryRewriteIndex settings.- Parameters:
dataset
-
-
prepare
public static final void prepare(Dataset dataset, String queryRewriteLabel, int maxSize, long expiryInterval) Prepare a Dataset with the provided QueryRewriteIndex settings.- Parameters:
dataset
-queryRewriteLabel
-maxSize
-expiryInterval
-
-
retrieve
Retrieve the QueryRewriteIndex from the Context.
If no index has been setup then QueryRewriteIndex is created.- Parameters:
execCxt
-- Returns:
- QueryRewriteIndex contained in the Context.
-
retrieve
Retrieve the QueryRewriteIndex from the Dataset Context.
If no index has been setup then QueryRewriteIndex is created.- Parameters:
dataset
-- Returns:
- QueryRewriteIndex contained in the Context.
-
retrieve
Retrieve the QueryRewriteIndex from the Dataset Context.
If no index has been setup then QueryRewriteIndex is created.- Parameters:
context
-- Returns:
- QueryRewriteIndex contained in the Context.
-
wrapModel
Wrap Model in a Dataset and include QueryRewriteIndex.- Parameters:
model
-- Returns:
- Dataset with default Model and QueryRewriteIndex in Context.
-