diff --git a/src/server/sparql/sampo/sparql_queries/SparqlQueriesPerspective1.js b/src/server/sparql/sampo/sparql_queries/SparqlQueriesPerspective1.js
index b2b9958a4547a0b8cd941249bce0ea74e2c14789..b6ae656a05280720fa18b1a66f70a0f0eda97e0d 100644
--- a/src/server/sparql/sampo/sparql_queries/SparqlQueriesPerspective1.js
+++ b/src/server/sparql/sampo/sparql_queries/SparqlQueriesPerspective1.js
@@ -507,7 +507,8 @@ export const migrationsQuery = `
             geo:lat ?to__lat ;
             geo:long ?to__long .
     BIND(CONCAT("/places/page/", REPLACE(STR(?to__id), "^.*\\\\/(.+)", "$1")) AS ?to__dataProviderUrl)
-    BIND(IRI(CONCAT(STR(?from__id), "-", REPLACE(STR(?to__id), "http://ldf.fi/yoma/place/", ""))) as ?id)
+    BIND(IRI(CONCAT(STR(?from__id), "-", REPLACE(STR(?to__id), "http://ldf.fi/mmm/place/", ""))) as ?id)
+    FILTER(?from__id != ?to__id)
   }
   GROUP BY ?id 
   ?from__id ?from__prefLabel ?from__lat ?from__long ?from__dataProviderUrl