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

Claus Stadler edited comment on JENA-1843 at 3/12/20, 3:24 PM:
---------------------------------------------------------------

Hi Andy,

While I tried to investigate JENA-1858, I checked out the latest master 
(3.15.0-SNAPSHOT) which has the fix for JENA-1843 (this issue) included, but 
this unfortunately gives me a failing test in my own code which reduces to this 
line (it works with jena 3.14.0):

{code}
Query q = OpAsQuery.asQuery(Algebra.compile(QueryFactory.create("SELECT (?s AS 
?x) { ?s ?p ?o }")));
{code}

The exception is:
{code}
java.lang.RuntimeException
        at 
org.apache.jena.sparql.algebra.walker.ApplyTransformVisitor.pop(ApplyTransformVisitor.java:458)
...
{code}


was (Author: aklakan):
Hi Andy,

I checked out the latest master (3.15.0-SNAPSHOT) which has the fix for 
JENA-1843 (this issue) included, but this unfortunately gives me a failing test 
in my own code which reduces to this line (it works with jena 3.14.0):

{code}
Query q = OpAsQuery.asQuery(Algebra.compile(QueryFactory.create("SELECT (?s AS 
?x) { ?s ?p ?o }")));
{code}

The exception is:
{code}
java.lang.RuntimeException
        at 
org.apache.jena.sparql.algebra.walker.ApplyTransformVisitor.pop(ApplyTransformVisitor.java:458)
...
{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