@Consumes(APPLICATION_FORM_URLENCODED)
@Produces({TEXT_HTML + ";qs=2", "application/sparql-results+xml", "application/rdf+xml", APPLICATION_XML})
public Object sparql(@QueryParam(value = "query") String sparqlQuery,
@Context HttpHeaders headers) throws ParseException {
if (sparqlQuery == null) {
return Response.ok(new Viewable("sparql", this), TEXT_HTML).build();
}
Query query = QueryParser.getInstance().parse(sparqlQuery);
String mediaType = "application/sparql-results+xml";
if (query instanceof DescribeQuery || query instanceof ConstructQuery) {
mediaType = "application/rdf+xml";