-
Couldn't load subscription status.
- Fork 666
Description
Version
5.7.0-SNAPSHOT
Feature
This is the proposed sub system upon which execution tracking for both local and remote datasets can be based.
SparqlAdapterRegistry
The core idea is to introduce an indirection for sparql query and update execution.
The central class is SparqlAdapterRegistry which is a container for SparqlAdapterProvider instances:
public interface SparqlAdapterProvider {
SparqlAdapter adapt(DatasetGraph dsg);
// Perhaps rename to "createAdapter" to avoid confusion with "adapt" methods in presentation layer classes.
}
public interface SparqlAdapter {
QueryExecBuilder newQuery();
UpdateExecBuilder newUpdate();
}The main changes in QueryExec are as follows:
public static QueryExecBuilder dataset(DatasetGraph dataset) {
// Consult the registry to obtain an adapter implementation for the supplied dataset type.
return SparqlAdapterRegistry.adapt(dataset).newQuery();
}
public static QueryExecDatasetBuilder newBuilder() {
// We don't know the dataset yet, so adapter selection needs to be deferred until build().
return QueryExecDatasetBuilderDeferred.create();
}Deferred Builders
The subsequent change is the introduction of a QueryExecDatasetBuilderDeferred, which chooses the right adapter during build. Conventionally, it will obtain the SparqlAdapter for the default query engine, obtain its QueryExecBuilder and transfer its own settings to it.
The change for UpdateExec is likewise.
Major changes - For most users these should be source code compatible but they may not be byte code compatible:
QueryExecBuilderDatasetis now an interface. The original implementation isQueryExecBuilderDatasetImpl. The new one isQueryExecDatasetBuilderDeferred.QueryExecHTTPis now an interface. The original implementation isQueryExecHTTPImpl. The new one isQueryExecHTTPWrapperwhich can apply execution transformtions.
Exec Transformation
QueryExecBuildernow features atransformExec(Function<QueryExec, QueryExec> qeTransform)method. This allows for post-processing the QueryExec being built without having to change the builder type. One way to add execution tracking via builders with preconfigured transforms. Alternatively, the builder itself could (in addition) include logic that consults the context for any post processing to apply to QueryExecs.UpdateExecBuilderlikewise.
Are you interested in contributing a solution yourself?
Yes