code: public static SelectQuery from(final String string) throws ParseException {
  
          Preconditions.checkNotNull(string);
  
          SelectQuery query = CACHE.getIfPresent(string);
          if (query == null) {
              final ParsedTupleQuery parsedQuery;
              try {
                  parsedQuery = QueryParserUtil.parseTupleQuery(QueryLanguage.SPARQL, string, null);
              } catch (final IllegalArgumentException ex) {
                  throw new ParseException(string, "SPARQL query not in SELECT form", ex);
              } catch (final MalformedQueryException ex) {
                  throw new ParseException(string, "Invalid SPARQL query: " + ex.getMessage(), ex);
              }
              query = new SelectQuery(string, parsedQuery.getTupleExpr(), parsedQuery.getDataset());
              CACHE.put(string, query);
          }
          return query;
      }
docs: Returns a <tt>SelectQuery</tt> for the specified SPARQL SELECT query string.
  
  @param string
  the query string, in SPARQL and without relative URIs
  @return the corresponding <tt>SelectQuery</tt>
  @throws ParseException
  in case the string does not denote a valid SPARQL SELECT query