title: Using UML2 to parse a XMI file, how to handle href properties?
body: <p>I use <a href="http://wiki.eclipse.org/MDT-UML2" rel="nofollow">UML2</a> to parse a XMI file which contains an UML shema.</p>
  
  <p>Here is the content of my .uml generated by Modelio :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_PuKnYPqnEeKOHL0-05J3_Q" name="xmitojava"&gt;
    &lt;eAnnotations xmi:id="_PuKnYfqnEeKOHL0-05J3_Q" source="Objing"&gt;
      &lt;contents xmi:type="uml:Property" xmi:id="_PuKnYvqnEeKOHL0-05J3_Q" name="exporterVersion"&gt;
        &lt;defaultValue xmi:type="uml:LiteralString" xmi:id="_PuKnY_qnEeKOHL0-05J3_Q" value="2.2"/&gt;
      &lt;/contents&gt;
    &lt;/eAnnotations&gt;
    &lt;ownedComment xmi:id="_PuKnZPqnEeKOHL0-05J3_Q"&gt;
      &lt;body&gt;&lt;/body&gt;
    &lt;/ownedComment&gt;
    &lt;packagedElement xmi:type="uml:Class" xmi:id="_PuKnZfqnEeKOHL0-05J3_Q" name="User"&gt;
      &lt;ownedAttribute xmi:id="_PuKnZvqnEeKOHL0-05J3_Q" name="login" visibility="protected" isUnique="false" isReadOnly="true"&gt;
        &lt;type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/&gt;
      &lt;/ownedAttribute&gt;
    &lt;/packagedElement&gt;
    &lt;packagedElement xmi:type="uml:Class" xmi:id="_PuKnZ_qnEeKOHL0-05J3_Q" name="Group"/&gt;
  &lt;/uml:Model&gt;
  </code></pre>
  
  <p>You can notice that in the <code>User</code> class, the type of <code>login</code> is defined according to :</p>
  
  <pre><code> &lt;type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/&gt;
  </code></pre>
  
  <p>So my question is : How to manage this case ? Indeed, I try to parse this document in this way :</p>
  
  <pre><code>URI typesUri = URI.createFileURI(pathToMyUmlFile);
  
  ResourceSet set = new ResourceSetImpl();
  set.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
  set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
  set.createResource(typesUri);
  
  Resource r = set.getResource(typesUri, true);
  
  Model model = (Model) EcoreUtil.getObjectByType(r.getContents(), UMLPackage.Literals.MODEL);
  </code></pre>
  
  <p>But after that the type of my Property named <code>login</code> is null.</p>
  
  <p>Thanks for help :)</p>