use of com.thoughtworks.studios.shine.semweb.MoreThanOneResultFoundException in project gocd by gocd.
the class SesameGraph method selectFirst.
public BoundVariables selectFirst(String sparqlSelect) {
BoundVariables boundVariables;
TupleQueryResult tupleQueryResult = getTupleQueryResult(sparqlSelect);
try {
if (!tupleQueryResult.hasNext()) {
return null;
}
boundVariables = new SesameBoundVariables(tupleQueryResult.getBindingNames(), tupleQueryResult.next());
if (tupleQueryResult.hasNext()) {
tupleQueryResult.close();
throw new MoreThanOneResultFoundException(sparqlSelect);
}
} catch (QueryEvaluationException e) {
throw new ShineRuntimeException("Could not parse query: <<" + sparqlSelect + ">>", e);
}
return boundVariables;
}
Aggregations