=== modified file 'modules/user/user.module'
--- modules/user/user.module	2009-06-13 20:40:07 +0000
+++ modules/user/user.module	2009-06-15 08:31:27 +0000
@@ -269,6 +269,11 @@
 
       field_attach_load('user', $queried_users);
 
+      // Generate an RDF resource URI for each user account.
+      foreach ($queried_users as $account) {
+        $account->rdf = array('uri' => 'user/' . $account->uid . '#user');
+      }
+
       // Invoke hook_user_load() on the users loaded from the database
       // and add them to the static cache.
       foreach (module_implements('user_load') as $module) {
@@ -2934,3 +2939,14 @@
   return empty($groups) ? FALSE : $groups;
 }
 
+/**
+ * Implementation of hook_rdf_mapping().
+ */
+function user_rdf_mapping() {
+  return array(
+    'user' => array(
+      'rdftype' => array('sioc:User'),
+      'title'   => array('foaf:name'),
+    )
+  );
+} 

=== modified file 'modules/user/user.pages.inc'
--- modules/user/user.pages.inc	2009-06-05 09:26:06 +0000
+++ modules/user/user.pages.inc	2009-06-09 20:37:04 +0000
@@ -167,6 +167,7 @@
  */
 function user_view($account) {
   drupal_set_title($account->name);
+
   // Retrieve all profile fields and attach to $account->content.
   user_build_content($account);
 
@@ -175,6 +176,12 @@
     '#theme' => 'user_profile',
     '#account' => $account,
   );
+  
+  if (module_exists('rdf')) {
+    $mapping = rdf_get_mapping('user');
+    $build += array('#rdf_mapping' => $mapping);
+    drupal_set_rdf_page_mapping($mapping);
+  }
 
   return $build;
 }

=== modified file 'modules/user/user.test'
--- modules/user/user.test	2009-06-13 20:40:07 +0000
+++ modules/user/user.test	2009-06-14 14:43:37 +0000
@@ -1067,3 +1067,36 @@
     $this->assertTrue($user_by_name, t('Loading user by name.'));
   }
 }
+
+class UserRDFaTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => t('User RDFa output'),
+      'description' => t('Ensure that RDFa is output on user pages.'),
+      'group' => t('User'),
+    );
+  }
+
+  function setUp() {
+    parent::setUp('rdf');
+    variable_set('theme_default', 'stark');
+  }
+
+  function testUserRdfa() {
+    // Create a user with access to view user profiles.
+    $user = $this->drupalCreateUser(array('access user profiles'));
+    $this->drupalLogin($user);
+
+    // Create a user profile to view.
+    $account = $this->drupalCreateUser();
+    $this->drupalGet('user/' . $account->uid);
+
+    $result = $this->xpath('//*[contains(@about, "#this") and contains(@typeof, "sioc:User")]');
+    $this->assertFalse(empty($result), t('Found a typeof attribute including sioc:User'));
+
+    $result = $this->xpath('//h1[contains(@property, "foaf:name")]');
+    $this->assertFalse(empty($result), t('Found a h1 tag with property foaf:name'));
+  }
+
+}
+

