Hi all,
The Wikidata-Toolkit Java library has been doing that for a while, but I think there has been some changes in the RDF format that have not been reflected in Wikidata-Toolkit yet.
https://github.com/Wikidata/Wikidata-Toolkit/
There is an example Java application taking a JSON dump and translating it to RDF here: https://github.com/Wikidata/Wikidata-Toolkit-Examples/blob/master/src/exampl...
I don't have a good overview of what changed in the RDF serialization since, but it might not be so much work to update WDTK accordingly. At least, on the JSON side of things, it can parse things well.
Best, Antonin