code: private Model parseBodyAsModel(final InputStream requestBodyStream,
              final MediaType contentType, final FedoraResource resource) throws MalformedRdfException {
          final Lang format = contentTypeToLang(contentType.toString());
  
          final Model inputModel;
          try {
              inputModel = createDefaultModel();
              inputModel.read(requestBodyStream, getUri(resource).toString(), format.getName().toUpperCase());
              return inputModel;
          } catch (final RiotException e) {
              throw new BadRequestException("RDF was not parsable: " + e.getMessage(), e);
  
          } catch (final RuntimeIOException e) {
              if (e.getCause() instanceof JsonParseException) {
                  throw new MalformedRdfException(e.getCause());
              }
              throw new RepositoryRuntimeException(e);
          }
      }
docs: Parse the request body as a Model.
  
  @param requestBodyStream rdf request body
  @param contentType content type of body
  @param resource the fedora resource
  @return Model containing triples from request body
  @throws MalformedRdfException in case rdf json cannot be parsed