private Model parseContent(Representation entity)
throws ResourceException
{
String mimeType = entity.getMediaType().getName();
RDFFormat rdfFormat = Rio.getParserFormatForMIMEType(mimeType);
try {
RDFParser parser = Rio.createParser(rdfFormat);
Model model = new LinkedHashModel();
parser.setRDFHandler(new StatementCollector(model));
parser.parse(entity.getStream(), "");
return model;
}
catch (UnsupportedRDFormatException e) {
throw new ResourceException(CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE,
"No RDF parser available for format " + rdfFormat.getName());
}
catch (RDFParseException e) {
throw new ErrorInfoException(MALFORMED_DATA, e.getMessage());
}
catch (IOException e) {