Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [SOLVED] UML2API basics(getStereotype in standalone projects)
[SOLVED] UML2API basics [message #502693] Wed, 09 December 2009 13:17 Go to next message
Stefan  is currently offline Stefan
Messages: 13
Registered: October 2009
Junior Member
Hi,

i am currently playing around with the uml2 implementation in the emf project.
as a starting point i have a UML-class-diagram with a UML-OWL-Profile applied. I am doing this according to the "Getting start with UML2" tutorial.

Now i load the UML-class-diagram like this (i am doing it in a stand alone application just for testing at the moment, later maybe in a eclipse-plugin):
		ResourceSet resourceSet =  new ResourceSetImpl(); 
		resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
		Map uriMap = resourceSet.getURIConverter().getURIMap();
		URI uri = URI.createURI("jar:file:/C:/eclipse/plugins/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar!/");
		uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri.appendSegment("libraries").appendSegment(""));
		uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri.appendSegment("metamodels").appendSegment(""));
		uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri.appendSegment("profiles").appendSegment(""));

		URI modelFile = URI.createFileURI("src/m3o-profiled.uml");		
		URI profileFile = URI.createFileURI("src/OWL.profile.uml");
		UMLResource modelResource = (UMLResource)resourceSet.getResource(modelFile, true);
		UMLResource profileResource = (UMLResource)resourceSet.getResource(profileFile, true);


i can iterate over the Model and get any information i want, but i can get any profile information, e.g. using getAppliedStereotype on a Element. If i look into the .uml file of the Class-diagram i can find statements like this at the end.
<OWL:owlOntology xmi:id="_vjb6UOQPEd6IJsGhqErA_g" base_Package="_zJBy4OQNEd6IJsGhqErA_g"/>
and the urifragment in base_Package is corresponding to an element in my Class-diagram.

I know maybe i should do this in ATL. But i am quite good in java and have no idea of ATL so i want to try this in java.

Thx

Stefan

So what do i have to do to make getAppliedStereoType working?

[Updated on: Thu, 10 December 2009 16:21]

Report message to a moderator

