Apache jena is available as a library so you can read a model from Fedora 4, which might be a bit safer. E.g.:
https://github.com/futures/benchtool/blob/master/src/main/java/org/fcrepo/bench/BenchToolFC4.java#L44