=== modified file 'modules/field/field.module'
--- modules/field/field.module	2009-09-11 06:48:02 +0000
+++ modules/field/field.module	2009-09-12 18:57:12 +0000
@@ -228,6 +228,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

=== modified file 'modules/field/field.test'
--- modules/field/field.test	2009-09-11 03:42:34 +0000
+++ modules/field/field.test	2009-09-11 11:23:01 +0000
@@ -2338,3 +2338,70 @@ class FieldBulkDeleteTestCase extends Fi
     $this->assertEqual(count($fields), 0, 'The field is purged.');
   }
 }
+
+/**
+ * Unit test class for fields RDF mappings functionality.
+ */
+class FieldRdfMappingTestCase extends FieldTestCase {
+  protected $field_a, $field_b;
+  protected $field_instance_a, $field_instance_b;
+
+  public static function getInfo() {
+    return array(
+      'name'  => t('Field RDFa output'),
+      'description'  => t("Ensure that RDFa is output for fields."),
+      'group' => t('Field')
+    );
+  }
+
+  function setUp() {
+    DrupalWebTestCase::setUp('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(
+        'property' => 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(
+        'property' => 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']]['property']));
+
+    // Multiple mapping works.
+    $this->assertTrue(is_array($rdf_mapping[$this->field_instance_b['field_name']]['property']));
+    $this->assertTrue(in_array('dc:something', $rdf_mapping[$this->field_instance_b['field_name']]['property']));
+    $this->assertTrue(in_array('dc:somethingelse', $rdf_mapping[$this->field_instance_b['field_name']]['property']));
+  }
+
+}

