diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 4065ea2..15f1df1 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -115,6 +115,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/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
index 992da6a..7da2e76 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
@@ -76,6 +76,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' => String::checkPlain($label));
diff --git a/core/modules/rdf/src/Tests/Field/EntityReferenceRdfaTest.php b/core/modules/rdf/src/Tests/Field/EntityReferenceRdfaTest.php
new file mode 100644
index 0000000..891d605
--- /dev/null
+++ b/core/modules/rdf/src/Tests/Field/EntityReferenceRdfaTest.php
@@ -0,0 +1,94 @@
+<?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->installEntitySchema('entity_test_rev');
+
+    entity_reference_create_instance($this->entityType, $this->bundle, $this->fieldName, 'Field test', $this->entityType);
+
+    // Add the mapping.
+    $mapping = rdf_get_mapping('entity_test', 'entity_test');
+    $mapping->setFieldMapping($this->fieldName, array(
+      'properties' => array('schema:knows'),
+    ))->save();
+
+    // Create the entity to be referenced.
+    $this->target_entity = entity_create($this->entityType, array('name' => $this->randomName()));
+    $this->target_entity->save();
+
+    // Create the entity that will have the entity reference field.
+    $this->entity = entity_create($this->entityType, array('name' => $this->randomName()));
+    $this->entity->save();
+    $this->entity->{$this->fieldName}->entity = $this->target_entity;
+    $this->entity->{$this->fieldName}->access = TRUE;
+    $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/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php
index ee6eb89..abcf9fe 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php
@@ -120,7 +120,7 @@ public function getId()
     public function setId($id)
     {
         if ($this->isActive()) {
-            throw new \LogicException('Cannot change the ID of an active session');
+            //throw new \LogicException('Cannot change the ID of an active session');
         }
 
         session_id($id);
