Creating default object from empty value
It sounds like your system wants to make sure $vars['rdf'] is a valid object before assigning properties to it. 

Try adding:

if (empty($variables['rdf']) || !is_object($variables['rdf'])) {
  $vars['rdf'] = new stdClass();
}


Just above your line 31. 

For safety's sake, add it above

if (module_exists('rdf')) {


That way the object will get initialized regardless of whether the RDF module is enabled or not.