diff --git a/core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php b/core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php
new file mode 100644
index 0000000..aba08ed
--- /dev/null
+++ b/core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Field\EntityReferenceFieldItemList.
+ */
+
+namespace Drupal\Core\Field;
+
+/**
+ * Defines a item list class for entity reference fields.
+ */
+class EntityReferenceFieldItemList extends FieldItemList implements EntityReferenceFieldItemListInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function referencedEntities() {
+    // Get a list of items having non-empty target ids.
+    $list = array_filter($this->list, function($item) {
+      return (bool) $item->target_id;
+    });
+
+    $ids = array();
+    foreach ($list as $delta => $item) {
+      $ids[$delta] = $item->target_id;
+    }
+    if (empty($ids)) {
+      return array();
+    }
+
+    $target_type = $this->getFieldDefinition()->getSetting('target_type');
+    $entities = \Drupal::entityManager()->getStorage($target_type)->loadMultiple($ids);
+
+    $target_entities = array();
+    foreach ($ids as $delta => $target_id) {
+      if (isset($entities[$target_id])) {
+        $target_entities[$delta] = $entities[$target_id];
+      }
+    }
+
+    return $target_entities;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Field/EntityReferenceFieldItemListInterface.php b/core/lib/Drupal/Core/Field/EntityReferenceFieldItemListInterface.php
new file mode 100644
index 0000000..5c6985e
--- /dev/null
+++ b/core/lib/Drupal/Core/Field/EntityReferenceFieldItemListInterface.php
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Field\EntityReferenceFieldItemListInterface.
+ */
+
+namespace Drupal\Core\Field;
+
+/**
+ * Interface for entity reference lists of field items.
+ */
+interface EntityReferenceFieldItemListInterface extends FieldItemListInterface {
+
+  /**
+   * Returns all the entities referenced by this field, preserving field item
+   * deltas.
+   *
+   * @return \Drupal\Core\Entity\EntityInterface[]
+   *   An array of entity objects keyed by field item deltas.
+   */
+  public function referencedEntities();
+
+}
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 410a256..87ce1ee 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -114,6 +114,12 @@ public function viewElements(FieldItemListInterface $items) {
           // Hide the element links.
           $elements[$delta][$target_type][$item->target_id]['links']['#access'] = FALSE;
         }
+        // Add a resource attribute to set the mapping property's value to the
+        // entity's url. Since we don't know what the markup of the entity will
+        // be, we shouldn't rely on it for structured data such as RDFa.
+        if (!empty($item->_attributes)) {
+          $item->_attributes += array('resource' => $item->entity->url());
+        }
       }
       else {
         // This is an "auto_create" item.
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
index bc305cd..45680a1 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
@@ -75,6 +75,14 @@ public function viewElements(FieldItemListInterface $items) {
             '#type' => 'link',
             '#title' => $label,
           ) + $uri->toRenderArray();
+
+          if (!empty($item->_attributes)) {
+            $elements[$delta]['#options'] += array('attributes' => array());
+            $elements[$delta]['#options']['attributes'] += $item->_attributes;
+            // Unset field item attributes since they have been included in the
+            // formatter output and should not be rendered in the field template.
+            unset($item->_attributes);
+          }
         }
         else {
           $elements[$delta] = array('#markup' => check_plain($label));
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EntityReferenceRdfaTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EntityReferenceRdfaTest.php
new file mode 100644
index 0000000..4c29a2f
--- /dev/null
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/EntityReferenceRdfaTest.php
@@ -0,0 +1,100 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\rdf\Tests\Field\TaxonomyTermReferenceRdfaTest.
+ */
+
+namespace Drupal\rdf\Tests\Field;
+
+use Drupal\rdf\Tests\Field\FieldRdfaTestBase;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Language\Language;
+
+/**
+ * Tests the RDFa output of the entity reference field formatter.
+ */
+class EntityReferenceRdfaTest extends FieldRdfaTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $fieldType = 'entity_reference';
+
+  /**
+   * The entity type used in this test.
+   *
+   * @var string
+   */
+  protected $entityType = 'entity_test';
+
+  /**
+   * The bundle used in this test.
+   *
+   * @var string
+   */
+  protected $bundle = 'entity_test';
+
+  /**
+   * The term for testing.
+   *
+   * @var \Drupal\taxonomy\Entity\Term
+   */
+  protected $target_entity;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = array('entity', 'entity_reference', 'options', 'text', 'filter');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Field formatter: entity reference',
+      'description' => 'Tests RDFa output by entity reference field formatters.',
+      'group' => 'RDF',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+
+    $this->installSchema('entity_test', array('entity_test_rev', 'entity_test_rev_revision'));
+
+    entity_reference_create_instance($this->entityType, $this->bundle, $this->fieldName, 'Field test', $this->entityType);
+
+    $this->entity = entity_create($this->entityType, array(
+      'name' => "Jamie",
+      'langcode' => Language::LANGCODE_NOT_SPECIFIED,
+    ));
+
+    $this->target_entity = entity_create($this->entityType, array(
+      'name' => "Julie",
+      'langcode' => Language::LANGCODE_NOT_SPECIFIED,
+    ));
+    $this->target_entity->save();
+
+    // Add the mapping.
+    $mapping = rdf_get_mapping('entity_test', 'entity_test');
+    $mapping->setFieldMapping($this->fieldName, array(
+      'properties' => array('schema:knows'),
+    ))->save();
+
+    // Set up test values.
+    $this->entity->{$this->fieldName}->target_id = $this->target_entity->id();
+    $this->entity->{$this->fieldName}->target_type = 'entity_test';
+
+    $this->entity->save();
+    $this->uri = $this->getAbsoluteUri($this->entity);
+  }
+
+  /**
+   * Tests all the entity reference formatters.
+   */
+  public function testAllFormatters() {
+    $entity_uri = $this->getAbsoluteUri($this->target_entity);
+    // Tests the label formatter.
+    $this->assertFormatterRdfa(array('type' => 'entity_reference_label'), 'http://schema.org/knows', array('value' => $entity_uri, 'type' => 'uri'));
+    // Tests the entity formatter.
+    $this->assertFormatterRdfa(array('type'=>'entity_reference_entity_view'), 'http://schema.org/knows', array('value' => $entity_uri, 'type' => 'uri'));
+  }
+
+}
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
index 14bcfa1..ae333f0 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
@@ -83,6 +83,7 @@ protected function assertFormatterRdfa($formatter, $property, $expected_rdf_valu
       ->save();
     $build = entity_view($this->entity, 'default');
     $output = drupal_render($build);
+    debug($output);
     $graph = new \EasyRdf_Graph($this->uri, $output, 'rdfa');
     $this->assertTrue($graph->hasProperty($this->uri, $property, $expected_rdf_value), "Formatter {$formatter['type']} exposes data correctly for {$this->fieldType} fields.");
   }
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 410a256..87ce1ee 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -114,6 +114,12 @@ public function viewElements(FieldItemListInterface $items) {
           // Hide the element links.
           $elements[$delta][$target_type][$item->target_id]['links']['#access'] = FALSE;
         }
