query.append(" [qt:data {defaultGraph}] ");
query.append(" USING NAMESPACE ");
query.append(" mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, ");
query.append(" dawgt = <http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#>, ");
query.append(" qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>");
TupleQuery testCaseQuery = con.prepareTupleQuery(QueryLanguage.SERQL, query.toString());
query.setLength(0);
query.append(" SELECT graph ");
query.append(" FROM {action} qt:graphData {graph} ");
query.append(" USING NAMESPACE ");
query.append(" qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>");
TupleQuery namedGraphsQuery = con.prepareTupleQuery(QueryLanguage.SERQL, query.toString());
logger.debug("evaluating query..");
TupleQueryResult testCases = testCaseQuery.evaluate();
while (testCases.hasNext()) {
BindingSet bindingSet = testCases.next();
String testURI = bindingSet.getValue("testURI").toString();
String testName = bindingSet.getValue("testName").toString();
String resultFile = bindingSet.getValue("resultFile").toString();
String queryFile = bindingSet.getValue("queryFile").toString();
URI defaultGraphURI = (URI)bindingSet.getValue("defaultGraph");
Value action = bindingSet.getValue("action");
logger.debug("found test case : {}", testName);
// Query named graphs
namedGraphsQuery.setBinding("action", action);
TupleQueryResult namedGraphs = namedGraphsQuery.evaluate();
DatasetImpl dataset = null;
if (defaultGraphURI != null || namedGraphs.hasNext()) {
dataset = new DatasetImpl();