public class DAWGTestResultSetUtil {
public static TupleResult toTupleQueryResult(Iterable<? extends Statement> dawgGraph)
throws DAWGTestResultSetParseException
{
TupleQueryResultBuilder tqrBuilder = new TupleQueryResultBuilder();
DAWGTestResultSetParser parser = new DAWGTestResultSetParser(tqrBuilder);
try {
parser.startRDF();
for (Statement st : dawgGraph) {
parser.handleStatement(st);
}
parser.endRDF();
return tqrBuilder.getQueryResult();
}
catch (RDFHandlerException e) {
throw new DAWGTestResultSetParseException(e.getMessage(), e);
}
}