Helper function to get the default RDF mapping for a given entity type.
$type: An entity type, e.g. 'node' or 'comment'.
The RDF mapping or an empty array if no mapping is defined for this entity type.
function _rdf_get_default_mapping($type) {
$default_mappings =& drupal_static(__FUNCTION__);
if (!isset($default_mappings)) {
// Get all of the modules that implement hook_rdf_mapping().
$modules = module_implements('rdf_mapping');
// Only consider the default entity mapping definitions.
foreach ($modules as $module) {
$mappings = module_invoke($module, 'rdf_mapping');
foreach ($mappings as $mapping) {
if ($mapping['bundle'] === RDF_DEFAULT_BUNDLE) {
$default_mappings[$mapping['type']] = $mapping['mapping'];
}
}
}
}
return isset($default_mappings[$type]) ? $default_mappings[$type] : array();
}