Package org.openrdf.query.resultio

Examples of org.openrdf.query.resultio.TupleQueryResultWriterFactory


  @SuppressWarnings("unchecked")
  public void render(Map model, HttpServletRequest request, HttpServletResponse response)
    throws IOException
  {
    TupleQueryResultWriterFactory qrWriterFactory = (TupleQueryResultWriterFactory)model.get(FACTORY_KEY);
    TupleQueryResultFormat qrFormat = qrWriterFactory.getTupleQueryResultFormat();

    response.setStatus(SC_OK);
    setContentType(response, qrFormat);
    setContentDisposition(model, response, qrFormat);

    OutputStream out = response.getOutputStream();
    try {
      TupleQueryResultWriter qrWriter = qrWriterFactory.getWriter(out);
      TupleQueryResult tupleQueryResult = (TupleQueryResult)model.get(QUERY_RESULT_KEY);
      QueryResultUtil.report(tupleQueryResult, qrWriter);
    }
    catch (QueryEvaluationException e) {
      logger.error("Query evaluation error", e);
View Full Code Here


        }
        finally {
          queryResult.close();
        }

        TupleQueryResultWriterFactory factory = ProtocolUtil.getAcceptableService(request, response,
            TupleQueryResultWriterRegistry.getInstance());

        Map<String, Object> model = new HashMap<String, Object>();
        model.put(QueryResultView.QUERY_RESULT_KEY, new TupleQueryResultImpl(bindingNames, bindingSets));
        model.put(QueryResultView.FILENAME_HINT_KEY, "repositories");
View Full Code Here

    }
    catch (RepositoryException e) {
      throw new ServerHTTPException("Repository error: " + e.getMessage(), e);
    }

    TupleQueryResultWriterFactory factory = ProtocolUtil.getAcceptableService(request, response,
        TupleQueryResultWriterRegistry.getInstance());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put(QueryResultView.QUERY_RESULT_KEY, new TupleQueryResultImpl(columnNames, contexts));
    model.put(QueryResultView.FILENAME_HINT_KEY, "contexts");
View Full Code Here

    }
    catch (RepositoryException e) {
      throw new ServerHTTPException("Repository error: " + e.getMessage(), e);
    }

    TupleQueryResultWriterFactory factory = ProtocolUtil.getAcceptableService(request, response,
        TupleQueryResultWriterRegistry.getInstance());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put(QueryResultView.QUERY_RESULT_KEY, new TupleQueryResultImpl(columnNames, namespaces));
    model.put(QueryResultView.FILENAME_HINT_KEY, "namespaces");
View Full Code Here

TOP

Related Classes of org.openrdf.query.resultio.TupleQueryResultWriterFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.