Aklakan commented on issue #2996: URL: https://github.com/apache/jena/issues/2996#issuecomment-2642948889
This behavior is in accordance with the [documentation](https://jena.apache.org/documentation/query/service_enhancer.html). > ### SERVICE loop: vs LATERAL > Since Jena 4.7.0 the SPARQL engine has native support for the LATERAL keyword which should almost always be preferred over SERVICE <loop:>. The use of SERVICE <loop:> is essentially only justified in combination with bulk requests, such as SERVICE <loop:bulk+5:>. > Also note, that the semantics of loop: and LATERAL differ: the former substitutes variables **regardless of scope**, whereas the latter substitutes only in-scope variables. Another difference is, that loop: creates a new execution context for each request (even for local ones) such that the NOW() function will yield increasing timestamps as query execution progresses. > Currently, the SE plugin does not support bulk requests under LATERAL semantics. A note on the background: The reason for this difference is, on the one hand, that the service enhancer plugin predates the formalization and implementation of LATERAL and on the other hand the goal was to add the bulk and caching features without requiring changes to jena's core machinery. If for some reason this behavior is a blocking issue for you, the best I can offer is to try out the service enhancer from this branch (my working copy of jena): https://github.com/Aklakan/jena/tree/se-fixes-2023-11-29 This one should allow for writing `SERVICE <loop+scoped:bulk+5:...>` which mimics LATERAL semantics more closely, as substitution is then only performed on in-scope variables. This should behave more in expected ways, but because of the basic substitution there are still corner cases where results will differ from LATERAL. -- 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]
