code: @Override
      public RestQueryResult executeQuery(Request request,
                                          String repositoryName,
                                          String workspaceName,
                                          String language,
                                          String statement,
                                          long offset,
                                          long limit) throws RepositoryException {
          assert repositoryName != null;
          assert workspaceName != null;
          assert language != null;
          assert statement != null;
          Session session = getSession(request, repositoryName, workspaceName);
          Query query = createQuery(language, statement, session);
          bindExtraVariables(request, session.getValueFactory(), query);
  
          QueryResult result = query.execute();
          RestQueryResult restQueryResult = new RestQueryResult();
  
          String[] columnNames = result.getColumnNames();
          setColumns(result, restQueryResult, columnNames);
  
          String baseUrl = RestHelper.repositoryUrl(request);
  
          setRows(offset, limit, session, result, restQueryResult, columnNames, baseUrl);
  
          return restQueryResult;
      }
docs: Executes a the given query string (based on the language information) against a JCR repository, returning a rest model
  based result.
  
  @param repositoryName a non-null, URL encoded {@link String} representing the name of a repository
  @param workspaceName  a non-null, URL encoded {@link String} representing the name of a workspace
  @param language       a non-null String which should be a valid query language, as recognized by the
  {@link javax.jcr.query.QueryManager}
  @param statement      a non-null String which should be a valid query string in the above language.
  @param offset         a numeric value which indicates the index in the result set from where results should be returned.
  @param limit          a numeric value indicating the maximum number of rows to return.
  @return a {@link RestQueryHandlerImpl} instance
  @throws javax.jcr.RepositoryException if any operation fails at the JCR level