=== modified file 'modules/field/field.module'
--- modules/field/field.module	2009-08-11 14:59:40 +0000
+++ modules/field/field.module	2009-08-17 14:35:28 +0000
@@ -237,6 +237,26 @@ function field_modules_disabled($modules
 }
 
 /**
+ * Implementation of hook_rdf_mapping().
+ *
+ * @return array
+ *   The RDF mappings of all field instances
+ */
+function field_rdf_mapping() {
+  $mapping = array();
+  
+  foreach (field_info_instances() as $bundle_name => $instances) {
+    foreach ($instances as $field_name => $instance) {
+      if (isset($instance['rdf_mapping'])) {
+        $mapping[$bundle_name][$field_name] = $instance['rdf_mapping'];
+      }
+    }
+  }
+
+  return $mapping;
+}
+
+/**
  * Allows a module to update the database for fields and columns it controls.
  *
  * @param string $module
@@ -617,6 +637,7 @@ function template_preprocess_field(&$var
     'field_name_css' => strtr($field['field_name'], '_', '-'),
     'label' => check_plain(t($instance['label'])),
     'label_display' => $element['#label_display'],
+    'rdfa_attributes' => isset($instance['rdf_mapping']) ? drupal_rdfa_attributes($instance['rdf_mapping']) : '',
     'field_empty' => $field_empty,
     'template_files' => array(
       'field',

=== modified file 'modules/field/field.test'
--- modules/field/field.test	2009-08-17 07:12:15 +0000
+++ modules/field/field.test	2009-08-17 10:43:39 +0000
@@ -2040,3 +2040,67 @@ class FieldBulkDeleteTestCase extends Dr
     $this->assertEqual(count($fields), 0, 'The field is purged.');
   }
 }
+
+/**
+ * Unit test class for fields RDF mappings functionality.
+ */
+class FieldRdfMappingTestCase extends DrupalWebTestCase {
+  protected $field_a, $field_b;
+  protected $field_instance_a, $field_instance_b;
+    
+  public static function getInfo() {
+    return array(
+      'name'  => t('Field RDF tests'),
+      'description'  => t("Test RDF mapping for fields."),
+      'group' => t('Field')
+    );
+  }
+
+  function setUp() {
+    parent::setUp('field_sql_storage', 'field', 'field_test', 'rdf');
+    
+    // Define a field instance with a simple RDF mapping.
+    $this->field_a = array(
+      'field_name' => drupal_strtolower($this->randomName()),
+      'type' => 'test_field',
+    );
+    field_create_field($this->field_a);
+    $this->field_instance_a = array(
+      'field_name' => $this->field_a['field_name'],
+      'bundle' => 'test_bundle',
+      'rdf_mapping' => array(
+        'dc:something'
+      ),
+    );
+    field_create_instance($this->field_instance_a);
+    
+    // Define a field instance with a RDF mapping having multiple RDF properties.
+    $this->field_b = array(
+      'field_name' => drupal_strtolower($this->randomName()),
+      'type' => 'test_field',
+    );
+    field_create_field($this->field_b);
+    $this->field_instance_b = array(
+      'field_name' => $this->field_b['field_name'],
+      'bundle' => 'test_bundle',
+      'rdf_mapping' => array(
+        'dc:something',
+        'dc:somethingelse',
+      ),
+    );
+    field_create_instance($this->field_instance_b);
+  }
+  
+  function testRdfMapping() {
+    $rdf_mapping = rdf_get_mapping('test_bundle');
+    
+    // Simple mapping works.
+    $this->assertTrue(is_array($rdf_mapping[$this->field_instance_b['field_name']]));
+    $this->assertTrue(in_array('dc:something', $rdf_mapping[$this->field_instance_a['field_name']]));
+    
+    // Multiple mapping works.
+    $this->assertTrue(is_array($rdf_mapping[$this->field_instance_b['field_name']]));
+    $this->assertTrue(in_array('dc:something', $rdf_mapping[$this->field_instance_b['field_name']]));
+    $this->assertTrue(in_array('dc:somethingelse', $rdf_mapping[$this->field_instance_b['field_name']]));
+  }
+}

=== modified file 'modules/field/theme/field.tpl.php'
--- modules/field/theme/field.tpl.php	2009-06-22 09:10:04 +0000
+++ modules/field/theme/field.tpl.php	2009-08-17 14:34:48 +0000
@@ -8,6 +8,7 @@
  * Available variables:
  * - $object: The object to which the field is attached.
  * - $field: The field array.
+ * - $instance: The field instance array.
  * - $items: An array of values for each item in the field array.
  * - $build_mode: Build mode, e.g. 'full', 'teaser'...
  * - $page: Whether this is displayed as a page.
@@ -34,7 +35,7 @@
     <?php $count = 1;
     foreach ($items as $delta => $item) :
       if (!$item['empty']) : ?>
-        <div class="field-item <?php print ($count % 2 ? 'odd' : 'even') ?>">
+        <div class="field-item <?php print ($count % 2 ? 'odd' : 'even') ?>" <?php print $rdfa_attributes ?>>
           <?php if ($label_display == 'inline') { ?>
             <div class="field-label-inline<?php print($delta ? '' : '-first')?>">
               <?php print t($label) ?>:&nbsp;</div>

