public ResponseWriterHelper(HttpResponseBase response, XmlSparqlWriter sparqlWriter, string sparqlContentType, TurtleRdfWriter rdfWriter, string rdfContentType) { _response = response; _sparqlWriter = sparqlWriter; _sparqlContentType = sparqlContentType; _rdfWriter = rdfWriter; _rdfContentType = rdfContentType; _start = true; }
private void Query_Internal(string query) { try { using (var turtleWriter = new TurtleRdfWriter(Response.OutputStream)) using (var xmlWriter = new XmlSparqlWriter(Response.OutputStream)) { var responseWriterHelper = new ResponseWriterHelper(Response, xmlWriter, "application/xml", turtleWriter, "application/turtle"); StorageWrapper.Storage.Query(responseWriterHelper, responseWriterHelper, query); } } catch (Exception ex) { Response.StatusCode = 400; Response.Write("Query failed"); } }