galgonek opened a new issue, #2992:
URL: https://github.com/apache/jena/issues/2992

   ### Version
   
   5.3.0
   
   ### What happened?
   
   I used the service enhancer plugin and executed the following query:
   
   ```sparql
   PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
   
   SELECT * WHERE {  
     VALUES ?STRUCTURE { "[He]" "[Ar]" }
     SERVICE <loop:bulk+5:https://idsm.elixir-czech.cz/sparql/endpoint/chebi> {
       ?COMPOUND sachem:substructureSearch [ sachem:query ?STRUCTURE ]
     }
   }
   ```
   
   After running this query, the following query is sent to the specified 
endpoint:
   
   ```
   SELECT  *
   WHERE
     {   { ?COMPOUND  
<http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#substructureSearch>  _:b0 .
           _:b0      <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#query>  "[He]"
           BIND(0 AS ?__idx__)
         }
       UNION
         {   { ?COMPOUND  
<http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#substructureSearch>  _:b0 .
               _:b0      <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#query>  
"[Ar]"
               BIND(1 AS ?__idx__)
             }
           UNION
             { BIND(1000000000 AS ?__idx__) }
         }
     }
   ORDER BY ASC(?__idx__)
   ```
   
   I believe that this generated query violates the SPARQL specification. 
According to the 
[specification](https://www.w3.org/TR/sparql11-query/#bgpBNodeLabels), _when 
using blank nodes of the form \_:abc,  labels for blank nodes are scoped to the 
basic graph pattern. A label can be used in only a single basic graph pattern 
in any query._ However, the generated query uses the label `_:b0` in two 
separate basic graph patterns, which, in my opinion, contradicts this rule.
   
   ### Relevant output and stacktrace
   
   ```shell
   
   ```
   
   ### Are you interested in making a pull request?
   
   None


-- 
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]

Reply via email to