Examples of TupleQueryResultParser


Examples of org.openrdf.query.resultio.TupleQueryResultParser

    BackgroundTupleResult result = null;
    String mimeType = readContentType();
    try {
      TupleQueryResultFormat format = TupleQueryResultParserRegistry.getInstance().getFileFormatForMIMEType(
          mimeType);
      TupleQueryResultParser parser = QueryResultIO.createParser(format, pool.getValueFactory());
      InputStream in = getResponseBodyAsStream();
      result = new BackgroundTupleResult(parser, in, this);
      pool.executeTask(result);
      return result;
    }
View Full Code Here

Examples of org.openrdf.query.resultio.TupleQueryResultParser

    TupleQueryResultFormat tqrFormat = QueryResultIO.getParserFormatForFileName(resultFileURL);

    if (tqrFormat != null) {
      InputStream in = new URL(resultFileURL).openStream();
      try {
        TupleQueryResultParser parser = QueryResultIO.createParser(tqrFormat);

        TupleQueryResultBuilder qrBuilder = new TupleQueryResultBuilder();
        parser.setTupleQueryResultHandler(qrBuilder);

        parser.parse(in);
        return qrBuilder.getQueryResult();
      }
      finally {
        in.close();
      }
View Full Code Here

Examples of org.openrdf.query.resultio.TupleQueryResultParser

    if (httpCode == HttpURLConnection.HTTP_OK) {
      String mimeType = getResponseMIMEType(method);
      try {
        TupleQueryResultFormat format = TupleQueryResultFormat.matchMIMEType(mimeType, tqrFormats);
        TupleQueryResultParser parser = QueryResultIO.createParser(format, getValueFactory());
        parser.setTupleQueryResultHandler(handler);
        parser.parse(method.getResponseBodyAsStream());
      }
      catch (UnsupportedQueryResultFormatException e) {
        throw new RepositoryException("Server responded with an unsupported file format: " + mimeType);
      }
      catch (QueryResultParseException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.