I wonder if we should move this function to ``AbstractRdfMapper``. It doesn't have any dependencies on Doctrine AFAICT, and can be nicely re-used by other mappers (just tried locally with my Midgard mapper). Strictly speaking, it could even live in a completely separate class, but maybe that's just over-engineering :-)