diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php
index 7d2a099..847d893 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/UserAttributesTest.php
@@ -48,59 +48,68 @@ public function setUp() {
    * being used.
    */
   function testUserAttributesInMarkup() {
-    // Creates two users, one with access to user profiles.
+    // Creates users that should and should not be truncated
+    // by template_preprocess_username (20 characters)
+    // one of these users tests right on the cusp (20).
     $user1 = $this->drupalCreateUser(array('access user profiles'));
-    $user2 = $this->drupalCreateUser();
+
+    $authors = array(
+      $this->drupalCreateUser(array(), $this->randomName(30)),
+      $this->drupalCreateUser(array(), $this->randomName(20)),
+      $this->drupalCreateUser(array(), $this->randomName(5))
+    );
+
     $this->drupalLogin($user1);
 
-    $account_uri = url('user/' . $user2->id(), array('absolute' => TRUE));
+    foreach($authors as $author) {
+      $account_uri = url('user/' . $author->id(), array('absolute' => TRUE));
 
-    // Parses the user profile page where the default bundle mapping for user
-    // should be used.
-    $parser = new \EasyRdf_Parser_Rdfa();
-    $graph = new \EasyRdf_Graph();
-    $base_uri = url('<front>', array('absolute' => TRUE));
-    $parser->parse($graph, $this->drupalGet('user/' . $user2->id()), 'rdfa', $base_uri);
+      // Parses the user profile page where the default bundle mapping for user
+      // should be used.
+      $parser = new \EasyRdf_Parser_Rdfa();
+      $graph = new \EasyRdf_Graph();
+      $base_uri = url('<front>', array('absolute' => TRUE));
+      $parser->parse($graph, $this->drupalGet('user/' . $author->id()), 'rdfa', $base_uri);
 
-    // Inspects RDF graph output.
-    // User type.
-    $expected_value = array(
-      'type' => 'uri',
-      'value' => 'http://rdfs.org/sioc/ns#UserAccount',
-    );
-    $this->assertTrue($graph->hasProperty($account_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'User type found in RDF output (sioc:UserAccount).');
-    // User name.
-    $expected_value = array(
-      'type' => 'literal',
-      'value' => $user2->getUsername(),
-    );
-    $this->assertTrue($graph->hasProperty($account_uri, 'http://xmlns.com/foaf/0.1/name', $expected_value), 'User name found in RDF output (foaf:name).');
+      // Inspects RDF graph output.
+      // User type.
+      $expected_value = array(
+        'type' => 'uri',
+        'value' => 'http://rdfs.org/sioc/ns#UserAccount',
+      );
+      $this->assertTrue($graph->hasProperty($account_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'User type found in RDF output (sioc:UserAccount).');
+      // User name.
+      $expected_value = array(
+        'type' => 'literal',
+        'value' => $author->getUsername(),
+      );
+      $this->assertTrue($graph->hasProperty($account_uri, 'http://xmlns.com/foaf/0.1/name', $expected_value), 'User name found in RDF output (foaf:name).');
 
-    // User 2 creates a node.
-    $this->drupalLogin($user2);
-    $node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
-    $this->drupalLogin($user1);
+      // User creates a node.
+      $this->drupalLogin($author);
+      $node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
+      $this->drupalLogin($user1);
 
-    // Parses the user profile page where the default bundle mapping for user
-    // should be used.
-    $parser = new \EasyRdf_Parser_Rdfa();
-    $graph = new \EasyRdf_Graph();
-    $base_uri = url('<front>', array('absolute' => TRUE));
-    $parser->parse($graph, $this->drupalGet('node/' . $node->id()), 'rdfa', $base_uri);
-
-    // Ensures the default bundle mapping for user is used on the Authored By
-    // information on the node.
-    // User type.
-    $expected_value = array(
-      'type' => 'uri',
-      'value' => 'http://rdfs.org/sioc/ns#UserAccount',
-    );
-    $this->assertTrue($graph->hasProperty($account_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'User type found in RDF output (sioc:UserAccount).');
-    // User name.
-    $expected_value = array(
-      'type' => 'literal',
-      'value' => $user2->getUsername(),
-    );
-    $this->assertTrue($graph->hasProperty($account_uri, 'http://xmlns.com/foaf/0.1/name', $expected_value), 'User name found in RDF output (foaf:name).');
+      // Parses the node created by the user.
+      $parser = new \EasyRdf_Parser_Rdfa();
+      $graph = new \EasyRdf_Graph();
+      $base_uri = url('<front>', array('absolute' => TRUE));
+      $parser->parse($graph, $this->drupalGet('node/' . $node->id()), 'rdfa', $base_uri);
+
+      // Ensures the default bundle mapping for user is used on the Authored By
+      // information on the node.
+      $expected_value = array(
+        'type' => 'uri',
+        'value' => 'http://rdfs.org/sioc/ns#UserAccount',
+      );
+      $this->assertTrue($graph->hasProperty($account_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'User type found in RDF output (sioc:UserAccount).');
+      // User name.
+      $expected_value = array(
+        'type' => 'literal',
+        'value' => $author->getUsername(),
+      );
+      $this->assertTrue($graph->hasProperty($account_uri, 'http://xmlns.com/foaf/0.1/name', $expected_value), 'User name found in RDF output (foaf:name).');
+
+    }
   }
 }
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 057af3e..ed20ac0 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -410,6 +410,11 @@ function rdf_preprocess_username(&$variables) {
   if (!empty($variables['homepage']) && !empty($homepage_mapping)) {
     $attributes['rel'] = $homepage_mapping['properties'];
   }
+  // Long usernames are truncated by template_preprocess_username(). Assert
+  // the full name in the content attribute so it can be extracted in RDFa.
+  if ($variables['truncated']) {
+    $attributes['content'] = check_plain($variables['name_raw']);
+  }
   // The remaining attributes can have multiple values listed, with whitespace
   // separating the values in the RDFa attributes
   // (see http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes).
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 2bb880b..08a9ff1 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -622,6 +622,10 @@ function template_preprocess_username(&$variables) {
   $name = $variables['name_raw'] = $account->getUsername();
   if (drupal_strlen($name) > 20) {
     $name = drupal_substr($name, 0, 15) . '...';
+    $variables['truncated'] = TRUE;
+  }
+  else {
+    $variables['truncated'] = FALSE;
   }
   $variables['name'] = check_plain($name);
   $variables['profile_access'] = \Drupal::currentUser()->hasPermission('access user profiles');
@@ -653,6 +657,7 @@ function template_preprocess_username(&$variables) {
  *   An associative array containing:
  *   - account: The user object to format.
  *   - name: The user's name, sanitized.
+ *   - truncated: Boolean TRUE if $variables['name'] has been shortened.
  *   - extra: Additional text to append to the user's name, sanitized.
  *   - link_path: The path or URL of the user's profile page, home page, or
  *     other desired page to link to for more information about the user.
