UIMAExecutor executor = UIMAExecutorFactory.getInstance().createUIMAExecutor();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(OUTPUTGRAPH, uri);
parameters.put(ALCHEMYKEY, key);
try {
executor.analyzeDocument(uri, new XMLInputSource(getClass().getResource(PATH)), parameters);
} catch (Exception e) {
throw new WebApplicationException(Response.status(
Response.Status.INTERNAL_SERVER_ERROR).entity(new StringBuilder("Failed UIMA execution on URI ").
append(uri).append(" due to \n").append(e.getLocalizedMessage()).toString()).build());
}