[ 
https://issues.apache.org/jira/browse/JENA-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne resolved JENA-1235.
---------------------------------
       Resolution: Fixed
    Fix Version/s: Jena 3.1.1

> Disjunction expansion then blocks filter placement.
> ---------------------------------------------------
>
>                 Key: JENA-1235
>                 URL: https://issues.apache.org/jira/browse/JENA-1235
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.0.0
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>             Fix For: Jena 3.1.1
>
>
> Original report: [email on 
> users@|https://lists.apache.org/thread.html/e23d8cdc5160548d5de59c739043c5015e790ea2eca73422246dd7a3@%3Cusers.jena.apache.org%3E]
> {noformat}
>     public static void main(String ...args) {
>         String qs = StrUtils.strjoinNL
>             ("PREFIX  :     <http://example.org>"
>             ,""
>             ,"SELECT *"
>             ,"{"
>             ,"    FILTER ( ( ?var3 = 'ABC' ) || ( ?var3 = 'XYZ' ) )"
>             ,"    FILTER ( regex(?var4, 'pat1') && ?VAR!=123)"
>             ,"    ?var2  :p1  ?var4 ;"
>             ,"           :p2  ?var3 ."
>             ,"}"
>             ) ;
>         Query query = QueryFactory.create(qs);
>         Op op = Algebra.compile(query) ;
>         Op op1 = Algebra.optimize(op) ;
>         System.out.println(op1); 
>     }
> {noformat}
> gives this where the regex has not been pushed in:
> {noformat}
> (filter (exprlist (regex ?var4 "pat1") (!= ?VAR 123))
>   (disjunction
>     (assign ((?var3 "ABC"))
>       (bgp
>         (triple ?var2 <http://example.orgp1> ?var4)
>         (triple ?var2 <http://example.orgp2> "ABC")
>       ))
>     (assign ((?var3 "XYZ"))
>       (bgp
>         (triple ?var2 <http://example.orgp1> ?var4)
>         (triple ?var2 <http://example.orgp2> "XYZ")
>       ))))
> {noformat}
> as in: (note the {{(!= ?VAR 123)}} remains outside as it is not used. This is 
> more about being tidy).
> {noformat}
> (filter (!= ?VAR 123)
>   (disjunction
>     (assign ((?var3 "ABC"))
>       (sequence
>         (filter (regex ?var4 "pat1")
>           (bgp (triple ?var2 <http://example.orgp1> ?var4)))
>         (bgp (triple ?var2 <http://example.orgp2> "ABC"))))
>     (assign ((?var3 "XYZ"))
>       (sequence
>         (filter (regex ?var4 "pat1")
>           (bgp (triple ?var2 <http://example.orgp1> ?var4)))
>         (bgp (triple ?var2 <http://example.orgp2> "XYZ"))))))
> {noformat}



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

Reply via email to