CatalogRest { @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits/{commitId}/resource") @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) @RolesAllowed("user") @ApiOperation("Gets the compiled resource for a the entity identified by a specific Commit.") @ResourceId(type = ValueType.PATH, value = "recordId") public Response getCompiledResource(@Context ContainerRequestContext context, @PathParam("catalogId") String catalogId, @PathParam("recordId") String recordId, @PathParam("branchId") String branchId, @PathParam("commitId") String commitId, @DefaultValue("jsonld") @QueryParam("format") String rdfFormat, @DefaultValue("false") @QueryParam("applyInProgressCommit") boolean apply) { try { Resource catalogIRI = vf.createIRI(catalogId); Resource recordIRI = vf.createIRI(recordId); Resource commitIRI = vf.createIRI(commitId); catalogManager.getCommit(catalogIRI, recordIRI, vf.createIRI(branchId), commitIRI); Model resource = catalogManager.getCompiledResource(commitIRI); if (apply) { User activeUser = getActiveUser(context, engineManager); Optional<InProgressCommit> inProgressCommit = catalogManager.getInProgressCommit(catalogIRI, recordIRI, activeUser); if (inProgressCommit.isPresent()) { resource = catalogManager.applyInProgressCommit(inProgressCommit.get().getResource(), resource); } } return Response.ok(modelToSkolemizedString(resource, rdfFormat, 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); } }  @GET @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves the distributed and local Catalogs.") Response getCatalogs(@QueryParam("type") String catalogType); @GET @Path("{catalogId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves the Catalog specified by the provided ID.") Response getCatalog(@PathParam("catalogId") String catalogId); @GET @Path("{catalogId}/records") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves the Records in the Catalog.") Response getRecords(@Context UriInfo uriInfo,
                        @PathParam("catalogId") String catalogId,
                        @QueryParam("sort") String sort,
                        @QueryParam("type") String recordType,
                        @QueryParam("offset") int offset,
                        @QueryParam("limit") int limit,
                        @DefaultValue("true") @QueryParam("ascending") boolean asc,
                        @QueryParam("searchText") String searchText); @POST @Path("{catalogId}/records") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Creates a new Record in the Catalog.") @ActionAttributes( @AttributeValue(id = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", value = "type", type = ValueType.BODY)) @ResourceId(value = "catalogId", type = ValueType.PATH) Response createRecord(@Context ContainerRequestContext context,
                          @PathParam("catalogId") String catalogId,
                          @FormDataParam("type") String typeIRI,
                          @FormDataParam("title") String title,
                          @FormDataParam("identifier") String identifier,
                          @FormDataParam("description") String description,
                          @FormDataParam("markdown") String markdown,
                          @FormDataParam("keywords") List<FormDataBodyPart> keywords); @GET @Path("{catalogId}/records/{recordId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves the Catalog record by its ID.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getRecord(@PathParam("catalogId") String catalogId,
                       @PathParam("recordId") String recordId); @DELETE @Path("{catalogId}/records/{recordId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Deletes the Catalog Record by its ID.") @ResourceId(type = ValueType.PATH, value = "recordId") Response deleteRecord(@Context ContainerRequestContext context,
                          @PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId); @PUT @Path("{catalogId}/records/{recordId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Updates the Catalog Record by its ID using the provided Record JSON-LD.") @ResourceId(type = ValueType.PATH, value = "recordId") Response updateRecord(@PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          String newRecordJson); @GET @Path("{catalogId}/records/{recordId}/distributions") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves the list of Distributions associated with an UnversionedRecord.") Response getUnversionedDistributions(@Context UriInfo uriInfo,
                                         @PathParam("catalogId") String catalogId,
                                         @PathParam("recordId") String recordId,
                                         @QueryParam("sort") String sort,
                                         @DefaultValue("0") @QueryParam("offset") int offset,
                                         @DefaultValue("100") @QueryParam("limit") int limit,
                                         @DefaultValue("true") @QueryParam("ascending") boolean asc); @POST @Path("{catalogId}/records/{recordId}/distributions") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Creates a new Distribution for the provided UnversionedRecord.") Response createUnversionedDistribution(@Context ContainerRequestContext context,
                                           @PathParam("catalogId") String catalogId,
                                           @PathParam("recordId") String recordId,
                                           @FormDataParam("title") String title,
                                           @FormDataParam("description") String description,
                                           @FormDataParam("format") String format,
                                           @FormDataParam("accessURL") String accessURL,
                                           @FormDataParam("downloadURL") String downloadURL); @GET @Path("{catalogId}/records/{recordId}/distributions/{distributionId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets a specific Distribution of an UnversionedRecord.") Response getUnversionedDistribution(@PathParam("catalogId") String catalogId,
                                        @PathParam("recordId") String recordId,
                                        @PathParam("distributionId") String distributionId); @DELETE @Path("{catalogId}/records/{recordId}/distributions/{distributionId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Deletes a specific Distribution of an UnversionedRecord.") Response deleteUnversionedDistribution(@PathParam("catalogId") String catalogId,
                                           @PathParam("recordId") String recordId,
                                           @PathParam("distributionId") String distributionId); @PUT @Path("{catalogId}/records/{recordId}/distributions/{distributionId}") @Consumes(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Updates a specific Distribution of an UnversionedRecord.") Response updateUnversionedDistribution(@PathParam("catalogId") String catalogId,
                                           @PathParam("recordId") String recordId,
                                           @PathParam("distributionId") String distributionId,
                                           String newDistributionJson); @GET @Path("{catalogId}/records/{recordId}/versions") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets a list of Versions for a VersionedRecord.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getVersions(@Context UriInfo uriInfo,
                         @PathParam("catalogId") String catalogId,
                         @PathParam("recordId") String recordId,
                         @QueryParam("sort") String sort,
                         @DefaultValue("0") @QueryParam("offset") int offset,
                         @DefaultValue("100") @QueryParam("limit") int limit,
                         @DefaultValue("true") @QueryParam("ascending") boolean asc); @POST @Path("{catalogId}/records/{recordId}/versions") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Creates a Version for the identified VersionedRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response createVersion(@Context ContainerRequestContext context,
                           @PathParam("catalogId") String catalogId,
                           @PathParam("recordId") String recordId,
                           @FormDataParam("type") String typeIRI,
                           @FormDataParam("title") String title,
                           @FormDataParam("description") String description); @POST @Path("{catalogId}/records/{recordId}/tags") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Creates a Tag for the identified VersionedRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response createTag(@Context ContainerRequestContext context,
                       @PathParam("catalogId") String catalogId,
                       @PathParam("recordId") String recordId,
                       @FormDataParam("title") String title,
                       @FormDataParam("description") String description,
                       @FormDataParam("iri") String iri,
                       @FormDataParam("commit") String commitId); @GET @Path("{catalogId}/records/{recordId}/versions/latest") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the latest Version of a VersionedRecord.") Response getLatestVersion(@PathParam("catalogId") String catalogId,
                              @PathParam("recordId") String recordId); @GET @Path("{catalogId}/records/{recordId}/versions/{versionId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets a specific Version for the identified VersionedRecord.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getVersion(@PathParam("catalogId") String catalogId,
                        @PathParam("recordId") String recordId,
                        @PathParam("versionId") String versionId); @DELETE @Path("{catalogId}/records/{recordId}/versions/{versionId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Deletes a specific Version from the identified VersionedRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response deleteVersion(@PathParam("catalogId") String catalogId,
                           @PathParam("recordId") String recordId,
                           @PathParam("versionId") String versionId); @PUT @Path("{catalogId}/records/{recordId}/versions/{versionId}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Updates a specific Version of the identified VersionedRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response updateVersion(@PathParam("catalogId") String catalogId,
                           @PathParam("recordId") String recordId,
                           @PathParam("versionId") String versionId,
                           String newVersionJson); @GET @Path("{catalogId}/records/{recordId}/versions/{versionId}/distributions") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the list of all Distributions for the identified Version.") Response getVersionedDistributions(@Context UriInfo uriInfo,
                                       @PathParam("catalogId") String catalogId,
                                       @PathParam("recordId") String recordId,
                                       @PathParam("versionId") String versionId,
                                       @QueryParam("sort") String sort,
                                       @DefaultValue("0") @QueryParam("offset") int offset,
                                       @DefaultValue("100") @QueryParam("limit") int limit,
                                       @DefaultValue("true") @QueryParam("ascending") boolean asc); @POST @Path("{catalogId}/records/{recordId}/versions/{versionId}/distributions") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Creates a Distribution for the identified Version.") Response createVersionedDistribution(@Context ContainerRequestContext context,
                                         @PathParam("catalogId") String catalogId,
                                         @PathParam("recordId") String recordId,
                                         @PathParam("versionId") String versionId,
                                         @FormDataParam("title") String title,
                                         @FormDataParam("description") String description,
                                         @FormDataParam("format") String format,
                                         @FormDataParam("accessURL") String accessURL,
                                         @FormDataParam("downloadURL") String downloadURL); @GET @Path("{catalogId}/records/{recordId}/versions/{versionId}/distributions/{distributionId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets a specific Distribution for the identified Version.") Response getVersionedDistribution(@PathParam("catalogId") String catalogId,
                                      @PathParam("recordId") String recordId,
                                      @PathParam("versionId") String versionId,
                                      @PathParam("distributionId") String distributionId); @DELETE @Path("{catalogId}/records/{recordId}/versions/{versionId}/distributions/{distributionId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Deletes a specific Distribution of the identified Version.") Response deleteVersionedDistribution(@PathParam("catalogId") String catalogId,
                                         @PathParam("recordId") String recordId,
                                         @PathParam("versionId") String versionId,
                                         @PathParam("distributionId") String distributionId); @PUT @Path("{catalogId}/records/{recordId}/versions/{versionId}/distributions/{distributionId}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Updates a specific Distribution of the identified Version.") Response updateVersionedDistribution(@PathParam("catalogId") String catalogId,
                                         @PathParam("recordId") String recordId,
                                         @PathParam("versionId") String versionId,
                                         @PathParam("distributionId") String distributionId,
                                         String newDistributionJson); @GET @Path("{catalogId}/records/{recordId}/versions/{versionId}/commit") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the Commit associated with the identified Version.") Response getVersionCommit(@PathParam("catalogId") String catalogId,
                              @PathParam("recordId") String recordId,
                              @PathParam("versionId") String versionId,
                              @DefaultValue("jsonld") @QueryParam("format") String format); @GET @Path("{catalogId}/records/{recordId}/branches") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets list of Branches associated with a specific VersionedRDFRecord.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getBranches(@Context ContainerRequestContext context,
                         @Context UriInfo uriInfo,
                         @PathParam("catalogId") String catalogId,
                         @PathParam("recordId") String recordId,
                         @QueryParam("sort") String sort,
                         @DefaultValue("0") @QueryParam("offset") int offset,
                         @DefaultValue("100") @QueryParam("limit") int limit,
                         @DefaultValue("true") @QueryParam("ascending") boolean asc,
                         @DefaultValue("false") @QueryParam("applyUserFilter") boolean applyUserFilter); @POST @Path("{catalogId}/records/{recordId}/branches") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Creates a branch for a specific VersionedRDFRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response createBranch(@Context ContainerRequestContext context,
                          @PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          @FormDataParam("type") String typeIRI,
                          @FormDataParam("title") String title,
                          @FormDataParam("description") String description,
                          @FormDataParam("commitId") String commitId); @GET @Path("{catalogId}/records/{recordId}/branches/master") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the master Branch of a VersionedRDFRecord.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getMasterBranch(@PathParam("catalogId") String catalogId,
                             @PathParam("recordId") String recordId); @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") Response getBranch(@PathParam("catalogId") String catalogId,
                       @PathParam("recordId") String recordId,
                       @PathParam("branchId") String branchId); @DELETE @Path("{catalogId}/records/{recordId}/branches/{branchId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Deletes a specific Branch for a specific VersionedRDFRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") @ActionAttributes( @AttributeValue(type = ValueType.PATH, id = VersionedRDFRecord.branch_IRI, value = "branchId") ) Response deleteBranch(@PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          @PathParam("branchId") String branchId); @PUT @Path("{catalogId}/records/{recordId}/branches/{branchId}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Updates a specific Branch for a specific VersionedRDFRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response updateBranch(@PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          @PathParam("branchId") String branchId,
                          String newBranchJson); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the Commit chain for a specific Branch.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getCommitChain(@Context UriInfo uriInfo,
                            @PathParam("catalogId") String catalogId,
                            @PathParam("recordId") String recordId,
                            @PathParam("branchId") String branchId,
                            @QueryParam("targetId") String targetId,
                            @QueryParam("offset") int offset,
                            @QueryParam("limit") int limit); @POST @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits") @Produces(MediaType.TEXT_PLAIN) @RolesAllowed("user") @ApiOperation("Creates a Commit for a specific Branch and sets it to be the new HEAD Commit.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") @ActionAttributes( @AttributeValue(type = ValueType.PATH, id = VersionedRDFRecord.branch_IRI, value = "branchId") ) Response createBranchCommit(@Context ContainerRequestContext context,
                                @PathParam("catalogId") String catalogId,
                                @PathParam("recordId") String recordId,
                                @PathParam("branchId") String branchId,
                                @QueryParam("message") String message); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits/head") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the HEAD Commit for a specific Branch.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getHead(@PathParam("catalogId") String catalogId,
                     @PathParam("recordId") String recordId,
                     @PathParam("branchId") String branchId,
                     @DefaultValue("jsonld") @QueryParam("format") String format); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits/{commitId}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets a specific Commit on a specific Branch.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getBranchCommit(@PathParam("catalogId") String catalogId,
                             @PathParam("recordId") String recordId,
                             @PathParam("branchId") String branchId,
                             @PathParam("commitId") String commitId,
                             @DefaultValue("jsonld") @QueryParam("format") String format); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/difference") @RolesAllowed("user") @ApiOperation("Gets the difference between the two provided Branches' HEAD Commits.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getDifference(@PathParam("catalogId") String catalogId,
                           @PathParam("recordId") String recordId,
                           @PathParam("branchId") String branchId,
                           @QueryParam("targetId") String targetBranchId,
                           @DefaultValue("jsonld") @QueryParam("format") String rdfFormat); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/conflicts") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets a list of Conflicts found between the two provided Branches' HEAD Commits.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getConflicts(@PathParam("catalogId") String catalogId,
                          @PathParam("recordId") String recordId,
                          @PathParam("branchId") String branchId,
                          @QueryParam("targetId") String targetBranchId,
                          @DefaultValue("jsonld") @QueryParam("format") String rdfFormat); @POST @Path("{catalogId}/records/{recordId}/branches/{branchId}/conflicts/resolution") @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Merges the two commits identified by the provided IDs.") @ActionId(value = Modify.TYPE) @ActionAttributes( @AttributeValue(type = ValueType.QUERY, id = VersionedRDFRecord.branch_IRI, value = "targetId") ) @ResourceId(type = ValueType.PATH, value = "recordId") Response merge(@Context ContainerRequestContext context,
                   @PathParam("catalogId") String catalogId,
                   @PathParam("recordId") String recordId,
                   @PathParam("branchId") String sourceBranchId,
                   @QueryParam("targetId") String targetBranchId,
                   @FormDataParam("additions") String additionsJson,
                   @FormDataParam("deletions") String deletionsJson); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits/{commitId}/resource") @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) @RolesAllowed("user") @ApiOperation("Gets the compiled resource for a the entity identified by a specific Commit.") @ResourceId(type = ValueType.PATH, value = "recordId") Response getCompiledResource(@Context ContainerRequestContext context,
                                 @PathParam("catalogId") String catalogId,
                                 @PathParam("recordId") String recordId,
                                 @PathParam("branchId") String branchId,
                                 @PathParam("commitId") String commitId,
                                 @DefaultValue("jsonld") @QueryParam("format") String rdfFormat,
                                 @DefaultValue("false") @QueryParam("applyInProgressCommit") boolean apply); @GET @Path("{catalogId}/records/{recordId}/branches/{branchId}/commits/{commitId}/resource") @Produces({MediaType.APPLICATION_OCTET_STREAM, "text/*", "application/*"}) @RolesAllowed("user") @ApiOperation("Gets the compiled resource for a the entity identified by a specific Commit.") @ResourceId(type = ValueType.PATH, value = "recordId") Response downloadCompiledResource(@Context ContainerRequestContext context,
                                      @PathParam("catalogId") String catalogId,
                                      @PathParam("recordId") String recordId,
                                      @PathParam("branchId") String branchId,
                                      @PathParam("commitId") String commitId,
                                      @DefaultValue("jsonld") @QueryParam("format") String rdfFormat,
                                      @DefaultValue("false") @QueryParam("applyInProgressCommit") boolean apply,
                                      @DefaultValue("resource") @QueryParam("fileName") String fileName); @POST @Path("{catalogId}/records/{recordId}/in-progress-commit") @RolesAllowed("user") @ApiOperation("Creates a InProgressCommit linked to a specific VersionedRDFRecord.") Response createInProgressCommit(@Context ContainerRequestContext context,
                                    @PathParam("catalogId") String catalogId,
                                    @PathParam("recordId") String recordId); @GET @Path("{catalogId}/records/{recordId}/in-progress-commit") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Gets the changes made in the User's current InProgressCommit for a specific VersionedRDFRecord.") Response getInProgressCommit(@Context ContainerRequestContext context,
                                 @PathParam("catalogId") String catalogId,
                                 @PathParam("recordId") String recordId,
                                 @DefaultValue("jsonld") @QueryParam("format") String format); @DELETE @Path("{catalogId}/records/{recordId}/in-progress-commit") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Deletes the changes made in the User's current InProgressCommit for a specific VersionedRDFRecord.") Response deleteInProgressCommit(@Context ContainerRequestContext context,
                                    @PathParam("catalogId") String catalogId,
                                    @PathParam("recordId") String recordId); @PUT @Path("{catalogId}/records/{recordId}/in-progress-commit") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) @RolesAllowed("user") @ApiOperation("Updates the changes made in the User's current InProgressCommit for a specific VersionedRDFRecord.") @ActionId(value = Modify.TYPE) @ResourceId(type = ValueType.PATH, value = "recordId") Response updateInProgressCommit(@Context ContainerRequestContext context,
                                    @PathParam("catalogId") String catalogId,
                                    @PathParam("recordId") String recordId,
                                    @FormDataParam("additions") String additionsJson,
                                    @FormDataParam("deletions") String deletionsJson); @GET @Path("record-types") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves all the available record types.") Response getRecordTypes(); @GET @Path("sort-options") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("user") @ApiOperation("Retrieves all the available sorting options.") Response getSortOptions();  }
