From 24669bfb50d643330cd50cbeea21d19d51107a36 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 19 Oct 2009 18:28:16 +0000 Subject: =?UTF-8?q?-=20Patch=20#493030=20by=20scor,=20Stefan=20Freudenberg?= =?UTF-8?q?,=20pwolanin,=20fago,=20Benjamin=20Melan=C3=A7on,=20kriskras,?= =?UTF-8?q?=20dmitrig01,=20sun:=20added=20RDFa=20support=20to=20Drupal=20c?= =?UTF-8?q?ore.=20Oh=20my,=20oh=20my.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/taxonomy/taxonomy.module | 45 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 69025f6bb..8a4bbd11c 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1102,7 +1102,8 @@ function taxonomy_field_formatter_info() { */ function theme_field_formatter_taxonomy_term_link($variables) { $term = $variables['element']['#item']['taxonomy_term']; - return l($term->name, taxonomy_term_path($term)); + $attributes = empty($variables['link_options']) ? array() : $variables['link_options']; + return l($term->name, taxonomy_term_path($term), $attributes); } /** @@ -1405,6 +1406,47 @@ function taxonomy_field_settings_form($field, $instance, $has_data) { return $form; } +/** + * Implement hook_rdf_mapping(). + * + * @return array + * The rdf mapping for vocabularies and terms. + */ +function taxonomy_rdf_mapping() { + return array( + array( + 'type' => 'taxonomy_term', + 'bundle' => RDF_DEFAULT_BUNDLE, + 'mapping' => array( + 'rdftype' => array('skos:Concept'), + 'name' => array( + 'predicates' => array('skos:prefLabel'), + ), + 'description' => array( + 'predicates' => array('skos:definition'), + ), + // The vocabulary this term belongs to. + 'vid' => array( + 'predicates' => array('skos:member'), + ), + ), + ), + array( + 'type' => 'taxonomy_vocabulary', + 'bundle' => RDF_DEFAULT_BUNDLE, + 'mapping' => array( + 'rdftype' => array('skos:Collection'), + 'name' => array( + 'predicates' => array('rdfs:label'), + ), + 'description' => array( + 'predicates' => array('rdfs:comment'), + ), + ), + ), + ); +} + /** * @defgroup taxonomy indexing Taxonomy functions maintaining {taxonomy_index}. * @@ -1495,4 +1537,3 @@ function taxonomy_taxonomy_term_delete($term) { /** * @} End of "defgroup taxonomy indexing" */ - -- cgit v1.2.3