diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/GetRdfNamespacesTest.php
index b2e881c..c14e0ca 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,16 @@ 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.');
+
+    // Enable rdf_conflicting_namespaces to ensure that an exception is thrown 
+    // when RDF namespaces are conflicting.
+    \Drupal::moduleHandler()->install(array('rdf_conflicting_namespaces'), TRUE);
+    try {
+      $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/rdf.module b/core/modules/rdf/rdf.module
index 057af3e..de43346 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,7 +113,14 @@ 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_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/',
   );
