use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method remove.
public void remove(Resource tripleSubject, RDFProperty triplePredicate, Resource tripleObject) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) tripleSubject;
URI sesameNativePredicate = getSesameNativeProperty(triplePredicate);
AbstractSesameResource sesameObject = (AbstractSesameResource) tripleObject;
try {
conn.remove(sesameSubject.getSesameNativeResource(), sesameNativePredicate, sesameObject.getSesameNativeResource(), contextResource);
} catch (RepositoryException e) {
throw new ShineRuntimeException(e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method addStatement.
public void addStatement(Resource subject, RDFProperty predicate, Integer object) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
URI sesameNativePredicate = getSesameNativeProperty(predicate);
try {
conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(String.valueOf(object), XMLSchema.INTEGER), 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 renderSPARQLResultsAsXML.
public void renderSPARQLResultsAsXML(String sparql, OutputStream stream) {
try {
Query query = conn.prepareQuery(QueryLanguage.SPARQL, sparql);
contextualize(query);
if (query instanceof TupleQuery) {
renderTupleQuery(query, new SPARQLResultsXMLWriter(stream));
} else {
renderBooleanQuery(query, new SPARQLBooleanXMLWriter(stream));
}
stream.flush();
} catch (UnsupportedSPARQLStatementException e) {
throw e;
} catch (Exception e) {
throw new ShineRuntimeException("Could not render sparql results as XML: <<" + sparql + ">>", e);
}
}
use of com.thoughtworks.studios.shine.ShineRuntimeException in project gocd by gocd.
the class SesameGraph method addStatement.
public void addStatement(Resource subject, RDFProperty predicate, Boolean object) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
URI sesameNativePredicate = getSesameNativeProperty(predicate);
try {
conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(String.valueOf(object), XMLSchema.BOOLEAN), 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 addStatement.
public void addStatement(Resource subject, RDFProperty predicate, Resource object) {
AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
URI sesameNativePredicate = getSesameNativeProperty(predicate);
AbstractSesameResource sesameObject = (AbstractSesameResource) object;
try {
conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, sesameObject.getSesameNativeResource(), contextResource);
} catch (RepositoryException e) {
throw new ShineRuntimeException("Could not add statement << [" + subject + "] [" + predicate + "] [" + object + "] >>", e);
}
}
Aggregations