Aklakan commented on PR #3184:
URL: https://github.com/apache/jena/pull/3184#issuecomment-3092539788
The original code integrated exec tracking into the
Update-/QueryEngineFactory system. However, this was sub-par because execution
could only be intercepted on the QueryIterator level.
My updated proposal is to introduce a new layer Update-/QueryDispatcher on
top of the Update-/QueryEngineFactory machinery. Now it is possible to
intercept any query / update request to a dataset - even without having to
parse the query.
Old design: QueryExecBuilderDataset -build-> QueryExecDataset -exec->
QueryEngineRegistry
New design: QueryExecBuilderDataset -build-> **QueryDispatcherRegistry**
-customized build-> QueryExec
The returned QueryExec may be of any type, such as a tracking wrapper - it
is no longer necessarily a QueryExecDataset.
Consequences:
* Code that relies on QueryExecBuilderDataset to always return a
QueryExecDataset may break when adding custom interceptors. This should be a
low price to pay because usually one should rely on the QueryExec interface.
* Execution Tracking can be added without any change to the existing code.
## Related Ongoing Work
As a demo for related work based on this infrastructure, we are using it to
integrate third party triple stores - such as Qlever - into Fuseki. This way we
can use one server framework to manage several triple stores.
Technically, we created a DatasetGraph wrapper implementation that is backed
by a factory of HTTP RDFConnection instances (such as to a remote Qlever
database). The query dispatcher just forwards query/update requests to an
RDFConnection obtained from such a DatasetGraph implementation.
Any opinions on this design?
As a final note, we also already created an assembler that starts qlever
from a docker image as part of Fuseki (via the Java TestContainer framework),
so the configuration looks like this:
```turtle
<#baseDS> rdf:type qlever:Dataset ;
qlever:location "/run/databases/qlever/mydb/" ;
qlever:indexName "myindex" ;
qlever:accessToken "abcde" ;
qlever:memoryMaxSize "4G" ;
qlever:defaultQueryTimeout "600s" ;
```
[Example of Qlever in
Fuseki](https://data.aksw.org/#/dataset/text2sparql-2025-dbpedia-qlever/query?query=SELECT%20%28COUNT%28%2A%29%20AS%20%3Fc%29%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]