=== modified file 'modules/field/field.module'
--- modules/field/field.module	2009-06-06 16:17:30 +0000
+++ modules/field/field.module	2009-06-09 20:00:36 +0000
@@ -228,6 +228,26 @@
 }
 
 /**
+ * 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
@@ -616,6 +636,7 @@
     'field_name_css' => strtr($field['field_name'], '_', '-'),
     'label' => check_plain(t($instance['label'])),
     'label_display' => $element['#label_display'],
+    'rdfa' => 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-06-16 08:40:18 +0000
+++ modules/field/field.test	2009-06-16 10:18:14 +0000
@@ -1668,3 +1668,64 @@
     $this->assertTrue(!empty($another_instance) && empty($another_instance['deleted']), t('A non-deleted field instance is not marked for deletion.'));
   }
 }
+
+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-05-12 14:36:12 +0000
+++ modules/field/theme/field.tpl.php	2009-05-14 16:43:12 +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.
  * - $teaser: Whether this is displayed as a 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 ?>>
           <?php if ($label_display == 'inline') { ?>
             <div class="field-label-inline<?php print($delta ? '' : '-first')?>">
               <?php print t($label) ?>:&nbsp;</div>

