[ 
https://issues.apache.org/jira/browse/JENA-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17058115#comment-17058115
 ] 

Claus Stadler commented on JENA-1843:
-------------------------------------

My bad, it was an issue on my side:

First, I confused my test case results and I can confirm above query string 
works in latest Jena.
Second, the actual issue was that I programmatically generated an OpExtend with 
a VarExprList with a variable that mapped to a null expression. The would 
roughly correspond to the invalid SPARQL syntax "BIND(UNDEF AS ?o)".

{code}
(project (?x ?o ?z)
  (extend ((?x ?s) ?o (?z ?p))  <--- The issue was here
    (table (vars ?s ?p ?o)
      (row [?p <http://ex.org/p>] [?o <http://ex.org/o>] [?s <http://ex.org/s>])
    )))
{code}


> OpAsQuery: Wrong order of Extend/Bind
> -------------------------------------
>
>                 Key: JENA-1843
>                 URL: https://issues.apache.org/jira/browse/JENA-1843
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.14.0
>            Reporter: Claus Stadler
>            Assignee: Andy Seaborne
>            Priority: Major
>             Fix For: Jena 3.15.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> OpAsQuery breaks BINDs that depend on each other:
>  
> {code:java}
> Query expected = QueryFactory.create("SELECT *
> { ?s ?p ?o BIND(?s AS ?x) BIND(?x AS ?y) }
> ");
>  Query actual = OpAsQuery.asQuery(Algebra.compile(expected));
>  System.out.println(expected);
>  System.out.println(actual);
> {code}
> The two BIND statements incorrectly end up in reversed order - thus ?x is no 
> longer bound in the result set:
> {code:java}
> expected: SELECT * WHERE { ?s ?p ?o BIND(?s AS ?x) BIND(?x AS ?y) }
> actual  : SELECT * WHERE { ?s ?p ?o BIND(?x AS ?y) BIND(?s AS ?x) }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to