class CommitRest {

    @GET
    @Path("{commitId}/resource")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Retrieves the Commit specified by the provided ID.")
    public Response getCompiledResource(@PathParam("commitId") String commitId,
                                 @QueryParam("entityId") String entityId) {
        long start = System.currentTimeMillis();
        try {
            checkStringParam(commitId, "Commit ID is required");
            Model model;
            try {
                final List<Commit> commits;
                if (StringUtils.isNotBlank(entityId)) {
                    commits = catalogManager.getCommitEntityChain(vf.createIRI(commitId), vf.createIRI(entityId));
                    Model entityModel = catalogManager.getCompiledResource(commits);
                    model = entityModel.filter(vf.createIRI(entityId), null,null);
                } else {
                    commits = catalogManager.getCommitChain(vf.createIRI(commitId));
                    model = catalogManager.getCompiledResource(commits);
                }

                return Response.ok(modelToSkolemizedString(model, RDFFormat.JSONLD, transformer, bNodeService))
                        .build();
            } catch (IllegalArgumentException ex) {
                throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
            } catch (IllegalStateException | MobiException ex) {
                throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
            }
        } finally {
            logger.trace("getCompiledResource took {}ms", System.currentTimeMillis() - start);
        }
    }

}