use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method addStatement.
public void addStatement(Resource subject, RDFProperty predicate, String object) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
URI sesameNativePredicate = getSesameNativeProperty(predicate);
try {
conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(String.valueOf(object), XMLSchema.STRING), contextResource);
} catch (RepositoryException e) {
throw new ShineRuntimeException("Could not add statement << [" + subject + "] [" + predicate + "] [" + object + "] >>", e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method validate.
public void validate(String arq) {
try {
Query query = conn.prepareQuery(QueryLanguage.SPARQL, arq);
contextualize(query);
} catch (UnsupportedSPARQLStatementException e) {
throw e;
} catch (MalformedQueryException e) {
throw new MalformedSPARQLException(e);
} catch (Exception e) {
throw new ShineRuntimeException(e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method select.
public List<BoundVariables> select(String sparqlSelect) {
List<BoundVariables> results = new LinkedList<>();
TupleQueryResult tupleQueryResult = getTupleQueryResult(sparqlSelect);
try {
while (tupleQueryResult.hasNext()) {
results.add(new SesameBoundVariables(tupleQueryResult.getBindingNames(), tupleQueryResult.next()));
}
} catch (QueryEvaluationException e) {
throw new ShineRuntimeException(e);
}
return results;
}
Aggregations