To support the new RDF functionality in Drupal 7, a new hook has been added to the Drupal API. The new hook is hook_rdf_mapping
, which allows you to define RDF mappings for the field bundles attached to entities defined by the module. The return value of the method should be a nested array defining the structure of the mapping as follows:
type
—the entity namebundle
—the name of the bundle (content type) that the mapping applies tomapping
—an associative array with a key for each field to be mappedpredicates
—an array of RDF predicates describing the relationships between the bundle and the value of the field. The value will be text, another bundle, or a URL.datatype
—a type used with the callback to format data so that it is readable by machines. For example, you can use this to properly format dates so that a computer can use the data.callback
—a method to be called for the given datatypetype
—a string used in the RDFa markup to identify the type of the fieldrdftype
—a property...