code: @GET
    @Produces("text/plain")
    @Path("check")
    public String check(@QueryParam("q") String query, 
      @DefaultValue("") @QueryParam("corpora") String rawCorpusNames)
    {
      Subject user = SecurityUtils.getSubject();
      List<String> corpusNames = splitCorpusNamesFromRaw(rawCorpusNames);
      for (String c : corpusNames)
      {
        user.checkPermission("query:parse:" + c);
      }
      Collections.sort(corpusNames);
      
      List<Long> corpusIDs = queryDao.mapCorpusNamesToIds(
        corpusNames);
      
      queryDao.parseAQL(query, corpusIDs);
      return "ok";
    }
docs: Return true if this is a valid query or throw exception when invalid
  
  @param query Query to check for validity
  @param rawCorpusNames
  @return Either "ok" or an error message.