@Test public void getCompiledResourceAsJsonldTest() { Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI) + "/branches/" + encode(BRANCH_IRI) + "/commits/" + encode(COMMIT_IRIS[0]) + "/resource") .queryParam("format", "jsonld").request().get(); assertEquals(response.getStatus(), 200); verify(catalogManager).getCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI), vf.createIRI(COMMIT_IRIS[0])); verify(catalogManager).getCompiledResource(vf.createIRI(COMMIT_IRIS[0])); isJsonld(response.readEntity(String.class)); }
@Test public void getCompiledResourceAsTurtleTest() { Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI) + "/branches/" + encode(BRANCH_IRI) + "/commits/" + encode(COMMIT_IRIS[0]) + "/resource") .queryParam("format", "turtle").request().get(); assertEquals(response.getStatus(), 200); verify(catalogManager).getCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI), vf.createIRI(COMMIT_IRIS[0])); verify(catalogManager).getCompiledResource(vf.createIRI(COMMIT_IRIS[0])); notJsonld(response.readEntity(String.class)); }
@Test public void getCompiledResourceAsRdfxmlTest() { Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI) + "/branches/" + encode(BRANCH_IRI) + "/commits/" + encode(COMMIT_IRIS[0]) + "/resource") .queryParam("format", "rdf/xml").request().get(); assertEquals(response.getStatus(), 200); verify(catalogManager).getCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI), vf.createIRI(COMMIT_IRIS[0])); verify(catalogManager).getCompiledResource(vf.createIRI(COMMIT_IRIS[0])); notJsonld(response.readEntity(String.class)); }
@Test public void downloadCompiledResourceAsJsonldTest() { Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI) + "/branches/" + encode(BRANCH_IRI) + "/commits/" + encode(COMMIT_IRIS[0]) + "/resource") .queryParam("format", "jsonld").queryParam("fileName", "fileName").request() .accept(MediaType.APPLICATION_OCTET_STREAM).get(); assertEquals(response.getStatus(), 200); verify(catalogManager).getCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI), vf.createIRI(COMMIT_IRIS[0])); verify(catalogManager).getCompiledResource(vf.createIRI(COMMIT_IRIS[0])); assertTrue(response.getHeaderString("Content-Disposition").contains("fileName")); isJsonld(response.readEntity(String.class)); }
@Test public void downloadCompiledResourceAsTurtleTest() { Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI) + "/branches/" + encode(BRANCH_IRI) + "/commits/" + encode(COMMIT_IRIS[0]) + "/resource") .queryParam("format", "turtle").queryParam("fileName", "fileName").request() .accept(MediaType.APPLICATION_OCTET_STREAM).get(); assertEquals(response.getStatus(), 200); verify(catalogManager).getCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI), vf.createIRI(COMMIT_IRIS[0])); verify(catalogManager).getCompiledResource(vf.createIRI(COMMIT_IRIS[0])); assertTrue(response.getHeaderString("Content-Disposition").contains("fileName")); notJsonld(response.readEntity(String.class)); }
@Test public void downloadCompiledResourceAsRdfxmlTest() { Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI) + "/branches/" + encode(BRANCH_IRI) + "/commits/" + encode(COMMIT_IRIS[0]) + "/resource") .queryParam("format", "rdf/xml").queryParam("fileName", "fileName").request() .accept(MediaType.APPLICATION_OCTET_STREAM).get(); assertEquals(response.getStatus(), 200); verify(catalogManager).getCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI), vf.createIRI(COMMIT_IRIS[0])); verify(catalogManager).getCompiledResource(vf.createIRI(COMMIT_IRIS[0])); assertTrue(response.getHeaderString("Content-Disposition").contains("fileName")); notJsonld(response.readEntity(String.class)); }