Package org.openrdf.query.resultio

Examples of org.openrdf.query.resultio.QueryResultParseException


      }
      else if (wrappedExc instanceof TupleQueryResultHandlerException) {
        throw (TupleQueryResultHandlerException)wrappedExc;
      }
      else {
        throw new QueryResultParseException(wrappedExc);
      }
    }
  }
View Full Code Here


    this.in = new DataInputStream(in);

    // Check magic number
    byte[] magicNumber = IOUtil.readBytes(in, MAGIC_NUMBER.length);
    if (!Arrays.equals(magicNumber, MAGIC_NUMBER)) {
      throw new QueryResultParseException("File does not contain a binary RDF table result");
    }

    // Check format version (parser is backward-compatible with version 1, 2
    // and 3)
    formatVersion = this.in.readInt();
    if (formatVersion > FORMAT_VERSION || formatVersion < 1) {
      throw new QueryResultParseException("Incompatible format version: " + formatVersion);
    }

    if (formatVersion == 2) {
      // read FLAG byte (ordered and distinct flags) and ignore it
      this.in.readByte();
    }

    // Read column headers
    int columnCount = this.in.readInt();
    if (columnCount < 0) {
      throw new QueryResultParseException("Illegal column count specified: " + columnCount);
    }

    List<String> columnHeaders = new ArrayList<String>(columnCount);
    for (int i = 0; i < columnCount; i++) {
      columnHeaders.add(readString());
View Full Code Here

    }
    else if (errTypeFlag == QUERY_EVALUATION_ERROR) {
      errType = QueryErrorType.QUERY_EVALUATION_ERROR;
    }
    else {
      throw new QueryResultParseException("Unkown error type: " + errTypeFlag);
    }

    String msg = readString();

    // FIXME: is this the right thing to do upon encountering an error?
    throw new QueryResultParseException(errType + ": " + msg);
  }
View Full Code Here

          break;
        case URI_RECORD_MARKER:
          datatype = readURI();
          break;
        default:
          throw new QueryResultParseException("Illegal record type marker for literal's datatype");
      }

      return valueFactory.createLiteral(label, datatype);
    }
    else if (recordTypeMarker == LANG_LITERAL_RECORD_MARKER) {
View Full Code Here

    }
    else if (value.equalsIgnoreCase("false")) {
      return false;
    }
    else {
      throw new QueryResultParseException("Invalid value: " + value);
    }
  }
View Full Code Here

    this.in = new DataInputStream(in);

    // Check magic number
    byte[] magicNumber = IOUtil.readBytes(in, MAGIC_NUMBER.length);
    if (!Arrays.equals(magicNumber, MAGIC_NUMBER)) {
      throw new QueryResultParseException("File does not contain a binary RDF table result");
    }

    // Check format version (parser is backward-compatible with version 1 and version 2)
    formatVersion = this.in.readInt();
    if (formatVersion != FORMAT_VERSION && formatVersion != 1 && formatVersion != 2) {
      throw new QueryResultParseException("Incompatible format version: " + formatVersion);
    }
   
    if (formatVersion == 2) {
      // read format version 2 FLAG byte (ordered and distinct flags) and ignore them
      this.in.readByte();
    }
   
    // Read column headers
    int columnCount = this.in.readInt();
    if (columnCount < 1) {
      throw new QueryResultParseException("Illegal column count specified: " + columnCount);
    }

    List<String> columnHeaders = new ArrayList<String>(columnCount);
    for (int i = 0; i < columnCount; i++) {
      columnHeaders.add(readString());
View Full Code Here

    }
    else if (errTypeFlag == QUERY_EVALUATION_ERROR) {
      errType = QueryErrorType.QUERY_EVALUATION_ERROR;
    }
    else {
      throw new QueryResultParseException("Unkown error type: " + errTypeFlag);
    }

    String msg = readString();

    // FIXME: is this the right thing to do upon encountering an error?
    throw new QueryResultParseException(errType + ": " + msg);
  }
View Full Code Here

          break;
        case URI_RECORD_MARKER:
          datatype = readURI();
          break;
        default:
          throw new QueryResultParseException("Illegal record type marker for literal's datatype");
      }

      return valueFactory.createLiteral(label, datatype);
    }
    else if (recordTypeMarker == LANG_LITERAL_RECORD_MARKER) {
View Full Code Here

      }
      else if (wrappedExc instanceof TupleQueryResultHandlerException) {
        throw (TupleQueryResultHandlerException)wrappedExc;
      }
      else {
        throw new QueryResultParseException(wrappedExc);
      }
    }
  }
View Full Code Here

      if (wrappedExc instanceof QueryResultParseException) {
        throw (QueryResultParseException)wrappedExc;
      }
      else {
        throw new QueryResultParseException(wrappedExc);
      }
    }
  }
View Full Code Here

TOP

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

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.