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

Andy Seaborne updated JENA-1354:
--------------------------------
    Description: 
Bug introduced by JENA-1329.

{noformat}
    public static void main(String... args) {
        Query q = QueryFactory.create("SELECT DISTINCT ?x {}") ;
        Dataset ds = DatasetFactory.create(); 
//RDFDataMgr.loadDataset(dataFile) ;
        QuerySolutionMap qsm = new QuerySolutionMap();
        qsm.add("Z", ResourceFactory.createPlainLiteral("ZZZ"));
        try(QueryExecution qExec = QueryExecutionFactory.create(q, ds, qsm)) {
            qExec.execSelect().forEachRemaining(qs->System.out.println("qs=> 
"+qs));
        }
    }
{noformat}
prints
{noformat}
qs=> ( ?Z = "ZZZ" )
{noformat}
when it should be
{noformat}
qs=> 
{noformat}

This happens because of the DISTINCT makes the code not notice it is a root 
iterator, not from a nested SELECT in a {{(sequence)}}.

  was:
Bug introduced by JENA-1329.

{noformat}
    public static void main(String... args) {
        Query q = QueryFactory.create("SELECT DISTINCT ?x {}") ;
        Dataset ds = DatasetFactory.create(); 
//RDFDataMgr.loadDataset(dataFile) ;
        QuerySolutionMap qsm = new QuerySolutionMap();
        qsm.add("Z", ResourceFactory.createPlainLiteral("ZZZ"));
        try(QueryExecution qExec = QueryExecutionFactory.create(q, ds, qsm)) {
            qExec.execSelect().forEachRemaining(qs->System.out.println("qs=> 
"+qs));
        }
    }
{noformat}
prints
{noformat}
qs=> ( ?Z = "ZZZ" )
{noformat}
when it should be
{noformat}
qs=> 
{noformat}


> Initial binding are passed out throug a projection.
> ---------------------------------------------------
>
>                 Key: JENA-1354
>                 URL: https://issues.apache.org/jira/browse/JENA-1354
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: Jena 3.4.0
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>             Fix For: Jena 3.4.0
>
>
> Bug introduced by JENA-1329.
> {noformat}
>     public static void main(String... args) {
>         Query q = QueryFactory.create("SELECT DISTINCT ?x {}") ;
>         Dataset ds = DatasetFactory.create(); 
> //RDFDataMgr.loadDataset(dataFile) ;
>         QuerySolutionMap qsm = new QuerySolutionMap();
>         qsm.add("Z", ResourceFactory.createPlainLiteral("ZZZ"));
>         try(QueryExecution qExec = QueryExecutionFactory.create(q, ds, qsm)) {
>             qExec.execSelect().forEachRemaining(qs->System.out.println("qs=> 
> "+qs));
>         }
>     }
> {noformat}
> prints
> {noformat}
> qs=> ( ?Z = "ZZZ" )
> {noformat}
> when it should be
> {noformat}
> qs=> 
> {noformat}
> This happens because of the DISTINCT makes the code not notice it is a root 
> iterator, not from a nested SELECT in a {{(sequence)}}.



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

Reply via email to