Bug 309832 - Cannot open UML2.2 test cases from OMG's Model Interchange Working Group (MIWG)
Summary: Cannot open UML2.2 test cases from OMG's Model Interchange Working Group (MIWG)
Status: NEW
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: UML2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-20 11:42 EDT by Nicolas Rouquette CLA
Modified: 2014-02-10 21:11 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Rouquette CLA 2010-04-20 11:42:12 EDT
Eclipse Helios build of Eclipse UML can't open most of the models in OMG's Model Interchange Working Group (MIWG)'s test cases.

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/uml.xml' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/valid.xmi, 2, 163)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.8beta/our-export.xml, 6, 75)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.8beta/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.5/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.5/our-export.xml, 6, 77)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.5/our-export.xml, 15, 86)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/EnterpriseArchitect-7.5/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/EnterpriseArchitect-7.5/our-export.xml, 3, 76)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/EnterpriseArchitect-7.5/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/uml.xml' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/valid.xmi, 2, 163)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/MagicDraw-16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/MagicDraw-16.8beta/our-export.xml, 6, 75)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/MagicDraw-16.8beta/our-export.xml, 15, 94)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/EnterpriseArchitect-7.5/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/EnterpriseArchitect-7.5/our-export.xml, 3, 76)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/EnterpriseArchitect-7.5/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/ArtisanStudio 7.1b.2/our-export.xmi

org.eclipse.emf.ecore.xmi.UnresolvedReferenceException: Unresolved reference 'RED'. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/ArtisanStudio%207.1b.2/our-export.xmi, 55, 206)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-3/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/uml.xml' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-3/valid.xmi, 3, 70)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/StandardProfileL2.xmi' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-3/valid.xmi, 41, 103)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/MagicDraw16.6/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/MagicDraw16.6/our-export.xml, 6, 75)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/MagicDraw16.6/our-export.xml, 15, 95)


https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/EnterpriseArchitect7.5plus/our_export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/EnterpriseArchitect7.5plus/our_export.xml, 3, 76)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/EnterpriseArchitect7.5plus/our_export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/valid.xmi, 2, 174)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/RSx-8.x/our-export.xmi

org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'Extension' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/RSx-8.x/our-export.xmi, 138, 69)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/uml2/schemas/Ecore/5' not found. (http://schema.omg.org/spec/UML/2.2/StandardProfileL2.xmi, 764, 126)
java.io.FileNotFoundException: http://schema.omg.org/spec/UML/2.2/Ecore.profile.uml

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/MagicDraw16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/MagicDraw16.8beta/our-export.xml, 6, 75)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.3' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/MagicDraw16.8beta/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/EnterpriseArchitect8.0beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 3, 76)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/valid.xmi, 2, 228)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/RSx-8.x/our-export.xmi

org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'Extension' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/RSx-8.x/our-export.xmi, 61, 69)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/Modelio1.1/our-export.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/Modelio1.1/our-export.xmi, 2, 174)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/MagicDraw16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/MagicDraw16.8beta/our-export.xml, 6, 75)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.3' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/MagicDraw16.8beta/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/EnterpriseArchitect8.0beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 3, 76)
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-9/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-9/valid.xmi, 2, 284)

There may be a problem in the way Eclipse UML defines the resource factories for various versions of UML/XMI.

Compare:

/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java
/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI212UMLResourceFactoryImpl.java

XMI212UMLResourceFactoryImpl adds package registrations for the org.eclipse.core.contenttype.contentType extensions in org.eclipse.uml2.uml's plugin.xml whereas XMI2UMLResourceFactoryImpl doesn't.
Comment 1 Thomas Neustupny CLA 2011-02-22 04:12:41 EST
Is there some workaround, like some editing domain configuration that allows for reading the MIWG test cases?

