deterministic uuidv4 -> uuidv4 I need to copy a graph of elements with uuidv4s each, and separately stored relations containing element uuidv4s.

On copy, I need to change the ids. Of course all relation ids should still point to the correct corresponding location in the copy.

So I need a deterministic f(uuidv4): uuidv4 function.

I can work with a temporarily cached lookup table. But I wonder if there's a hashing function with the same result? This would give the added benefit of establishing a free relation between the original and the copy, which I otherwise will have to model as another relation.

E.g. I could create a new uuidv4 from a truncated sha256 output of the original uuidv4. But it does seem to violate the idea of random uuids for getting the necessary entropy.. Are there some thoughts on how the entropy may be affected?
Java's internal secure random generator works along similar principles, just uses the older SHA1. By rehashing a starting point (seed), you create a ersatz cryptographically secure pseudo random number generator (CSPRNG).  Albeit, you're only creating one output per seed.  

The entropy isn't really affected and truncation is okay as we consider all of the SHA256 output bits as independent.  Unless you have very particular requirements and used a true random number generator, the likelihood is that the UUIDs were originally generated by some form of CSPRNG from the underlying OS.  You're just adding another round of processing.

The number of random  UUIDs (of 122 random bits) which need to be generated in order to have a 50% probability of at least one collision is $\approx 2^{\frac{n}{2}}$ or $\approx 2 \times 10^{18}$. There's a little bit more in the wiki article.