rdf_preprocess_node

rdf_preprocess_node(&$variables) Implements hook_preprocess_HOOK() for node templates. File core/modules/rdf/rdf.module, line 300 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_preprocess_node(&$variables) { // Adds RDFa markup to the node container. The about attribute specifies the // URI of the resource described within the HTML element, while the @typeof // attribute indicates its RDF type (e.g., foaf:Document, sioc:Person, and s

rdf_preprocess_image

rdf_preprocess_image(&$variables) Implements hook_preprocess_HOOK() for image.html.twig. File core/modules/rdf/rdf.module, line 572 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_preprocess_image(&$variables) { // Adds the RDF type for image. We cannot use the usual entity-based mapping // to get 'foaf:Image' because image does not have its own entity type or // bundle. $variables['attributes']['typeof'] = array('foaf:Image'); }

rdf_preprocess_html

rdf_preprocess_html(&$variables) Implements hook_preprocess_HOOK() for HTML document templates. File core/modules/rdf/rdf.module, line 265 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_preprocess_html(&$variables) { // Adds RDF namespace prefix bindings in the form of an RDFa 1.1 prefix // attribute inside the html element. if (!isset($variables['html_attributes']['prefix'])) { $variables['html_attributes']['prefix'] = array();

rdf_preprocess_field__node__uid

rdf_preprocess_field__node__uid(&$variables) Implements hook_preprocess_HOOK() for UID field templates. File core/modules/rdf/rdf.module, line 279 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_preprocess_field__node__uid(&$variables) { _rdf_set_field_rel_attribute($variables); }

rdf_preprocess_comment

rdf_preprocess_comment(&$variables) Implements hook_preprocess_HOOK() for comment templates. File core/modules/rdf/rdf.module, line 447 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_preprocess_comment(&$variables) { $comment = $variables['comment']; $mapping = rdf_get_mapping('comment', $comment->bundle()); $bundle_mapping = $mapping->getPreparedBundleMapping(); if (!empty($bundle_mapping['types']) && !isset($commen

rdf_help

rdf_help($route_name, RouteMatchInterface $route_match) Implements hook_help(). File core/modules/rdf/rdf.module, line 15 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.rdf': $output = ''; $output .= '<h3>' . t('About') . '</h3>'; $output .= '<p>' . t('The RDF module enriches your content with metadata to let other

rdf_get_mapping

rdf_get_mapping($entity_type, $bundle) Returns the RDF mapping object associated with a bundle. The function reads the rdf_mapping object from the current configuration, or returns a ready-to-use empty one if no configuration entry exists yet for this bundle. This streamlines the manipulation of mapping objects by always returning a consistent object that reflects the current state of the configuration. Example usage: -Map the 'article' bundle to 'sioc:Post' and the 'title' field to 'dc:title'.

rdf_entity_prepare_view

rdf_entity_prepare_view($entity_type, array $entities, array $displays) Implements hook_entity_prepare_view(). File core/modules/rdf/rdf.module, line 208 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_entity_prepare_view($entity_type, array $entities, array $displays) { // Iterate over the RDF mappings for each entity and prepare the RDFa // attributes to be added inside field formatters. foreach ($entities as $entity) { $mapping = rdf_g

rdf_comment_storage_load

rdf_comment_storage_load($comments) Implements hook_ENTITY_TYPE_storage_load() for comment entities. File core/modules/rdf/rdf.module, line 229 Enables semantically enriched output for Drupal sites in the form of RDFa. Code function rdf_comment_storage_load($comments) { foreach ($comments as $comment) { // Pages with many comments can show poor performance. This information // isn't needed until rdf_preprocess_comment() is called, but set it here // to optimize performance for w

RdfMappingInterface::setFieldMapping

public RdfMappingInterface::setFieldMapping($field_name, array $mapping = array()) Sets the mapping config for a field. Parameters string $field_name: The name of the field. array $mapping: The field mapping. Return value \Drupal\rdf\Entity\RdfMapping The RdfMapping object. File core/modules/rdf/src/RdfMappingInterface.php, line 105 Class RdfMappingInterface Provides an interface defining an RDF mapping entity. Namespace Drupal\rdf Code public function setFieldMapping($field_name, ar