You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2014/10/31 14:20:35 UTC

[jira] [Comment Edited] (JENA-809) TransformExtendCombine breaks BINDs inside SERVICE

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

Andy Seaborne edited comment on JENA-809 at 10/31/14 1:20 PM:
--------------------------------------------------------------

There is modification in-place going on: printing the input op before and after shows a change.

{noformat}
    public static void main(String... argv) throws Exception {
        String x = "SELECT * { SERVICE <> { BIND(1 AS ?foo) BIND(2 AS ?bar) } }" ;
        Query query = QueryFactory.create(x) ;
        Op op = Algebra.compile(query) ;
        System.out.println(op) ;
        Transform t = new TransformExtendCombine() ;
        Op op2 = Transformer.transformSkipService(t, op) ;
        System.out.println(op) ;
    }
{noformat}
yields
{noformat}
(service <file:///home/afs/Projects/X/>
  (extend ((?bar 2))
    (extend ((?foo 1))
      (table unit))))

(service <file:///home/afs/Projects/X/>
  (extend ((?bar 2))
    (extend ((?foo 1) (?bar 2))
      (table unit))))
{noformat}



was (Author: andy.seaborne):
There is modification in-p-lace going on: printing the input op before and after shows a change.

{noformat}
    public static void main(String... argv) throws Exception {
        String x = "SELECT * { SERVICE <> { BIND(1 AS ?foo) BIND(2 AS ?bar) } }" ;
        Query query = QueryFactory.create(x) ;
        Op op = Algebra.compile(query) ;
        System.out.println(op) ;
        Transform t = new TransformExtendCombine() ;
        Op op2 = Transformer.transformSkipService(t, op) ;
        System.out.println(op) ;
    }
{noformat}
yields
{noformat}
(service <file:///home/afs/Projects/X/>
  (extend ((?bar 2))
    (extend ((?foo 1))
      (table unit))))

(service <file:///home/afs/Projects/X/>
  (extend ((?bar 2))
    (extend ((?foo 1) (?bar 2))
      (table unit))))
{noformat}


> TransformExtendCombine breaks BINDs inside SERVICE
> --------------------------------------------------
>
>                 Key: JENA-809
>                 URL: https://issues.apache.org/jira/browse/JENA-809
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 2.12.1
>            Reporter: Eetu Mäkelä
>
> Optimization breaks BIND expressions in some situations since TransformExtendCombine was enabled in commit 4e5fe9a20d1531430ab96cb2ab9694aed9a9538b (culprit found using git bisect). I don't know exactly when or why this happens, but I hit upon this while using SERVICE. I've been able to create the following minimal example.
> For the query:
> {code}
> SELECT * {
>  SERVICE <> {
>     BIND(1 AS ?foo)
>     BIND(2 AS ?bar)
>  }
> }
> {code}
> qparse --explain for 2.12.0 returns:
> {code}
> (service <file:///home/jiemakel/qf>
>   (extend ((?foo 1) (?bar 2))
>     (table unit)))
> {code}
> which works fine, while for 2.12.1 it returns:
> {code}
> (service <file:///home/jiemakel/qf>
>   (extend ((?bar 2))
>     (extend ((?foo 1) (?bar 2))
>       (table unit))))
> {code}
> which binds ?bar twice, and fails with {{BIND: Variable used when already in-scope: ?bar in BIND(2 AS ?bar)}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)