} else if(SparqlWritersHelper.parseSubType(format).equals("json")) {
out = new SPARQLResultsJSONWriter(os);
} else if(SparqlWritersHelper.parseSubType(format).equals("xml")) {
out = new SPARQLResultsXMLWriter(os);
} else if(SparqlWritersHelper.parseSubType(format).equals("csv")) {
out = new SPARQLResultsCSVWriter(os);
} else throw new InvalidArgumentException("could not produce format "+format);
return out;
}