While Jena features many extension points for SPARQL query processing, such as for custom functions and property functions, there is no dedicated extension point for custom SERVICE executors.
The relevant classes are OpExecutor and QueryIterService:
While it is possible to configure a custom OpExecutor's in a Context which provides SERVICE extensions, it is not possible to combine the functionality of two different OpExecutors.
Concrete use case: The following two projects use their own OpExecutor implementation for providing service extensions:
- RDF Processing Toolkit supports a service executor for doing binary search over remote sorted (bzip2 encoded) ntriples files
- SPARQL Anything provides service extensions for ingesting non-RDF data as RDF
- Introduce a ServiceExecutorFactory that serves as the extension point for supplying custom QueryIterators if the request can be handled
- Introduce a Symbol for referring to a List<ServiceExecutorFactory> in the Context
- Extend QueryIterService such that it consults the Context for custom ServiceExecutorFactories - and invokes the first match from the list before falling back to the standard implementation.
- Example usage:
This way, SERVICE extensions do not require custom OpExecutor implementations (because it would be handled by QueryIterService) - and conversely, such extensions would also work with any custom OpExecutor that yields the original QueryIterService implementation.
I could provide my implementation as a PR.