Like Ed Merks said in the Eclipse Forum:
"EMF provides support for content types based on extension points so
there is definitely a mechanism by which everyone can share and reuse
the same global mappings. I.e., you can define content type recognizers
and you can associate a resource factory with a content type."
Comment 2 Kenn Hussey CLA 2011-02-22 09:05:24 EST
(In reply to comment #1)
> Is there some workaround, like some editing domain configuration that allows
> for reading the MIWG test cases?
> 

The editing domain for the UML Editor is supposed to be configured so that you can successfully open these files via 'Open With > UML Editor'...

> Like Ed Merks said in the Eclipse Forum:
> "EMF provides support for content types based on extension points so
> there is definitely a mechanism by which everyone can share and reuse
> the same global mappings. I.e., you can define content type recognizers
> and you can associate a resource factory with a content type."

It should be possible to get this working with the necessary resource factories in place (based on content type, not extension)...
Comment 3 Thomas Neustupny CLA 2011-02-23 04:22:29 EST
> The editing domain for the UML Editor is supposed to be configured so that you
> can successfully open these files via 'Open With > UML Editor'...

I'm not a user nor a developer of the UML Editor. Can you point me to the place where the UML Editor configures it's editing domain, so that I can make my code read the MIWG models? (I must admit that I can't get the UML Editor running in my Helios installation.)
Comment 4 Kenn Hussey CLA 2011-02-24 23:22:41 EST
(In reply to comment #3)
> I'm not a user nor a developer of the UML Editor. Can you point me to the place
> where the UML Editor configures it's editing domain, so that I can make my code
> read the MIWG models? (I must admit that I can't get the UML Editor running in
> my Helios installation.)

Sure. If you look at the source for the createModel() method of the org.eclipse.uml2.uml.editor.presentation.UMLEditor class, you'll see that it registers the necessary content types and extended metadata like this:

		Map<String, Object> contentTypeToFactoryMap = resourceSet
			.getResourceFactoryRegistry().getContentTypeToFactoryMap();

		contentTypeToFactoryMap.put(
			UML22UMLResource.UML2_CONTENT_TYPE_IDENTIFIER,
			UML22UMLResource.Factory.INSTANCE);
		contentTypeToFactoryMap.put(
			UML212UMLResource.UML_2_1_0_CONTENT_TYPE_IDENTIFIER,
			UML212UMLResource.Factory.INSTANCE);
		contentTypeToFactoryMap.put(
			XMI2UMLResource.UML_CONTENT_TYPE_IDENTIFIER,
			XMI2UMLResource.Factory.INSTANCE);
		contentTypeToFactoryMap.put(
			XMI212UMLResource.UML_2_1_1_CONTENT_TYPE_IDENTIFIER,
			XMI212UMLResource.Factory.INSTANCE);
		contentTypeToFactoryMap.put(
			XMI212UMLResource.UML_2_1_CONTENT_TYPE_IDENTIFIER,
			XMI212UMLResource.Factory.INSTANCE);
		contentTypeToFactoryMap.put(
			CMOF2UMLResource.CMOF_CONTENT_TYPE_IDENTIFIER,
			CMOF2UMLResource.Factory.INSTANCE);

		Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();

		uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
		uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
		uriMap.putAll(CMOF2UMLExtendedMetaData.getURIMap());
Comment 5 Kenn Hussey CLA 2011-02-28 21:07:52 EST
(In reply to comment #0)
> Eclipse Helios build of Eclipse UML can't open most of the models in OMG's
> Model Interchange Working Group (MIWG)'s test cases.

Nicolas, I don't have access to any of the resources you referenced; attaching them to this bug will go a long way toward me being able to debug the problem...
Comment 6 Thomas Neustupny CLA 2011-03-02 07:12:17 EST
Kenn, your extensions to the contentTypeToFactoryMap seems to have no effect, but I found that adding the following in the xmi file works:

xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1/uml.xml http://www.eclipse.org/uml2/3.0.0/UML"

So I have a problem with http://schema.omg.org/spec/UML/2.1.1/uml.xml, how can I configure my editing domain so that I don't need this (dirty?) xmi hack? That would solve this issue in my eyes.
Comment 7 Thomas Neustupny CLA 2011-03-02 07:26:48 EST
Maybe this constant is to be used?
org.eclipse.uml2.uml.resource.XMI212UMLResource.UML_METAMODEL_2_1_1_URI
Comment 8 Kenn Hussey CLA 2011-03-02 09:16:08 EST
(In reply to comment #6)
> Kenn, your extensions to the contentTypeToFactoryMap seems to have no effect,
> but I found that adding the following in the xmi file works:
> 
> xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1/uml.xml
> http://www.eclipse.org/uml2/3.0.0/UML"

Hmm, I would have expected use of http://schema.omg.org/spec/UML/2.1.1 to identify the UML 2.1.1 namespace, and that's what the content type registrations in UML expect:

     <content-type
           base-type="org.omg.uml"
           file-extensions="xmi"
           id="org.omg.uml_2_1_1"
           name="%_UI_OMG_UML_2_1_1_content_type"
           priority="normal">
        <describer
              class="org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl$Describer">
           <parameter
                 name="namespace"
                 value="http://schema.omg.org/spec/UML/2.1.1" />
           <parameter
                 name="kind"
                 value="xmi" />
        </describer>
     </content-type>

I suppose this content type registration could/should be adjusted to handle the extra "/uml.xml", but I'm not convinced that's the correct normative namespace URI for UML 2.1.1...
Comment 9 Thomas Neustupny CLA 2011-03-02 10:35:52 EST
Replacing http://schema.omg.org/spec/UML/2.1.1/uml.xml by http://schema.omg.org/spec/UML/2.1.1 globally in the xmi file works!

However, the header of the MIWG test case 1 xmi file definitely is:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://schema.omg.org/spec/UML/2.1.1/uml.xml" xmi:id="_0" name="testCase1">

(And that's what needs to get working unless MIWG doesn't change the namespace.)
Comment 10 Thomas Neustupny CLA 2011-03-03 04:15:04 EST
Here is the fix I propose:

Registry packageRegistry = resourceSet.getPackageRegistry();
packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_URI, UMLPackage.eINSTANCE);

Works for me. Nicolas, whatever you use to open the MIWG test cases, it should have built in something like that. Needs to be checked, probably in the editing domain for the UML Editor.
Comment 11 Kenn Hussey CLA 2012-06-21 12:45:23 EDT
New utilities have been added in UML2 4.0 to initialize a resource set with all of the necessary registrations needed to load UML resources of various flavors/versions. See UMLUtil.init(ResourceSet) and UMLResourcesUtil.init(ResourceSet), the latter of which is for standalone scenarios. Please consider trying one/both of these utilities to see if the issues you encountered still exist.