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

Andy Seaborne commented on JENA-1167:
-------------------------------------

The original title "VALUES gets pushed to front wrongly." is wrong.

The problem is that the VarFinder process does take into account that a filter 
variable mayb be unset, and then after the filter, it can be defined.  The 
results from VarFinder don't reflect this.

Then the JoinClassifier makes the wrong decision because it is insensitive to a 
variable used in filter and then defined.

Solution: 
# VarFinder to return a note of variables used in filters before being defined.
# JoinClassifier needs to use this information.
# Check LeftJoinClassifier as well.


> VALUES gets pushed to front wrongly.
> ------------------------------------
>
>                 Key: JENA-1167
>                 URL: https://issues.apache.org/jira/browse/JENA-1167
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.0.1
>            Reporter: Andy Seaborne
>         Attachments: D.ttl, Q.rq, dwim
>
>
> {noformat}
> Query: Q.rq
>      1        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>      2        PREFIX ex:  <http://example.com/>
>      3        SELECT ?label {
>      4            {
>      5                FILTER (bound(?arg1))
>      6            }
>      7            ?arg1 rdfs:label ?label
>      8        }
>      9        VALUES ?arg1 { ex:a  UNDEF }
> Data: D.ttl
>      1        @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
>      2        @prefix ex: <http://example.com/>.
>      3        
>      4        ex:a rdfs:label "A".
>      5        ex:b rdfs:label "B".
> Execute: qparse --print=op --print=opt --query Q.rq
> (prefix ((rdfs: <http://www.w3.org/2000/01/rdf-schema#>)
>          (ex: <http://example.com/>))
>   (project (?label)
>     (join
>       (join
>         (filter (bound ?arg1)
>           (table unit))
>         (bgp (triple ?arg1 rdfs:label ?label)))
>       (table (vars ?arg1)
>         (row [?arg1 ex:a])
>         (row)
>       ))))
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> (prefix ((rdfs: <http://www.w3.org/2000/01/rdf-schema#>)
>          (ex: <http://example.com/>))
>   (project (?label)
>     (sequence
>       (table (vars ?arg1)
>         (row [?arg1 ex:a])
>         (row)
>       )
>       (sequence
>         (filter (bound ?arg1)
>           (table unit))
>         (bgp (triple ?arg1 rdfs:label ?label))))))
> Execute: sparql --engine=ref --query Q.rq --data D.ttl
> ---------
> | label |
> =========
> ---------
> Execute: sparql --query Q.rq --data D.ttl
> ---------
> | label |
> =========
> | "A"   |
> ---------
> {noformat}



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

Reply via email to