コード例 #1
0
 public ResponseWriterHelper(HttpResponseBase response, XmlSparqlWriter sparqlWriter, string sparqlContentType, TurtleRdfWriter rdfWriter, string rdfContentType)
 {
     _response          = response;
     _sparqlWriter      = sparqlWriter;
     _sparqlContentType = sparqlContentType;
     _rdfWriter         = rdfWriter;
     _rdfContentType    = rdfContentType;
     _start             = true;
 }
コード例 #2
0
 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");
     }
 }