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

Andy Seaborne commented on JENA-1332:
-------------------------------------

That is the correct behaviour as fixed 3.1.0 -> 3.1.1.

{noformat}
WHERE
  { ?person  person:firstname  ?firstname ;
             person:lastname   ?lastname
      { FILTER NOT EXISTS { ?person  person:hasCar  ?carSubject } }
    UNION
      { ?person  person:hasCar  ?carSubject }
  }
{noformat}

The first BGP is evaluate, the UNION is evaluated (separately) and then they 
are joined so 
{noformat}
{ FILTER NOT EXISTS { ?person  person:hasCar  ?carSubject } }
{noformat} 
sees no variables.

> Possibly incorrect results from SPARQL with union and filter not exists
> -----------------------------------------------------------------------
>
>                 Key: JENA-1332
>                 URL: https://issues.apache.org/jira/browse/JENA-1332
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.2.0
>            Reporter: Stephen Owens
>         Attachments: JenaFilterNotExistsUnionTest.java
>
>
> The test case attached to this issue shows an unexpected SPARQL result. We 
> found the result while optimizing some SPARQL that had poor performance with 
> some OPTIONAL clauses. We thought the optimization was the same as the 
> original but in version 3.2.0 the result differs, it worked in 3.0.0. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to