logger.debug("evaluating query..");
TupleResult testCases = testCaseQuery.evaluate();
while (testCases.hasNext()) {
BindingSet bindingSet = testCases.next();
URI testURI = (URI)bindingSet.getValue("testURI");
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);
TupleResult namedGraphs = namedGraphsQuery.evaluate();
DatasetImpl dataset = null;
if (defaultGraphURI != null || namedGraphs.hasNext()) {
dataset = new DatasetImpl();
if (defaultGraphURI != null) {
dataset.addDefaultGraph(defaultGraphURI);
}
while (namedGraphs.hasNext()) {
BindingSet graphBindings = namedGraphs.next();
URI namedGraphURI = (URI)graphBindings.getValue("graph");
dataset.addNamedGraph(namedGraphURI);
}
}
// Check for lax-cardinality conditions