private ParsedOperation parseText(Resource queryResource, IRI queryType, TripleSource store)
throws OpenRDFException
{
Value text = Statements.singleValue(queryResource, SP.TEXT_PROPERTY, store);
if (text != null) {
if (QUERY_TYPES.contains(queryType)) {
return QueryParserUtil.parseQuery(QueryLanguage.SPARQL, text.stringValue(), null);
}
else if (UPDATE_TYPES.contains(queryType)) {
return QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, text.stringValue(), null);
}
else {
throw new MalformedSpinException(String.format("Unrecognised command type: %s", queryType));
}
}
else {
return null;
}
}