[473730] Ignore type descriptions within URIs

Some frameworks enrich URIs by attaching an optional human readable
description of the type the URI is pointing to. Ignore type descriptions
when determining equality of URIs.

Includes testcase.

Bug: 473730
Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com>
Change-Id: I0cc88c75f3bd2c584a23d6cefa61d9a4c9fe8497
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/suite/AllTests.java
index 2cca78c..bfbb87a 100644
--- a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/suite/AllTests.java
@@ -7,7 +7,7 @@
  * 
  * Contributors:
  *     Obeo - initial API and implementation
- *     Stefan Dirix - add ModelExtensionUtilTest and SaveParameterHook tests
+ *     Stefan Dirix - add ModelExtensionUtil, SaveParameterHook and URIAttachment tests
  *******************************************************************************/
 package org.eclipse.emf.compare.diagram.papyrus.tests.suite;
 
@@ -25,6 +25,7 @@
 import org.eclipse.emf.compare.diagram.papyrus.tests.renaming.MergeRenamingMatchResource3WayTest;
 import org.eclipse.emf.compare.diagram.papyrus.tests.saveparameter.SaveParameterHookIntegrationTest;
 import org.eclipse.emf.compare.diagram.papyrus.tests.saveparameter.SaveParameterHookTest;
+import org.eclipse.emf.compare.diagram.papyrus.tests.uriattachment.URIAttachmentTest;
 import org.eclipse.emf.compare.tests.suite.CompareTestSuite;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -48,7 +49,7 @@
 @RunWith(Suite.class)
 @SuiteClasses({AssocMergeTest.class, EdgeMergeTest.class, NodeMergeTest.class,
 		ModelExtensionUtilTest.class, SaveParameterHookTest.class,
-		SaveParameterHookIntegrationTest.class,
+		SaveParameterHookIntegrationTest.class, URIAttachmentTest.class,
 		MergeRenamingMatchResource2WayTest.class,
 		MergeRenamingMatchResource3WayTest.class })
 public class AllTests {
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/URIAttachmentTest.java b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/URIAttachmentTest.java
new file mode 100644
index 0000000..a3965c3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/URIAttachmentTest.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2015 EclipseSource Muenchen GmbH and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Stefan Dirix - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.papyrus.tests.uriattachment;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.diagram.papyrus.tests.AbstractTest;
+import org.eclipse.emf.compare.diagram.papyrus.tests.DiagramInputData;
+import org.eclipse.emf.compare.diagram.papyrus.tests.uriattachment.data.URIAttachmentData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Test;
+
+public class URIAttachmentTest extends AbstractTest {
+
+	URIAttachmentData input = new URIAttachmentData();
+
+	@Override
+	protected DiagramInputData getInput() {
+		return input;
+	}
+
+	/**
+	 * Checks whether the EqualityHelper correctly determines equality regarding URI attachments. Setup:
+	 * <ul>
+	 * <li>origin/attribute -> uri=href:attribute?description?</li>
+	 * <li>left/attribute -> uri=href:attribute</li>
+	 * <li>right/attribute removed</li>
+	 * </ul>
+	 * Since the only difference between origin/attribute and left/attribute is the URI type description,
+	 * they should be considered equal. If this is not the case the comparison will result in conflicts.
+	 */
+	@Test
+	public void testA1() throws IOException {
+		final Resource left = input.getA1Left();
+		final Resource right = input.getA1Right();
+		final Resource origin = input.getA1Origin();
+
+		Comparison comparison = buildComparison(left, right, origin);
+
+		assertEquals(0, comparison.getConflicts().size());
+	}
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/URIAttachmentData.java b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/URIAttachmentData.java
new file mode 100644
index 0000000..147e909
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/URIAttachmentData.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2015 EclipseSource Muenchen GmbH and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Stefan Dirix - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.papyrus.tests.uriattachment.data;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.diagram.papyrus.tests.DiagramInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+
+public class URIAttachmentData extends DiagramInputData {
+
+	public Resource getA1Left() throws IOException {
+		return loadFromClassLoader("a1/left/model.notation");
+	}
+
+	public Resource getA1Right() throws IOException {
+		return loadFromClassLoader("a1/right/model.notation");
+	}
+
+	public Resource getA1Origin() throws IOException {
+		return loadFromClassLoader("a1/origin/model.notation");
+	}
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.di b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.notation b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.notation
new file mode 100644
index 0000000..ffd0465
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.notation
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_buMgEDUHEeWoftexbUcysw" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_ymGE4DUHEeWoftexbUcysw" type="2008">
+    <children xmi:type="notation:DecorationNode" xmi:id="_ymGr8DUHEeWoftexbUcysw" type="5029"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_ymGr8TUHEeWoftexbUcysw" type="8510">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_ymGr8jUHEeWoftexbUcysw" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_ymGr8zUHEeWoftexbUcysw" type="7017">
+      <children xmi:type="notation:Shape" xmi:id="_yD7WgDUIEeWoftexbUcysw" type="3012">
+        <element xmi:type="uml:Property" href="model.uml#_yD0o0DUIEeWoftexbUcysw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_yD7WgTUIEeWoftexbUcysw"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_ymGr9DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_ymGr9TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_ymGr9jUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGr9zUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_ymGr-DUHEeWoftexbUcysw" type="7018">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_ymGr-TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_ymGr-jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_ymGr-zUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGr_DUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_ymGr_TUHEeWoftexbUcysw" type="7019">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_ymGr_jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_ymGr_zUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_ymGsADUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGsATUHEeWoftexbUcysw"/>
+    </children>
+    <element xmi:type="uml:Class" href="model.uml#_ymE2wDUHEeWoftexbUcysw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGE4TUHEeWoftexbUcysw" x="172" y="139"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_0KLt0DUHEeWoftexbUcysw" type="2008">
+    <children xmi:type="notation:DecorationNode" xmi:id="_0KLt0jUHEeWoftexbUcysw" type="5029"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_0KMU4DUHEeWoftexbUcysw" type="8510">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_0KMU4TUHEeWoftexbUcysw" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU4jUHEeWoftexbUcysw" type="7017">
+      <children xmi:type="notation:Shape" xmi:id="_Q9TecDUJEeWoftexbUcysw" type="3012">
+        <element xmi:type="uml:Property" href="model.uml#_Q9PNADUJEeWoftexbUcysw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Q9TecTUJEeWoftexbUcysw"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU4zUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU5DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU5TUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU5jUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU5zUHEeWoftexbUcysw" type="7018">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU6DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU6TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU6jUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU6zUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU7DUHEeWoftexbUcysw" type="7019">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU7TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU7jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU7zUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU8DUHEeWoftexbUcysw"/>
+    </children>
+    <element xmi:type="uml:Class" href="model.uml#_0KKfsDUHEeWoftexbUcysw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KLt0TUHEeWoftexbUcysw" x="575" y="143"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_buMgETUHEeWoftexbUcysw" name="diagram_compatibility_version" stringValue="1.1.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_buMgEjUHEeWoftexbUcysw"/>
+  <styles xmi:type="style:PapyrusViewStyle" xmi:id="_buMgEzUHEeWoftexbUcysw">
+    <owner xmi:type="uml:Model" href="model.uml#_bq1DADUHEeWoftexbUcysw"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_bq1DADUHEeWoftexbUcysw"/>
+</notation:Diagram>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.uml b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.uml
new file mode 100644
index 0000000..0837b43
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/left/model.uml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_bq1DADUHEeWoftexbUcysw" name="RootElement">
+  <packagedElement xmi:type="uml:Class" xmi:id="_ymE2wDUHEeWoftexbUcysw" name="Class1">
+    <ownedAttribute xmi:type="uml:Property" xmi:id="_yD0o0DUIEeWoftexbUcysw" name="Attribute1">
+      <type xmi:type="uml:DataType" href="../type/types.uml#_qzymMDUHEeWoftexbUcysw"/>
+    </ownedAttribute>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_0KKfsDUHEeWoftexbUcysw" name="Class2">
+    <ownedAttribute xmi:type="uml:Property" xmi:id="_Q9PNADUJEeWoftexbUcysw" name="Attribute1"/>
+  </packagedElement>
+</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.di b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.notation b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.notation
new file mode 100644
index 0000000..059b9c3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.notation
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_buMgEDUHEeWoftexbUcysw" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_ymGE4DUHEeWoftexbUcysw" type="2008">
+    <children xmi:type="notation:DecorationNode" xmi:id="_ymGr8DUHEeWoftexbUcysw" type="5029"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_ymGr8TUHEeWoftexbUcysw" type="8510">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_ymGr8jUHEeWoftexbUcysw" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_ymGr8zUHEeWoftexbUcysw" type="7017">
+      <children xmi:type="notation:Shape" xmi:id="_yD7WgDUIEeWoftexbUcysw" type="3012">
+        <element xmi:type="uml:Property" href="model.uml#_yD0o0DUIEeWoftexbUcysw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_yD7WgTUIEeWoftexbUcysw"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_ymGr9DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_ymGr9TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_ymGr9jUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGr9zUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_ymGr-DUHEeWoftexbUcysw" type="7018">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_ymGr-TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_ymGr-jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_ymGr-zUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGr_DUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_ymGr_TUHEeWoftexbUcysw" type="7019">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_ymGr_jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_ymGr_zUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_ymGsADUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGsATUHEeWoftexbUcysw"/>
+    </children>
+    <element xmi:type="uml:Class" href="model.uml#_ymE2wDUHEeWoftexbUcysw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ymGE4TUHEeWoftexbUcysw" x="172" y="139"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_0KLt0DUHEeWoftexbUcysw" type="2008">
+    <children xmi:type="notation:DecorationNode" xmi:id="_0KLt0jUHEeWoftexbUcysw" type="5029"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_0KMU4DUHEeWoftexbUcysw" type="8510">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_0KMU4TUHEeWoftexbUcysw" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU4jUHEeWoftexbUcysw" type="7017">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU4zUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU5DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU5TUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU5jUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU5zUHEeWoftexbUcysw" type="7018">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU6DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU6TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU6jUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU6zUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU7DUHEeWoftexbUcysw" type="7019">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU7TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU7jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU7zUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU8DUHEeWoftexbUcysw"/>
+    </children>
+    <element xmi:type="uml:Class" href="model.uml#_0KKfsDUHEeWoftexbUcysw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KLt0TUHEeWoftexbUcysw" x="575" y="143"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_buMgETUHEeWoftexbUcysw" name="diagram_compatibility_version" stringValue="1.1.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_buMgEjUHEeWoftexbUcysw"/>
+  <styles xmi:type="style:PapyrusViewStyle" xmi:id="_buMgEzUHEeWoftexbUcysw">
+    <owner xmi:type="uml:Model" href="model.uml#_bq1DADUHEeWoftexbUcysw"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_bq1DADUHEeWoftexbUcysw"/>
+</notation:Diagram>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.uml b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.uml
new file mode 100644
index 0000000..e76f098
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/origin/model.uml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_bq1DADUHEeWoftexbUcysw" name="RootElement">
+  <packagedElement xmi:type="uml:Class" xmi:id="_ymE2wDUHEeWoftexbUcysw" name="Class1">
+    <ownedAttribute xmi:type="uml:Property" xmi:id="_yD0o0DUIEeWoftexbUcysw" name="Attribute1">
+      <type xmi:type="uml:DataType" href="../type/types.uml#_qzymMDUHEeWoftexbUcysw?types/DataType/TestType?"/>
+    </ownedAttribute>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_0KKfsDUHEeWoftexbUcysw" name="Class2"/>
+</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.di b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.di
new file mode 100644
index 0000000..bf9abab
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.notation b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.notation
new file mode 100644
index 0000000..08ae80c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.notation
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_buMgEDUHEeWoftexbUcysw" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_0KLt0DUHEeWoftexbUcysw" type="2008">
+    <children xmi:type="notation:DecorationNode" xmi:id="_0KLt0jUHEeWoftexbUcysw" type="5029"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_0KMU4DUHEeWoftexbUcysw" type="8510">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_0KMU4TUHEeWoftexbUcysw" y="5"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU4jUHEeWoftexbUcysw" type="7017">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU4zUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU5DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU5TUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU5jUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU5zUHEeWoftexbUcysw" type="7018">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU6DUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU6TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU6jUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU6zUHEeWoftexbUcysw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_0KMU7DUHEeWoftexbUcysw" type="7019">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_0KMU7TUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_0KMU7jUHEeWoftexbUcysw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_0KMU7zUHEeWoftexbUcysw"/>
+      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KMU8DUHEeWoftexbUcysw"/>
+    </children>
+    <element xmi:type="uml:Class" href="model.uml#_0KKfsDUHEeWoftexbUcysw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0KLt0TUHEeWoftexbUcysw" x="575" y="143"/>
+  </children>
+  <styles xmi:type="notation:StringValueStyle" xmi:id="_buMgETUHEeWoftexbUcysw" name="diagram_compatibility_version" stringValue="1.1.0"/>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_buMgEjUHEeWoftexbUcysw"/>
+  <styles xmi:type="style:PapyrusViewStyle" xmi:id="_buMgEzUHEeWoftexbUcysw">
+    <owner xmi:type="uml:Model" href="model.uml#_bq1DADUHEeWoftexbUcysw"/>
+  </styles>
+  <element xmi:type="uml:Model" href="model.uml#_bq1DADUHEeWoftexbUcysw"/>
+</notation:Diagram>
diff --git a/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.uml b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.uml
new file mode 100644
index 0000000..82d9322
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.papyrus.tests/src/org/eclipse/emf/compare/diagram/papyrus/tests/uriattachment/data/a1/right/model.uml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_bq1DADUHEeWoftexbUcysw" name="RootElement">
+  <packagedElement xmi:type="uml:Class" xmi:id="_0KKfsDUHEeWoftexbUcysw" name="Class2"/>
+</uml:Model>
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
index 08968d1..827349b 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2015 Obeo and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     Obeo - initial API and implementation
+ *     Stefan Dirix - bug 473730 (ignore URI type descriptions)
  *******************************************************************************/
 package org.eclipse.emf.compare.utils;
 
@@ -230,7 +231,9 @@
 		final URI uri1 = uriCache.getUnchecked(object1);
 		final URI uri2 = uriCache.getUnchecked(object2);
 		if (uri1.hasFragment() && uri2.hasFragment()) {
-			equal = uri1.fragment().equals(uri2.fragment());
+			final String uri1Fragment = removeURIAttachment(uri1.fragment());
+			final String uri2Fragment = removeURIAttachment(uri2.fragment());
+			equal = uri1Fragment.equals(uri2Fragment);
 		} else {
 			equal = uri1.equals(uri2);
 		}
@@ -238,6 +241,27 @@
 	}
 
 	/**
+	 * To some {@link URI}s a human friendly description is attached describing the type the {@link URI}
+	 * is pointing to. The description is marked by a "?" at the beginning and end. This method returns
+	 * the fragment without the attached type description.
+	 * 
+	 * @param fragment
+	 *                The {@link URI} fragment to check for a type description attachment
+	 * @return The fragment of the {@link URI} stripped from type description if it has one, otherwise the
+	 *         original fragment is returned.
+	 */
+	private String removeURIAttachment(String fragment) {
+		// check if fragment contains at least two question marks
+		final int questionMark1 = fragment.indexOf('?');
+		final boolean hasTwoQuestionMarks = questionMark1 != -1
+				&& fragment.indexOf('?', questionMark1 + 1) != -1;
+		if (hasTwoQuestionMarks) {
+			return fragment.substring(0, questionMark1);
+		}
+		return fragment;
+	}
+
+	/**
 	 * Checks whether the given object is contained anywhere.
 	 * 
 	 * @param object