Re: UML2API basics [message #503010 is a reply to message #502693] Thu, 10 December 2009 15:03 Go to previous messageGo to next message
Stefan  is currently offline Stefan
Messages: 13
Registered: October 2009
Junior Member
Ok,

first, wrong forum i apologize, but i wont start a new thread somewhere else now and unfortunately i cant move it.
So now some more information on what i have already tried.
First of all, i think it has something to do with the paths and their registration, but i cant figure out what to register where.
Here is my .uml file i what to work with:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:OWL="http:///schemas/OWL/_K1uRkOWWEd6M1cgfy9sNmg/9" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http:///schemas/OWL/_K1uRkOWWEd6M1cgfy9sNmg/9 ../MetaModels/OWL.profile.uml#_K1x78OWWEd6M1cgfy9sNmg">
  <uml:Model xmi:id="_6I-AYeWVEd6M1cgfy9sNmg">
    <packagedElement xmi:type="uml:Package" xmi:id="_
eSa0OWVEd6M1cgfy9sNmg" name="DataValuePattern">
      <packagedElement xmi:type="uml:Class" xmi:id="_ldhPkOWWEd6M1cgfy9sNmg" name="Entity"/>
      <packagedElement xmi:type="uml:Class" xmi:id="_my9YgOWWEd6M1cgfy9sNmg" name="Quality"/>
      <packagedElement xmi:type="uml:Class" xmi:id="_n7H6cOWWEd6M1cgfy9sNmg" name="Region"/>
      <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_rlO0sOWWEd6M1cgfy9sNmg" name="Value"/>
      <packagedElement xmi:type="uml:Association" xmi:id="_yPma8OWWEd6M1cgfy9sNmg" name="hasQuality" memberEnd="_yPnpEOWWEd6M1cgfy9sNmg _yPoQIeWWEd6M1cgfy9sNmg">
        <ownedEnd xmi:id="_yPnpEOWWEd6M1cgfy9sNmg" name="src" type="_ldhPkOWWEd6M1cgfy9sNmg" association="_yPma8OWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_yPoQIOWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_yPnpEeWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
        <ownedEnd xmi:id="_yPoQIeWWEd6M1cgfy9sNmg" name="dst" type="_my9YgOWWEd6M1cgfy9sNmg" association="_yPma8OWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_yPo3MeWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_yPo3MOWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
      </packagedElement>
      <packagedElement xmi:type="uml:Association" xmi:id="_zdnGMOWWEd6M1cgfy9sNmg" name="hasRegion" memberEnd="_zdnGMeWWEd6M1cgfy9sNmg _zdntQuWWEd6M1cgfy9sNmg">
        <ownedEnd xmi:id="_zdnGMeWWEd6M1cgfy9sNmg" name="src" type="_my9YgOWWEd6M1cgfy9sNmg" association="_zdnGMOWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_zdntQeWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_zdntQOWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
        <ownedEnd xmi:id="_zdntQuWWEd6M1cgfy9sNmg" name="dst" type="_n7H6cOWWEd6M1cgfy9sNmg" association="_zdnGMOWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_zdoUUOWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_zdntQ-WWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
      </packagedElement>
      <packagedElement xmi:type="uml:Association" xmi:id="_0EHskOWWEd6M1cgfy9sNmg" name="hasValue" memberEnd="_0EIToOWWEd6M1cgfy9sNmg _0EITo-WWEd6M1cgfy9sNmg">
        <ownedEnd xmi:id="_0EIToOWWEd6M1cgfy9sNmg" name="src" type="_n7H6cOWWEd6M1cgfy9sNmg" association="_0EHskOWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_0EITouWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_0EIToeWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
        <ownedEnd xmi:id="_0EITo-WWEd6M1cgfy9sNmg" name="dst" type="_rlO0sOWWEd6M1cgfy9sNmg" association="_0EHskOWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_0EI6seWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_0EI6sOWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
      </packagedElement>
      <packagedElement xmi:type="uml:Association" xmi:id="__MZokOWWEd6M1cgfy9sNmg" name="hasPart" memberEnd="__MaPoOWWEd6M1cgfy9sNmg __Ma2sOWWEd6M1cgfy9sNmg">
        <ownedEnd xmi:id="__MaPoOWWEd6M1cgfy9sNmg" name="src" type="_my9YgOWWEd6M1cgfy9sNmg" association="__MZokOWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__MaPouWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__MaPoeWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
        <ownedEnd xmi:id="__Ma2sOWWEd6M1cgfy9sNmg" name="dst" type="_my9YgOWWEd6M1cgfy9sNmg" association="__MZokOWWEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__Ma2suWWEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__Ma2seWWEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
      </packagedElement>
      <packagedElement xmi:type="uml:Association" xmi:id="_EmaaMOWXEd6M1cgfy9sNmg" name="hasPart" memberEnd="_EmbBQOWXEd6M1cgfy9sNmg _EmbBQ-WXEd6M1cgfy9sNmg">
        <ownedEnd xmi:id="_EmbBQOWXEd6M1cgfy9sNmg" name="src" type="_n7H6cOWWEd6M1cgfy9sNmg" association="_EmaaMOWXEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_EmbBQuWXEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_EmbBQeWXEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
        <ownedEnd xmi:id="_EmbBQ-WXEd6M1cgfy9sNmg" name="dst" type="_n7H6cOWWEd6M1cgfy9sNmg" association="_EmaaMOWXEd6M1cgfy9sNmg">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_EmboUeWXEd6M1cgfy9sNmg" value="1"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_EmboUOWXEd6M1cgfy9sNmg" value="1"/>
        </ownedEnd>
      </packagedElement>
      <profileApplication xmi:id="_ZOTgsOWWEd6M1cgfy9sNmg">
        <eAnnotations xmi:id="_ZO-2IOWWEd6M1cgfy9sNmg" source="http://www.eclipse.org/uml2/2.0.0/UML">
          <references xmi:type="ecore:EPackage" href="../MetaModels/OWL.profile.uml#_K1x78OWWEd6M1cgfy9sNmg"/>
        </eAnnotations>
        <appliedProfile href="../MetaModels/OWL.profile.uml#_0"/>
      </profileApplication>
    </packagedElement>
  </uml:Model>
  <OWL:owlOntology xmi:id="_brFFIOWWEd6M1cgfy9sNmg" base_Package="_-eSa0OWVEd6M1cgfy9sNmg"/>
  <OWL:owlClass xmi:id="_vEkCUOWWEd6M1cgfy9sNmg" base_Class="_ldhPkOWWEd6M1cgfy9sNmg"/>
  <OWL:owlClass xmi:id="_vpNAcOWWEd6M1cgfy9sNmg" base_Class="_my9YgOWWEd6M1cgfy9sNmg"/>
  <OWL:owlClass xmi:id="_wNBfMOWWEd6M1cgfy9sNmg" base_Class="_n7H6cOWWEd6M1cgfy9sNmg"/>
  <OWL:objectProperty xmi:id="_8Pz7oOWWEd6M1cgfy9sNmg" base_Association="_yPma8OWWEd6M1cgfy9sNmg"/>
  <OWL:objectProperty xmi:id="_9I4RoOWWEd6M1cgfy9sNmg" base_Association="_zdnGMOWWEd6M1cgfy9sNmg"/>
  <OWL:objectProperty xmi:id="_9z7ZwOWWEd6M1cgfy9sNmg" base_Association="_0EHskOWWEd6M1cgfy9sNmg"/>
  <OWL:objectProperty xmi:id="_IQb04OWXEd6M1cgfy9sNmg" base_Association="_EmaaMOWXEd6M1cgfy9sNmg"/>
  <OWL:objectProperty xmi:id="_JLM0AOWXEd6M1cgfy9sNmg" base_Association="__MZokOWWEd6M1cgfy9sNmg"/>
</xmi:XMI>


In the attachements you can find the OWL.profile.uml. its and UML profile for the OWL (Ontology Web Language) from the OMG. So it should be correct. And as far as i know working with it and ATL works.

As you can see there is a Profile applied, namely OWL.profile.uml and the href is correct relative to the .java and relative to the .uml files that uses the profile.
All i tied so far is:
- adding the file extension of profiles to the resourceSet.getPackageRegistry()
resourceSet.getPackageRegistry().put(UMLResource.PROFILE_FILE_EXTENSION, UMLPackage.eINSTANCE);
with no effect. not even a new entry in the registry.

- adding a new entry to the pathmap, but i dont really know how the first URI should look, because i cant just overwrite the entry set for UMLUMLResource.PROFILES_PATHMAP.

- last but not least i tried to load the Profile seperately, it works but has no effect on the getAppliedStereoType result. Still empty.

- I thought about just building a workaround for me, just getting the Profile-Elements by hand and crossreference them on my own, but i dont really know how to get them because in my resource they are present as
org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@72608760 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1f57ea4a (name: objectProperty) (instanceClassName: null) (abstract: false, interface: false)) (mixed: [], anyAttribute: [base_Association=_yPma8OWWEd6M1cgfy9sNmg])

