protected void executeBody(HttpAction action) { String queryString = null; try { InputStream input = action.request.getInputStream(); queryString = IO.readWholeFileAsUTF8(input); } catch (IOException ex) { ServletOps.errorOccurred(ex); } execute(queryString, action); }
/** * Ship the results to the remote caller. * * @param action * @param result * @param qPrologue */ protected void sendResults(HttpAction action, SPARQLResult result, Prologue qPrologue) { if (result.isResultSet()) ResponseResultSet.doResponseResultSet(action, result.getResultSet(), qPrologue); else if (result.isDataset()) // CONSTRUCT is processed as a extended CONSTRUCT - result is a dataset. ResponseDataset.doResponseDataset(action, result.getDataset()); else if (result.isModel()) // DESCRIBE results are models ResponseDataset.doResponseModel(action, result.getModel()); else if (result.isBoolean()) ResponseResultSet.doResponseResultSet(action, result.getBooleanResult()); else ServletOps.errorOccurred("Unknown or invalid result type"); }