private RdfStream remapResourceUris ( final String resourceUri , final String mementoUri , final RdfStream rdfStream , final IdentifierConverter < Resource , FedoraResource > idTranslator , final Session jcrSession ) { final IdentifierConverter < Resource , FedoraResource > internalIdTranslator = new InternalIdentifierTranslator ( jcrSession ) ; final org . apache . jena . graph . Node mementoNode = createURI ( mementoUri ) ; final Stream < Triple > mappedStream = rdfStream . map ( t -> mapSubject ( t , resourceUri , mementoUri ) ) . map ( t -> convertToInternalReference ( t , idTranslator , internalIdTranslator ) ) ; return new DefaultRdfStream ( mementoNode , mappedStream ) ; }
Remaps the subjects of triples in rdfStream from the original resource URL to the URL of the new memento and converts objects which reference resources to an internal identifier to prevent enforcement of referential integrity constraints .