use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method remove.
public void remove(Resource tripleSubject, RDFProperty triplePredicate, String tripleObject) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) tripleSubject;
URI sesameNativePredicate = getSesameNativeProperty(triplePredicate);
try {
conn.remove(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(tripleObject, XMLSchema.STRING), contextResource);
} catch (RepositoryException e) {
throw new ShineRuntimeException(e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method createTempGraph.
public Graph createTempGraph() {
try {
if (!conn.isOpen()) {
throw new IllegalStateException("Cannot create a temp graph on a closed graph!");
}
Repository inMemRepos = InMemoryRepositoryFactory.emptyRepository();
String contextURI = null;
if (contextResource.length > 0) {
contextURI = contextResource[0].stringValue();
}
Graph tempGraph = new SesameGraph(inMemRepos.getConnection(), contextURI);
tempGraphs.add(tempGraph);
return tempGraph;
} catch (RepositoryException ex) {
throw new ShineRuntimeException("Unable to create temp graph!", ex);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method getTupleQueryResult.
private TupleQueryResult getTupleQueryResult(String sparqlSelect) {
try {
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, sparqlSelect);
contextualize(tupleQuery);
return tupleQuery.evaluate();
} catch (UnsupportedSPARQLStatementException e) {
throw e;
} catch (Exception e) {
throw new ShineRuntimeException(e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method remove.
public void remove(Resource tripleSubject, RDFProperty triplePredicate, Integer integer) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) tripleSubject;
URI sesameNativePredicate = getSesameNativeProperty(triplePredicate);
try {
conn.remove(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(String.valueOf(integer), XMLSchema.INTEGER), contextResource);
} catch (RepositoryException e) {
throw new ShineRuntimeException(e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method getBooleanQueryResult.
private boolean getBooleanQueryResult(String sparqlSelect) {
try {
BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, sparqlSelect);
contextualize(booleanQuery);
return booleanQuery.evaluate();
} catch (UnsupportedSPARQLStatementException e) {
throw e;
} catch (Exception e) {
throw new ShineRuntimeException(e);
}
}
Aggregations