The current LATERAL implementation in Jena does not work the way the spec is going.

Jena is rewriting the query (as you can see in the Fuseki log) as

   "SELECT ?wdWorker ("string" AS ?label) {"

which is illegal because  ?label is set in the query pattern.

At a guess, the syntax checker for LATERAL is not looking inside SERVICE but I'd also expect the server to reject the query (400), not fail as an execution error.

Does that form appear in the fuseki log?
Any other messages?

> 14:39:59 WARN QueryIterCommonParent$ConverterExtend :: Binding already for
> ?label (same value)

Is that in the Fuseki log or output by the local query execution log?

Do you have a simpler query example?

    Andy

On 09/03/2026 14:02, Martynas Jusevičius wrote:
Hi,

I found a use case for LATERAL and I'm testing a query like this:

PREFIX worker: <https://example.org/ontology/worker#>
PREFIX wd:     <https://w3id.org/atomgraph/workday#>
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:    <http://www.w3.org/2002/07/owl#>

CONSTRUCT {
   ?dgsWorker owl:sameAs ?wdWorker .
}
WHERE {
   ?dgsWorker a worker:Person ;
              rdfs:label ?label .

   LATERAL {
     SERVICE <http://localhost:8181/workday/sparql> {
       SELECT ?wdWorker ?label {
           ?wdWorker a wd:Worker ;
                     foaf:name ?label .
       }
     }
   }
}

It gets names from a local file and reconciles them against a virtual
SPARQL endpoint.
The query produces results but each SERVICE call prints a warning like this:

14:39:59 WARN  QueryIterCommonParent$ConverterExtend :: Binding already for
?label (same value)

What does this mean exactly? Does the query need reformulation to avoid
this?

Thanks.

Martynas


Reply via email to