What ECoreUtil.Literals.xxx for AnyTypeImpl (it doesnt work through EClass) and how to get object of a specific type out of an Resource?

I hope this additional information helps to find a solution.

Thx Stefan
Re: UML2API basics [message #503020 is a reply to message #502693] Thu, 10 December 2009 15:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Stefan,

Comments below.

Stefan wrote:
> Hi,
>
> i am currently playing around with the uml2 implementation in the emf
> project.
> as a starting point i have a UML-class-diagram with a UML-OWL-Profile
> applied. I am doing this according to the "Getting start with UML2"
> tutorial.
>
> Now i load the UML-class-diagram like this (i am doing it in a stand
> alone application just for testing at the moment, later maybe in a
> eclipse-plugin):
>
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
> UMLPackage.eINSTANCE);
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
> UMLResource.Factory.INSTANCE);
You mention opening class diagrams. Do you really mean diagram files
are just UML resources themselves.
> Map uriMap = resourceSet.getURIConverter().getURIMap();
> URI uri =
> URI.createURI(" jar:file:/C:/eclipse/plugins/org.eclipse.uml2.uml.resources_ 3.0.0.v200906011111.jar!/ ");
>
> uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
> uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
> uri.appendSegment("metamodels").appendSegment(""));
> uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
> uri.appendSegment("profiles").appendSegment(""));
>
> URI modelFile = URI.createFileURI("src/m3o-profiled.uml");
> URI profileFile = URI.createFileURI("src/OWL.profile.uml");
File URIs for relative paths sound like a bad idea. Relative
references within those files just won't resolve properly. It's best to
use absolute paths with absolute URIs.
> UMLResource modelResource =
> (UMLResource)resourceSet.getResource(modelFile, true);
> UMLResource profileResource =
> (UMLResource)resourceSet.getResource(profileFile, true);
>
>
> i can iterate over the Model and get any information i want, but i can
> get any profile information, e.g. using getAppliedStereotype on a
> Element. If i look into the .uml file of the Class-diagram i can find
> statements like this at the end.
> <OWL:owlOntology xmi:id="_vjb6UOQPEd6IJsGhqErA_g"
> base_Package="_zJBy4OQNEd6IJsGhqErA_g"/>
> and the urifragment in base_Package is corresponding to an element in
> my Class-diagram.
>
> I know maybe i should do this in ATL. But i am quite good in java and
> have no idea of ATL so i want to try this in java.
>
> Thx
>
> Stefan
>
> So what do i have to do to make getAppliedStereoType working?
Re: UML2API basics [message #503032 is a reply to message #503010] Thu, 10 December 2009 15:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Stefan,

Comments below.

Stefan wrote:
> Ok,
>
> first, wrong forum i apologize, but i wont start a new thread
> somewhere else now and unfortunately i cant move it.
> So now some more information on what i have already tried.
> First of all, i think it has something to do with the paths and their
> registration, but i cant figure out what to register where.
> Here is my .uml file i what to work with:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:OWL="http:///schemas/OWL/_K1uRkOWWEd6M1cgfy9sNmg/9"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML"
> xsi:schemaLocation="http:///schemas/OWL/_K1uRkOWWEd6M1cgfy9sNmg/9
> ../MetaModels/OWL.profile.uml#_K1x78OWWEd6M1cgfy9sNmg">
> <uml:Model xmi:id="_6I-AYeWVEd6M1cgfy9sNmg">
> <packagedElement xmi:type="uml:Package" xmi:id="_
> eSa0OWVEd6M1cgfy9sNmg" name="DataValuePattern">
> <packagedElement xmi:type="uml:Class"
> xmi:id="_ldhPkOWWEd6M1cgfy9sNmg" name="Entity"/>
> <packagedElement xmi:type="uml:Class"
> xmi:id="_my9YgOWWEd6M1cgfy9sNmg" name="Quality"/>
> <packagedElement xmi:type="uml:Class"
> xmi:id="_n7H6cOWWEd6M1cgfy9sNmg" name="Region"/>
> <packagedElement xmi:type="uml:PrimitiveType"
> xmi:id="_rlO0sOWWEd6M1cgfy9sNmg" name="Value"/>
> <packagedElement xmi:type="uml:Association"
> xmi:id="_yPma8OWWEd6M1cgfy9sNmg" name="hasQuality"
> memberEnd="_yPnpEOWWEd6M1cgfy9sNmg _yPoQIeWWEd6M1cgfy9sNmg">
> <ownedEnd xmi:id="_yPnpEOWWEd6M1cgfy9sNmg" name="src"
> type="_ldhPkOWWEd6M1cgfy9sNmg" association="_yPma8OWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_yPoQIOWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_yPnpEeWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_yPoQIeWWEd6M1cgfy9sNmg" name="dst"
> type="_my9YgOWWEd6M1cgfy9sNmg" association="_yPma8OWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_yPo3MeWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_yPo3MOWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> </packagedElement>
> <packagedElement xmi:type="uml:Association"
> xmi:id="_zdnGMOWWEd6M1cgfy9sNmg" name="hasRegion"
> memberEnd="_zdnGMeWWEd6M1cgfy9sNmg _zdntQuWWEd6M1cgfy9sNmg">
> <ownedEnd xmi:id="_zdnGMeWWEd6M1cgfy9sNmg" name="src"
> type="_my9YgOWWEd6M1cgfy9sNmg" association="_zdnGMOWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_zdntQeWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_zdntQOWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_zdntQuWWEd6M1cgfy9sNmg" name="dst"
> type="_n7H6cOWWEd6M1cgfy9sNmg" association="_zdnGMOWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_zdoUUOWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_zdntQ-WWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> </packagedElement>
> <packagedElement xmi:type="uml:Association"
> xmi:id="_0EHskOWWEd6M1cgfy9sNmg" name="hasValue"
> memberEnd="_0EIToOWWEd6M1cgfy9sNmg _0EITo-WWEd6M1cgfy9sNmg">
> <ownedEnd xmi:id="_0EIToOWWEd6M1cgfy9sNmg" name="src"
> type="_n7H6cOWWEd6M1cgfy9sNmg" association="_0EHskOWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_0EITouWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_0EIToeWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_0EITo-WWEd6M1cgfy9sNmg" name="dst"
> type="_rlO0sOWWEd6M1cgfy9sNmg" association="_0EHskOWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_0EI6seWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_0EI6sOWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> </packagedElement>
> <packagedElement xmi:type="uml:Association"
> xmi:id="__MZokOWWEd6M1cgfy9sNmg" name="hasPart"
> memberEnd="__MaPoOWWEd6M1cgfy9sNmg __Ma2sOWWEd6M1cgfy9sNmg">
> <ownedEnd xmi:id="__MaPoOWWEd6M1cgfy9sNmg" name="src"
> type="_my9YgOWWEd6M1cgfy9sNmg" association="__MZokOWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="__MaPouWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="__MaPoeWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="__Ma2sOWWEd6M1cgfy9sNmg" name="dst"
> type="_my9YgOWWEd6M1cgfy9sNmg" association="__MZokOWWEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="__Ma2suWWEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="__Ma2seWWEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> </packagedElement>
> <packagedElement xmi:type="uml:Association"
> xmi:id="_EmaaMOWXEd6M1cgfy9sNmg" name="hasPart"
> memberEnd="_EmbBQOWXEd6M1cgfy9sNmg _EmbBQ-WXEd6M1cgfy9sNmg">
> <ownedEnd xmi:id="_EmbBQOWXEd6M1cgfy9sNmg" name="src"
> type="_n7H6cOWWEd6M1cgfy9sNmg" association="_EmaaMOWXEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_EmbBQuWXEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_EmbBQeWXEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_EmbBQ-WXEd6M1cgfy9sNmg" name="dst"
> type="_n7H6cOWWEd6M1cgfy9sNmg" association="_EmaaMOWXEd6M1cgfy9sNmg">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_EmboUeWXEd6M1cgfy9sNmg" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_EmboUOWXEd6M1cgfy9sNmg" value="1"/>
> </ownedEnd>
> </packagedElement>
> <profileApplication xmi:id="_ZOTgsOWWEd6M1cgfy9sNmg">
> <eAnnotations xmi:id="_ZO-2IOWWEd6M1cgfy9sNmg"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="../MetaModels/OWL.profile.uml#_K1x78OWWEd6M1cgfy9sNmg "/>
> </eAnnotations>
> <appliedProfile href="../MetaModels/OWL.profile.uml#_0"/>
> </profileApplication>
> </packagedElement>
> </uml:Model>
> <OWL:owlOntology xmi:id="_brFFIOWWEd6M1cgfy9sNmg"
> base_Package="_-eSa0OWVEd6M1cgfy9sNmg"/>
> <OWL:owlClass xmi:id="_vEkCUOWWEd6M1cgfy9sNmg"
> base_Class="_ldhPkOWWEd6M1cgfy9sNmg"/>
> <OWL:owlClass xmi:id="_vpNAcOWWEd6M1cgfy9sNmg"
> base_Class="_my9YgOWWEd6M1cgfy9sNmg"/>
> <OWL:owlClass xmi:id="_wNBfMOWWEd6M1cgfy9sNmg"
> base_Class="_n7H6cOWWEd6M1cgfy9sNmg"/>
> <OWL:objectProperty xmi:id="_8Pz7oOWWEd6M1cgfy9sNmg"
> base_Association="_yPma8OWWEd6M1cgfy9sNmg"/>
> <OWL:objectProperty xmi:id="_9I4RoOWWEd6M1cgfy9sNmg"
> base_Association="_zdnGMOWWEd6M1cgfy9sNmg"/>
> <OWL:objectProperty xmi:id="_9z7ZwOWWEd6M1cgfy9sNmg"
> base_Association="_0EHskOWWEd6M1cgfy9sNmg"/>
> <OWL:objectProperty xmi:id="_IQb04OWXEd6M1cgfy9sNmg"
> base_Association="_EmaaMOWXEd6M1cgfy9sNmg"/>
> <OWL:objectProperty xmi:id="_JLM0AOWXEd6M1cgfy9sNmg"
> base_Association="__MZokOWWEd6M1cgfy9sNmg"/>
> </xmi:XMI>
>
>
> In the attachements you can find the OWL.profile.uml. its and UML
> profile for the OWL (Ontology Web Language) from the OMG. So it should
> be correct. And as far as i know working with it and ATL works.
>
> As you can see there is a Profile applied, namely OWL.profile.uml and
> the href is correct relative to the .java and relative to the .uml
> files that uses the profile.
Again, it's likely that using a relative path for loading the resource
is contributing to the problem.
> All i tied so far is:
> - adding the file extension of profiles to the
> resourceSet.getPackageRegistry()
> resourceSet.getPackageRegistry().put(UMLResource.PROFILE_FIL E_EXTENSION,
> UMLPackage.eINSTANCE);
I don't know why the profile extension would need to be registered as if
it were a package namespace.
> with no effect. not even a new entry in the registry.
>
> - adding a new entry to the pathmap, but i dont really know how the
> first URI should look, because i cant just overwrite the entry set for
> UMLUMLResource.PROFILES_PATHMAP.
>
> - last but not least i tried to load the Profile seperately, it works
> but has no effect on the getAppliedStereoType result. Still empty.
>
> - I thought about just building a workaround for me, just getting the
> Profile-Elements by hand and crossreference them on my own, but i dont
> really know how to get them because in my resource they are present as
> org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@72608760 (eClass:
> org.eclipse.emf.ecore.impl.EClassImpl@1f57ea4a (name: objectProperty)
> (instanceClassName: null) (abstract: false, interface: false)) (mixed:
> [], anyAttribute: [base_Association=_yPma8OWWEd6M1cgfy9sNmg])
> What ECoreUtil.Literals.xxx for AnyTypeImpl (it doesnt work through
> EClass) and how to get object of a specific type out of an Resource?
That sounds like what would happen if the data isn't being recognized as
conforming to a specific model.
>
> I hope this additional information helps to find a solution.
It's of course best to ask on the UML2 newsgroup.
>
> Thx Stefan
Re: UML2API basics [message #503038 is a reply to message #503020] Thu, 10 December 2009 16:20 Go to previous messageGo to next message
Stefan  is currently offline Stefan
Messages: 13
Registered: October 2009
Junior Member
That diagram thing was just a misunderstanding. But the Path issue works perfect for me. Maybe someone should put this into the standalone faq

thx you so much, tried this for two days.

Stefan
Re: UML2API basics [message #600620 is a reply to message #503020] Thu, 10 December 2009 16:20 Go to previous message
Stefan  is currently offline Stefan
Messages: 13
Registered: October 2009
Junior Member
That diagram thing was just a misunderstanding. But the Path issue works perfect for me. Maybe someone should put this into the standalone faq

thx you so much, tried this for two days.

Stefan
Previous Topic:UML2API basics
Next Topic:Survey on the application of UML in the maintainence of legacy systems.
Goto Forum:
  


Current Time: Sat Oct 25 00:54:52 GMT 2014

Powered by FUDForum. Page generated in 0.01944 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software