private URI getHasMemberFromRequest ( final HttpServletRequest request ) throws IOException { final String baseUri = request . getRequestURL ( ) . toString ( ) ; final RDFReader reader ; final String contentType = request . getContentType ( ) ; final Lang format = contentTypeToLang ( contentType ) ; final Model inputModel ; try { inputModel = createDefaultModel ( ) ; reader = inputModel . getReader ( format . getName ( ) . toUpperCase ( ) ) ; reader . read ( inputModel , request . getInputStream ( ) , baseUri ) ; final Statement st = inputModel . getProperty ( null , MEMBERSHIP_RESOURCE ) ; return ( st != null ? URI . create ( st . getObject ( ) . toString ( ) ) : null ) ; } 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 ) ; } }
Get the memberRelation object from the contents .