use of org.nextprot.api.commons.utils.SparqlResult in project nextprot-api by calipho-sib.
the class SparqlServiceImpl method sparqlSelect.
@Override
public SparqlResult sparqlSelect(String sparql, String sparqlEndpointUrl, int timeout, String queryTitle, String testId, ResultsFormat format) {
SparqlResult result = null;
try {
QueryExecution qExec = QueryExecutionFactory.sparqlService(sparqlEndpointUrl, sparql);
qExec.setTimeout(timeout);
ResultSet rs = qExec.execSelect();
result = SparqlUtils.convertResultToFormat(rs, format);
qExec.close();
} catch (QueryParseException qe) {
String msg = ExceptionUtils.fixLineNumberInErrorMessage(qe.getLocalizedMessage());
throw new NextProtException("Malformed SPARQL: " + msg);
}
return result;
}
Aggregations