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

Andy Seaborne edited comment on JENA-771 at 8/29/14 7:38 AM:
-------------------------------------------------------------

A couple of test cases:
{noformat}
filter true
  (distinct
    (filter (in ?x 1 2 3)
      (bgp (triple ?s ?p ?x)))))
==>
(filter true
  (distinct
    (filter (in ?x 1 2 3)
      (bgp (triple ?s ?p ?x)))))
{noformat}
but this one works:
{noformat}
(filter true
  (distinct
    (filter (= ?x <x>)
      (bgp (triple ?s ?p ?x)))))
==>
(filter true
  (distinct
    (assign ((?x <x>))
      (bgp (triple ?s ?p <x>)))))
{noformat}

It only seems to affect this particular transform. 


was (Author: andy.seaborne):
A couple of test cases:
{noformat}
filter true
  (distinct
    (filter (in ?x 1 2 3)
      (bgp (triple ?s ?p ?x)))))
==>
(filter true
  (distinct
    (filter (in ?x 1 2 3)
      (bgp (triple ?s ?p ?x)))))
{noformat}
{noformat}
(filter true
  (distinct
    (filter (= ?x <x>)
      (bgp (triple ?s ?p ?x)))))
==>
(filter true
  (distinct
    (assign ((?x <x>))
      (bgp (triple ?s ?p <x>)))))
{noformat}
{{ExprTransforms}} seem to work.  {{TransformExpandOneOf}} should probably work 
that way.

But this isn't the only thing going on e.g.
{noformat}
(distinct
  (filter true
    (distinct
      (filter (= ?x <x>)
        (bgp (triple ?s ?p ?x))))))
==>
(distinct
  (filter true
    (distinct
      (assign ((?x <x>))
        (bgp (triple ?s ?p <x>))))))
{noformat}
where rewriting the inner filters sub-op has worked.

> TransformExpandOneOf is not applied as expected
> -----------------------------------------------
>
>                 Key: JENA-771
>                 URL: https://issues.apache.org/jira/browse/JENA-771
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 2.12.0
>            Reporter: Rob Vesse
>            Assignee: Andy Seaborne
>              Labels: optimizer, sparql
>
> We ran into a strange case where {{TransformExpandOneOf}} doesn't appear to 
> get applied properly.
> Consider the following query:
> {noformat}
> SELECT ?x
> WHERE
> {
>   FILTER(true)
>   {
>     SELECT ?x
>     WHERE
>     {
>       FILTER (?x NOT IN (1, 2, 3))
>     }
>   }
> }
> {noformat}
> Which produces the following algebra:
> {noformat}
> (project (?x)
>   (project (?x)
>     (filter (exprlist true (notin ?x 1 2 3))
>       (table unit))))
> {noformat}
> Note that the {{NOT IN}} was left in the expression form rather than being 
> expanded to the equivalent {{!=}} expressions.
> If the first {{FILTER}} line is commented out then the following algebra is 
> produced:
> {noformat}
> (project (?x)
>   (project (?x)
>     (filter (exprlist (!= ?x 1) (!= ?x 2) (!= ?x 3))
>       (table unit))))
> {noformat}
> So it looks like there is something going on that somehow blocks 
> {{TransformExpandOneOf}} from working when another filter is present in the 
> outer query.  Possibly this is something related to filter placement?
> This problem occurs as far back as 2.11.1 and can be reproduced with 2.11.2, 
> 2.12.0 and current trunk.  It does not appear in 2.11.0 so must have been 
> introduced in 2.11.1



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to