RDFa API
Functions to describe entities and bundles for RDFa.
RDF module introduces RDFa to Drupal, which provides a set of XHTML attributes to augment visual data with machine-readable hints.
See also
http://www.w3.org/TR/xhtml-rdfa-primer/
Modules can provide mappings of their bundles' data and metadata to RDFa properties using the appropriate vocabularies. This module takes care of injecting that data into variables available to themers in the .tpl files. Drupal core themes ship with RDFa output enabled.
Example mapping from node.module:
<?php
array(
'type' => 'node',
'bundle' => RDF_DEFAULT_BUNDLE,
'mapping' => array(
'rdftype' => array('sioc:Item', 'foaf:Document'),
'title' => array(
'predicates' => array('dc:title'),
),
'created' => array(
'predicates' => array('dc:date', 'dc:created'),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'body' => array(
'predicates' => array('content:encoded'),
),
'uid' => array(
'predicates' => array('sioc:has_creator'),
),
'name' => array(
'predicates' => array('foaf:name'),
),
),
);
?>
Constants
| Name | Location | Description |
|---|---|---|
| RDF_DEFAULT_BUNDLE | modules/rdf/rdf.module | RDF bundle flag: Default bundle. |
Functions
| Name | Location | Description |
|---|---|---|
| rdf_mapping_delete | modules/rdf/rdf.module | Deletes the mapping for the given pair of type and bundle from the database. |
| rdf_mapping_load | modules/rdf/rdf.module | Returns the mapping for attributes of a given type/bundle pair. |
| rdf_mapping_save | modules/rdf/rdf.module | Saves an RDF mapping to the database. |
| rdf_rdfa_attributes | modules/rdf/rdf.module | Builds an array of RDFa attributes for a given mapping. |
| _rdf_get_default_mapping | modules/rdf/rdf.module | Returns the default RDF mapping for a given entity type. |
| _rdf_mapping_load | modules/rdf/rdf.module | Helper function to retrieve a RDF mapping from the database. |
