Andy,

we are evaluating the move to 2.7.3 and have been immediately hit by what looks like a change of SPARQL semantics in ARQ. See the attached Java test which returns "Test" in 272 but null in 273. The query is really simple:

    SELECT *
    WHERE {
        {
            BIND ("Test" AS ?label) .
        } .
        BIND (?label AS ?result) .
    }

but ?label is no longer visible in the outer BIND. The same happens if you replace the inner BIND with a BGP that binds ?label, but I wanted to make the example model independent.

So my obvious question: is this the intended behavior, why the change etc?

Thanks,
Holger

import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode;


public class TestARQ {

        public static void main(String[] args) {
                String queryString = 
                                "SELECT *\n"+
                                "WHERE {\n" +
                                "       {\n" +
                                "       BIND (\"Test\" AS ?label) .\n" +
                        "   } .\n" +
                        "   BIND (?label AS ?result) .\n" +
                                "}";
                Query query = QueryFactory.create(queryString);
                QueryExecution qexec = QueryExecutionFactory.create(query, 
ModelFactory.createDefaultModel());
                ResultSet rs = qexec.execSelect();
                QuerySolution qs = rs.next();
                RDFNode result = qs.get("result");
                System.out.println("Result: " + result);
        }
}

Reply via email to