Module org.apache.jena.geosparql
Class SpatialIndexLib
java.lang.Object
org.apache.jena.geosparql.spatial.index.v2.SpatialIndexLib
ARQ-level utils for Dataset and Context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends Collection<org.apache.jena.graph.Node>>
CaccGraphNodes(C accGraphs, org.apache.jena.sparql.core.DatasetGraph dsg) static SpatialIndexbuildSpatialIndex(org.apache.jena.sparql.core.DatasetGraph datasetGraph) Build Spatial Index from all graphs in Dataset.
Dataset contains SpatialIndex in Context.
SRS URI based on most frequent found in Dataset.static SpatialIndexPerGraphbuildSpatialIndex(org.apache.jena.sparql.core.DatasetGraph datasetGraph, String srsURI) Build Spatial Index from all graphs in Dataset.
Dataset contains SpatialIndex in Context.static SpatialIndexPerGraphbuildSpatialIndexPerGraph(org.apache.jena.sparql.core.DatasetGraph datasetGraph, String srsURI) static TaskThreadcreateCleanTask(org.apache.jena.sparql.core.DatasetGraph dsg, Predicate<org.apache.jena.graph.Node> isAuthorizedGraph, BasicTask.TaskListener<BasicTask> taskListener) static TaskThreadcreateIndexerTask(org.apache.jena.sparql.core.DatasetGraph dsg, Predicate<org.apache.jena.graph.Node> isAuthorizedGraph, SpatialIndexerComputation indexComputation, BasicTask.TaskListener<BasicTask> taskListener, Path targetFile, boolean isReplaceTask) static final StringgetPreferredSRS(org.apache.jena.sparql.util.Context context) Set the preferred SRS for the given (dataset) context.static final <T extends SpatialIndex>
TgetSpatialIndex(org.apache.jena.sparql.core.DatasetGraph dsg) static final <T extends SpatialIndex>
TgetSpatialIndex(org.apache.jena.sparql.util.Context cxt) static final booleanisDefined(org.apache.jena.sparql.engine.ExecutionContext execCxt) static final SpatialIndexrequire(org.apache.jena.sparql.engine.ExecutionContext execCxt) Get the SpatialIndex from the Context.static BasicTaskscheduleOnceCleanTask(org.apache.jena.sparql.core.DatasetGraph dsg, BasicTask.TaskListener<BasicTask> taskListener) Attempt to start a spatial index task that cleans the index of graphs not present in the given dataset.static BasicTaskscheduleOnceIndexTask(org.apache.jena.sparql.core.DatasetGraph dsg, SpatialIndexerComputation indexComputation, Path targetFile, boolean isReplaceTask, BasicTask.TaskListener<BasicTask> taskListener) static final voidsetPreferredSRS(org.apache.jena.sparql.util.Context context, String srsUri) Set a preferred SRS for the given (dataset) context.static final voidsetSpatialIndex(org.apache.jena.query.Dataset dataset, SpatialIndex spatialIndex) Set the SpatialIndex into the Context of the Dataset for later retrieval and use in spatial functions.static final voidsetSpatialIndex(org.apache.jena.sparql.core.DatasetGraph datasetGraph, SpatialIndex spatialIndex) static final voidsetSpatialIndex(org.apache.jena.sparql.util.Context context, SpatialIndex spatialIndex) static org.apache.jena.graph.NodeunwrapGraphName(org.apache.jena.graph.Graph graph) static final org.apache.jena.query.DatasetwrapModel(org.apache.jena.rdf.model.Model model) Wrap Model in a Dataset and build SpatialIndex.static final org.apache.jena.query.DatasetWrap Model in a Dataset and build SpatialIndex.
-
Constructor Details
-
SpatialIndexLib
public SpatialIndexLib()
-
-
Method Details
-
getPreferredSRS
Set the preferred SRS for the given (dataset) context. -
setPreferredSRS
public static final void setPreferredSRS(org.apache.jena.sparql.util.Context context, String srsUri) Set a preferred SRS for the given (dataset) context. This SRS will be used when constructing a spatial index for the first time. -
setSpatialIndex
public static final void setSpatialIndex(org.apache.jena.query.Dataset dataset, SpatialIndex spatialIndex) Set the SpatialIndex into the Context of the Dataset for later retrieval and use in spatial functions.- Parameters:
dataset-spatialIndex-
-
setSpatialIndex
public static final void setSpatialIndex(org.apache.jena.sparql.core.DatasetGraph datasetGraph, SpatialIndex spatialIndex) -
setSpatialIndex
public static final void setSpatialIndex(org.apache.jena.sparql.util.Context context, SpatialIndex spatialIndex) -
getSpatialIndex
public static final <T extends SpatialIndex> T getSpatialIndex(org.apache.jena.sparql.util.Context cxt) -
getSpatialIndex
public static final <T extends SpatialIndex> T getSpatialIndex(org.apache.jena.sparql.core.DatasetGraph dsg) -
isDefined
public static final boolean isDefined(org.apache.jena.sparql.engine.ExecutionContext execCxt) - Parameters:
execCxt-- Returns:
- True if a SpatialIndex is defined in the ExecutionContext.
-
require
public static final SpatialIndex require(org.apache.jena.sparql.engine.ExecutionContext execCxt) throws SpatialIndexException Get the SpatialIndex from the Context. Fail if absent.- Parameters:
execCxt-- Returns:
- SpatialIndex contained in the Context.
- Throws:
SpatialIndexException
-
wrapModel
public static final org.apache.jena.query.Dataset wrapModel(org.apache.jena.rdf.model.Model model, String srsURI) throws SpatialIndexException Wrap Model in a Dataset and build SpatialIndex.- Parameters:
model-srsURI-- Returns:
- Dataset with default Model and SpatialIndex in Context.
- Throws:
SpatialIndexException
-
wrapModel
public static final org.apache.jena.query.Dataset wrapModel(org.apache.jena.rdf.model.Model model) throws SpatialIndexException Wrap Model in a Dataset and build SpatialIndex.- Parameters:
model-- Returns:
- Dataset with default Model and SpatialIndex in Context.
- Throws:
SpatialIndexException
-
buildSpatialIndex
public static SpatialIndex buildSpatialIndex(org.apache.jena.sparql.core.DatasetGraph datasetGraph) throws SpatialIndexException Build Spatial Index from all graphs in Dataset.
Dataset contains SpatialIndex in Context.
SRS URI based on most frequent found in Dataset.- Parameters:
datasetGraph-- Returns:
- SpatialIndex constructed.
- Throws:
SpatialIndexException
-
buildSpatialIndex
public static SpatialIndexPerGraph buildSpatialIndex(org.apache.jena.sparql.core.DatasetGraph datasetGraph, String srsURI) throws SpatialIndexException Build Spatial Index from all graphs in Dataset.
Dataset contains SpatialIndex in Context.- Parameters:
datasetGraph-srsURI-- Returns:
- SpatialIndex constructed.
- Throws:
SpatialIndexException
-
buildSpatialIndexPerGraph
public static SpatialIndexPerGraph buildSpatialIndexPerGraph(org.apache.jena.sparql.core.DatasetGraph datasetGraph, String srsURI) throws SpatialIndexException - Throws:
SpatialIndexException
-
unwrapGraphName
public static org.apache.jena.graph.Node unwrapGraphName(org.apache.jena.graph.Graph graph) -
scheduleOnceIndexTask
public static BasicTask scheduleOnceIndexTask(org.apache.jena.sparql.core.DatasetGraph dsg, SpatialIndexerComputation indexComputation, Path targetFile, boolean isReplaceTask, BasicTask.TaskListener<BasicTask> taskListener) -
createIndexerTask
public static TaskThread createIndexerTask(org.apache.jena.sparql.core.DatasetGraph dsg, Predicate<org.apache.jena.graph.Node> isAuthorizedGraph, SpatialIndexerComputation indexComputation, BasicTask.TaskListener<BasicTask> taskListener, Path targetFile, boolean isReplaceTask) -
scheduleOnceCleanTask
public static BasicTask scheduleOnceCleanTask(org.apache.jena.sparql.core.DatasetGraph dsg, BasicTask.TaskListener<BasicTask> taskListener) Attempt to start a spatial index task that cleans the index of graphs not present in the given dataset. This method fails if there is already another spatial index task running. -
createCleanTask
public static TaskThread createCleanTask(org.apache.jena.sparql.core.DatasetGraph dsg, Predicate<org.apache.jena.graph.Node> isAuthorizedGraph, BasicTask.TaskListener<BasicTask> taskListener) -
accGraphNodes
public static <C extends Collection<org.apache.jena.graph.Node>> C accGraphNodes(C accGraphs, org.apache.jena.sparql.core.DatasetGraph dsg)
-