Module org.apache.jena.geosparql
Class QueryRewriteIndex
java.lang.Object
org.apache.jena.geosparql.implementation.index.QueryRewriteIndex
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.jena.sparql.util.Symbol
-
Constructor Summary
ConstructorDescriptionQueryRewriteIndex
(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
(org.apache.jena.query.Dataset dataset) Prepare a Dataset with the default QueryRewriteIndex settings.static final void
prepare
(org.apache.jena.query.Dataset dataset, String queryRewriteLabel, int maxSize, long expiryInterval) 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
(org.apache.jena.query.Dataset dataset) Retrieve the QueryRewriteIndex from the Dataset Context.
If no index has been setup then QueryRewriteIndex is created.static final QueryRewriteIndex
retrieve
(org.apache.jena.sparql.engine.ExecutionContext execCxt) Retrieve the QueryRewriteIndex from the Context.
If no index has been setup then QueryRewriteIndex is created.static final QueryRewriteIndex
retrieve
(org.apache.jena.sparql.util.Context context) 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. 0 for no expiry.static final void
setMaxSize
(int mapSizeDefault) Set the maximum default size of QueryRewriteIndexes. -1 for no limit, 0 for no storage.final Boolean
test
(org.apache.jena.graph.Node subjectGeometryLiteral, org.apache.jena.graph.Node predicate, org.apache.jena.graph.Node objectGeometryLiteral, GenericPropertyFunction propertyFunction) org.apache.jena.rdf.model.Model
toModel()
Converts the index to a model of asserted spatial relation statements.static final org.apache.jena.query.Dataset
wrapModel
(org.apache.jena.rdf.model.Model model) Wrap Model in a Dataset and include QueryRewriteIndex.
-
Field Details
-
QUERY_REWRITE_INDEX_SYMBOL
public static final org.apache.jena.sparql.util.Symbol QUERY_REWRITE_INDEX_SYMBOL
-
-
Constructor Details
-
QueryRewriteIndex
public QueryRewriteIndex() -
QueryRewriteIndex
-
-
Method Details
-
test
public final Boolean test(org.apache.jena.graph.Node subjectGeometryLiteral, org.apache.jena.graph.Node predicate, org.apache.jena.graph.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. -
isIndexActive
public boolean isIndexActive()- Returns:
- True if index is active.
-
toModel
public org.apache.jena.rdf.model.Model 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
- Maximum sizeexpiryInterval
- Expiry interval
-
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
public static final void prepare(org.apache.jena.query.Dataset dataset) Prepare a Dataset with the default QueryRewriteIndex settings.- Parameters:
dataset
-
-
prepare
public static final void prepare(org.apache.jena.query.Dataset dataset, String queryRewriteLabel, int maxSize, long expiryInterval) Prepare a Dataset with the provided QueryRewriteIndex settings.- Parameters:
dataset
-queryRewriteLabel
-maxSize
-expiryInterval
-
-
retrieve
public static final QueryRewriteIndex retrieve(org.apache.jena.sparql.engine.ExecutionContext execCxt) 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
public static final org.apache.jena.query.Dataset wrapModel(org.apache.jena.rdf.model.Model model) Wrap Model in a Dataset and include QueryRewriteIndex.- Parameters:
model
-- Returns:
- Dataset with default Model and QueryRewriteIndex in Context.
-