use of org.eclipse.rdf4j.model.impl.GraphImpl in project rdf4j by eclipse.
the class DAWGTestResultSetUtil method toGraph.
public static Graph toGraph(TupleQueryResult tqr) throws QueryEvaluationException {
Graph graph = new GraphImpl();
DAWGTestResultSetWriter writer = new DAWGTestResultSetWriter(new StatementCollector(graph));
try {
writer.startQueryResult(tqr.getBindingNames());
while (tqr.hasNext()) {
writer.handleSolution(tqr.next());
}
writer.endQueryResult();
} catch (TupleQueryResultHandlerException e) {
// StatementCollector, foud a bug?
throw new RuntimeException(e);
}
return graph;
}
Aggregations