/**
  * @param queryString
  * @param mapper
  * @return
  * @throws RdfException
  */
 public <T> List<T> queryList(String queryString, BindingSetMapper<T> mapper) throws RdfException {
   RepositoryConnection repositoryConnection = null;
   TupleQueryResult result = null;
   List<T> objects = new LinkedList<T>();
   try {
     repositoryConnection = getConnection();
     TupleQuery query = repositoryConnection.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
     result = query.evaluate();
     int row = 0;
     while (result.hasNext()) {
       final T mapped = mapper.map(result.next(), row++);
       if (mapped != null) {
         objects.add(mapped);
       }
     }
   } catch (RepositoryException e) {
     throw new RdfException(e);
   } catch (MalformedQueryException e) {
     throw new RdfException(e);
   } catch (QueryEvaluationException e) {
     throw new RdfException(e);
   } finally {
     cleanup(result);
   }
   return objects;
 }