}
}
private SparqlWriter createAnswerWriter(Writer writer) throws XMLStreamException {
if (APPLICATION_SPARQL_XML.equals(getMediaType())) {
return new SparqlAskXmlWriter(writer, answer.getResult());
} else if (APPLICATION_SPARQL_JSON.equals(getMediaType())) {
return new SparqlAskJsonWriter(writer, new String[]{}, answer.getResult());
} else {
throw new RuntimeException("Unknown media type: " + getMediaType());
}