code: @Override
      public RestQueryPlanResult planQuery(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);
          org.modeshape.jcr.api.query.Query query = createQuery(language, statement, session);
          bindExtraVariables(request, session.getValueFactory(), query);
  
          org.modeshape.jcr.api.query.QueryResult result = query.explain();
          String plan = result.getPlan();
          return new RestQueryPlanResult(plan, statement, language, query.getAbstractQueryModelRepresentation());
      }
docs: Executes a the given query string (based on the language information) against a JCR repository, returning a rest model
  based result.
  
  @param request        a non-null {@link Request}
  @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 response containing the string representation of the query plan
  @throws javax.jcr.RepositoryException if any operation fails at the JCR level