Fixes RDF export of subobjects

Partial integration of the patch https://gerrit.wikimedia.org/r/#/c/70047/4
from Dbeeson
I would say its better to leave it there since the entire class has it everywhere. Removing it from one place will look odd and removing it everywhere in this change will make the change ugly.