Home ›
Best practice for an upgraded site to define RDF mappings for RDFa output?Best practice for an upgraded site to define RDF mappings for RDFa output?
Submitted by Benjamin Melançon on December 29, 2011 - 6:19am
A site that has been upgraded from Drupal 6 to Drupal 7 has not even had this code from standard.install in the Standard profile run yet. Can generic mappings like this be easily taken care of in other custom configuration of RDF or should this (plus more?) go in an update hook?
<?php
// Insert default pre-defined RDF mapping into the database.
$rdf_mappings = array(
array(
'type' => 'node',
'bundle' => 'page',
'mapping' => array(
'rdftype' => array('foaf:Document'),
),
),
array(
'type' => 'node',
'bundle' => 'article',
'mapping' => array(
'field_image' => array(
'predicates' => array('og:image', 'rdfs:seeAlso'),
'type' => 'rel',
),
'field_tags' => array(
'predicates' => array('dc:subject'),
'type' => 'rel',
),
),
),
);
foreach ($rdf_mappings as $rdf_mapping) {
rdf_mapping_save($rdf_mapping);
}
?>
Searched words:
sitewide RDFa best-practice following D7 to D7 site upgrade
Comments
Post new comment