diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesConflictTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesConflictTest.php
new file mode 100644
index 0000000..0d0f008
--- /dev/null
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesConflictTest.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\rdf\Tests\GetRdfNamespacesConflictTest.
+ */
+
+namespace Drupal\rdf\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests for RDF namespaces declaration with hook_rdf_namespaces().
+ */
+class GetRdfNamespacesConflictTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('rdf', 'rdf_conflicting_namespaces');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'RDF conflicting namespaces',
+      'description' => 'Ensure an exception is thrown if modules have conflicting namespace declarations.',
+      'group' => 'RDF',
+    );
+  }
+
+  /**
+   * Tests getting RDF namespaces.
+   */
+  function testGetRdfNamespacesThrowsException() {
+    try {
+      // Get all RDF namespaces.
+      $ns = rdf_get_namespaces();
+      $this->fail(t('Expected exception not thrown for conflicting namespace declaration.'));
+    }
+    catch (\Exception $e) {
+      $this->pass(t('Expected exception thrown: @message', array('@message' => $e->getMessage())));
+    }
+  }
+}
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php
index b2e881c..df70722 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php
@@ -24,7 +24,7 @@ class GetRdfNamespacesTest extends WebTestBase {
   public static function getInfo() {
     return array(
       'name' => 'RDF namespaces',
-      'description' => 'Test hook_rdf_namespaces() and ensure only "safe" namespaces are returned.',
+      'description' => 'Test hook_rdf_namespaces().',
       'group' => 'RDF',
     );
   }
@@ -39,6 +39,5 @@ function testGetRdfNamespaces() {
     $this->assertEqual($ns['rdfs'], 'http://www.w3.org/2000/01/rdf-schema#', 'A prefix declared once is included.');
     $this->assertEqual($ns['foaf'], 'http://xmlns.com/foaf/0.1/', 'The same prefix declared in several implementations of hook_rdf_namespaces() is valid as long as all the namespaces are the same.');
     $this->assertEqual($ns['foaf1'], 'http://xmlns.com/foaf/0.1/', 'Two prefixes can be assigned the same namespace.');
-    $this->assertEqual($ns['dc'], 'http://purl.org/dc/terms/', 'When a prefix has conflicting namespaces, the first declared one is used.');
   }
 }
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 057af3e..eec3908 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -5,7 +5,6 @@
  * Enables semantically enriched output for Drupal sites in the form of RDFa.
  */
 
-use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Template\Attribute;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 
@@ -114,9 +113,16 @@ function rdf_get_namespaces() {
   foreach (\Drupal::moduleHandler()->getImplementations('rdf_namespaces') as $module) {
     $function = $module . '_rdf_namespaces';
     if (function_exists($function)) {
-      $namespaces = NestedArray::mergeDeep($function(), $namespaces);
+      foreach($function() as $prefix => $namespace) {
+        if (array_key_exists($prefix, $namespaces) && $namespace !== $namespaces[$prefix]) {
+          throw new Exception(t('Tried to map @prefix to @namespace, but @prefix is already mapped to @orig_namespace.', array('@prefix' => $prefix, '@namespace' => $namespace, '@orig_namespace' => $namespaces[$prefix])));
+        }
+        else {
+          $namespaces[$prefix] = $namespace;
+      }
     }
   }
+  }
   return $namespaces;
 }
 
diff --git a/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml b/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml
new file mode 100644
index 0000000..33a5cd9
--- /dev/null
+++ b/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml
@@ -0,0 +1,9 @@
+name: 'RDF module conflicting namespaces test'
+type: module
+description: 'Test conflicting namespace declaration.'
+package: Testing
+version: VERSION
+core: 8.x
+hidden: true
+dependencies:
+  - rdf
diff --git a/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module b/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module
new file mode 100644
index 0000000..97d0e18
--- /dev/null
+++ b/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.module
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * Test the namespace registration functionality.
+ */
+
+/**
+ * Implements hook_rdf_namespaces().
+ */
+function rdf_conflicting_namespaces_rdf_namespaces() {
+  return array(
+    'dc'       => 'http://purl.org/conflicting/namespace',
+  );
+}
diff --git a/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.module b/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.module
index c938927..d44c519 100644
--- a/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.module
+++ b/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.module
@@ -10,7 +10,6 @@
  */
 function rdf_test_namespaces_rdf_namespaces() {
   return array(
-    'dc'       => 'http://purl.org/conflicting/namespace',
     'foaf'     => 'http://xmlns.com/foaf/0.1/',
     'foaf1'    => 'http://xmlns.com/foaf/0.1/',
   );
