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

NameLocationDescription
RDF_DEFAULT_BUNDLEmodules/rdf/rdf.moduleRDF bundle flag: Default bundle.

Functions

NameLocationDescription
rdf_mapping_deletemodules/rdf/rdf.moduleDeletes the mapping for the given pair of type and bundle from the database.
rdf_mapping_loadmodules/rdf/rdf.moduleReturns the mapping for attributes of a given type/bundle pair.
rdf_mapping_savemodules/rdf/rdf.moduleSaves an RDF mapping to the database.
rdf_rdfa_attributesmodules/rdf/rdf.moduleBuilds an array of RDFa attributes for a given mapping.
_rdf_get_default_mappingmodules/rdf/rdf.moduleReturns the default RDF mapping for a given entity type.
_rdf_mapping_loadmodules/rdf/rdf.moduleHelper function to retrieve a RDF mapping from the database.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.