////////////////////////////////////////////////////////////////////////////////////////////
// Search:
public SparqlQueryResult runSparqlQuery(SparqlQueryInfo query) {
SparqlQueryResult sparqlQueryResult = new SparqlQueryResult();
try {
String result;
if ( query.getAcceptEntries().length == 0 ) {
// this is the call used for previous version of the SparqlQueryInfo object, which didn't
// have the acceptEntries attribute
result = OntServiceUtil.runSparqlQuery(query.getQuery(), query.getFormat(), "application/rdf+xml");
}
else {
// use the new call:
result = OntServiceUtil.runSparqlQuery(query);
}
sparqlQueryResult.setResult(result);
}
catch (Exception e) {
String error = "Error while dispatching query: " +e.getMessage();
sparqlQueryResult.setError(error);
}
return sparqlQueryResult;
}