class DatasetRest {

    @POST
    @Path("{datasetRecordId}/data")
    @RolesAllowed("user")
    @ApiOperation("Uploads the data within an RDF file to a specific DatasetRecord in the local Catalog")
    public Response uploadData(@PathParam("datasetRecordId") String datasetRecordId,
                        @FormDataParam("file") InputStream fileInputStream,
                        @FormDataParam("file") FormDataContentDisposition fileDetail) {
        if (fileInputStream == null) {
            throw ErrorUtils.sendError("Must provide a file", Response.Status.BAD_REQUEST);
        }
        RDFFormat format = Rio.getParserFormatForFileName(fileDetail.getFileName()).orElseThrow(() ->
                ErrorUtils.sendError("File is not in a valid RDF format", Response.Status.BAD_REQUEST));

        ImportServiceConfig.Builder builder = new ImportServiceConfig.Builder()
                .dataset(vf.createIRI(datasetRecordId))
                .format(format)
                .logOutput(true);
        try {
            importService.importInputStream(builder.build(), fileInputStream);
            return Response.ok().build();
        } catch (IllegalArgumentException | RDFParseException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (Exception ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}