+        // Add a resource attribute to set the mapping property's value to the
+        // entity's url. Since we don't know what the markup of the entity will
+        // be, we shouldn't rely on it for structured data such as RDFa.
+        if (!empty($item->_attributes)) {
+          $item->_attributes += array('resource' => $item->entity->url());
+        }
       }
       else {
         // This is an "auto_create" item.
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
index bc305cd..45680a1 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
@@ -75,6 +75,14 @@ public function viewElements(FieldItemListInterface $items) {
             '#type' => 'link',
             '#title' => $label,
           ) + $uri->toRenderArray();
+
+          if (!empty($item->_attributes)) {
+            $elements[$delta]['#options'] += array('attributes' => array());
+            $elements[$delta]['#options']['attributes'] += $item->_attributes;
+            // Unset field item attributes since they have been included in the
+            // formatter output and should not be rendered in the field template.
+            unset($item->_attributes);
+          }
         }
         else {
           $elements[$delta] = array('#markup' => check_plain($label));
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
index 14bcfa1..f34a05b 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
@@ -115,5 +115,8 @@ protected function createTestField() {
   protected function getAbsoluteUri($entity) {
     return $entity->url('canonical', array('absolute' => TRUE));
   }
+  protected function getRelativeUri($entity) {
+    return $entity->url('canonical', array('absolute' => FALSE));
+  }
 
 }
