/** * Evaluates the SPARQL SELECT query from the specified query pair on the repository. * * @param query Query pair. * @return Query result set. * @throws RepositoryException If no connection could be established, or connection fails. * @throws MalformedQueryException On query-related errors. * @throws QueryEvaluationException On query-related errors. */ public SparqlResultSet query(QueryPair query) throws RepositoryException, MalformedQueryException, QueryEvaluationException { RepositoryConnection conn = repo.getConnection(); TupleQuery tq = conn.prepareTupleQuery(QueryLanguage.SPARQL, query.getSparqlQuery()); SparqlResultSet ret = new SparqlResultSet(tq.evaluate(), query.getName(), query.getSparqlEntityIdVariables()); conn.close(); return ret; }