class CatalogRest {

    @GET
    @Path("{catalogId}/records/{recordId}/branches/{branchId}")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Get a specific Branch for a specific VersionedRDFRecord.")
    @ResourceId(type = ValueType.PATH, value = "recordId")
    public Response getBranch(@PathParam("catalogId") String catalogId,
                       @PathParam("recordId") String recordId,
                       @PathParam("branchId") String branchId) {
        try {
            Branch branch = catalogManager.getBranch(vf.createIRI(catalogId), vf.createIRI(recordId),
                    vf.createIRI(branchId), factoryRegistry.getFactoryOfType(Branch.class).get()).orElseThrow(() ->
                    ErrorUtils.sendError("Branch " + branchId + " could not be found", Response.Status.NOT_FOUND));
            return Response.ok(thingToSkolemizedObjectNode(branch, Branch.TYPE, transformer, bNodeService)
                    .toString()).build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}