Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] Unrecognized variable("unrecognized variable" error occures in simpel transformation mapping)
[QVTo] Unrecognized variable [message #499634] Mon, 23 November 2009 15:15 Go to next message
C. Kopf is currently offline C. KopfFriend
Messages: 37
Registered: November 2009
Member
Hello again,

I have now written several examples for using QVTo.

But another problem occures:
In the Code below the Model-Element ARPart is marked as "Unrecognized variable". It is defined in the metamodel which is directly placed at the platform location.
Other errors shown here are:
- Cannot find operation (objectsOfType(Invalid)) for the type (ARSEP)
- Mapping operation expected
- Cannot find operation (arpackage2module()) neither for the type (Set(OclVoid)) nor for its element type (OclVoid)

I think these three are following errors, which only occure because of the main problem, stated above.

modeltype ARSEP uses Arsep3('http://as3.org/3.1.1');
modeltype oCTp uses oCTp5metamodel('http://www.svc17.de/compiler/octp5.ecore');


transformation ArsepToOctp5(in arsep : ARSEP, out octp : OCTP);

main() {
	arsep.objectsOfType(ARPart)->map arpackage2module();
}
// ...



Does anyone have an idea of what is wrong here. To me it seems, that qvto does not interpret ARPart as an modelelement of ARSEP3. but why, and how to solve this?

And just as an additiv question: Is there any documentation of thje QVTo-Tool other than the QVT-specification of OMG?


Thank again for your help!
Re: [QVTo] Unrecognized variable [message #499672 is a reply to message #499634] Mon, 23 November 2009 16:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Christian,

The 'ARPart' is not resolved as a type in the scope of your declared model
types.
Please, double-check that this type is defined in the 'Arsep3' package
that you reference in the 'ARSEP' modeltype.

The only doc available is http://www.eclipse.org/m2m/qvto/doc/M2M-QVTO.pdf,
giving more concise overview of QVTO then the OMG spec.

Contributions in this area are welcome ;-)
Do you plan to contribute your examples to QVTO?

Regards,
/Radek


On Mon, 23 Nov 2009 16:15:22 +0100, C. Kopf
<christian.kopf@fokus.fraunhofer.de> wrote:

> Hello again,
>
> I have now written several examples for using QVTo.
>
> But another problem occures:
> In the Code below the Model-Element ARPart is marked as "Unrecognized
> variable". It is defined in the metamodel which is directly placed at
> the platform location.
> Other errors shown here are:
> - Cannot find operation (objectsOfType(Invalid)) for the type (ARSEP)
> - Mapping operation expected
> - Cannot find operation (arpackage2module()) neither for the type
> (Set(OclVoid)) nor for its element type (OclVoid)
>
> I think these three are following errors, which only occure because of
> the main problem, stated above.
>
>
> modeltype ARSEP uses Arsep3('http://as3.org/3.1.1');
> modeltype oCTp uses
> oCTp5metamodel('http://www.svc17.de/compiler/octp5.ecore');
>
>
> transformation ArsepToOctp5(in arsep : ARSEP, out octp : OCTP);
>
> main() {
> arsep.objectsOfType(ARPart)->map arpackage2module();
> }
> // ...
>
>
>
> Does anyone have an idea of what is wrong here. To me it seems, that
> qvto does not interpret ARPart as an modelelement of ARSEP3. but why,
> and how to solve this?
>
> And just as an additiv question: Is there any documentation of thje
> QVTo-Tool other than the QVT-specification of OMG?
>
>
> Thank again for your help!
Re: [QVTo] Unrecognized variable [message #499805 is a reply to message #499672] Tue, 24 November 2009 09:11 Go to previous messageGo to next message
C. Kopf is currently offline C. KopfFriend
Messages: 37
Registered: November 2009
Member
Hi Radek,

I will now check the ecore models in a text editor. I have also tried to use other elements of the Arsep3 package. Always the same, so I wonder wether there is an issue with the way i reffered to the package?! The URI is the one specified in the ecore model and shown in the metamodel explorer. I compared everything to the simpleUMLtoRDB-Example but I did not find a differenc yet. So lets see what may be found using a text-editor.

Well, actually I do not see a problem in contributing some of my results to QVTO. But I would prever to do this with a bigger one, for example the ArsepToOctp5 transformation. It will still take some time untill this will be finished, but when its done, well why not contributing it as an additive example, probably with a short How-To-Start. I am looking forward to it.
Re: [QVTo] Unrecognized variable [message #499837 is a reply to message #499805] Tue, 24 November 2009 10:51 Go to previous messageGo to next message
C. Kopf is currently offline C. KopfFriend
Messages: 37
Registered: November 2009
Member
Well I found out the following:

The ecore model as is has several subpackages and a total "package-nesting-level" > 4.
Arrow
When using the same ecore-metamodel from the workspace location I can reach the element the way:

ARSEP::genericstructure::infrastructure::arsep::ARPart


Exclamation
the same does not work, when using the same ecore model from platform location. (I need it that way, because my tranformation should use the ecore model of an already existing eclipse-plugin.)
In the metamodel-explorer the URI of the element is shown in brackets (Arsep3.genericstructure.infrastructure.arsep.ARPart) but the subpackage structure is not shown anymore for the ecore metamodel at platform. (and the other way around for the same ecore model at workspace location)

Question
So the question is, how can I refer to the element (ARPart) when using the metamodel at the platform?

Thanks again for your help!

Chris

[Updated on: Tue, 24 November 2009 10:53]

Report message to a moderator

Re: [QVTo] Unrecognized variable [message #499853 is a reply to message #499837] Tue, 24 November 2009 11:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Chris,

Comments below.

Regards,
/Radek


On Tue, 24 Nov 2009 11:51:32 +0100, C. Kopf
<christian.kopf@fokus.fraunhofer.de> wrote:

> Well I found out the following:
>
> The ecore model as is has several subpackages and a total
> "package-nesting-level" > 4.
> :arrow: When using the same ecore-metamodel from the workspace location
> I can reach the element the way:
>
> ARSEP::genericstructure::infrastructure::arsep::ARPart

In general, nested packages in EMF is not the best idea, try to
search for what the EMF folks have said about that ;)

When resolving qualified name using modeltype, the rest of the name path
is resolved against the package the modeltype declaration refers to.
You say you have 4 level nesting, so use
ARSEP::infrastructure::arsep::ARPart

Note, you can declare a model type for any package in the hierarchy, like

modeltype INFRA uses "specific uri for 'infrastructure' package".

This could help in reducing verbosity of your type references.

>
> :!: the same does not work, when using the same ecore model from
> platform location. (I need it that way, because my tranformation should
> use the ecore model of an already existing eclipse-plugin.)
> In the metamodel-explorer the URI of the element is shown in brackets
> (Arsep3.genericstructure.infrastructure.arsep.ARPart) but the subpackage
> structure is not shown anymore for the ecorer metamodel at platform.
>

Well, EMF does not generate Java code for empty packages so unless the
generated
subpackages custom modify its initialization code to refer to a dummy
parent package
(as OCL, QVT metamnodels do), the browser has no idea about them as they do
not get into the global registry.
If the package is loaded from an ecore file the hierarchical relationship
is clearly there.

> :?: So the question is, how can I refer to the element (ARPart) when
> using the metamodel at the platform?
>
> Thanks again for your help!
>
> Chris
>
>
Re: [QVTo] Unrecognized variable [message #499881 is a reply to message #499853] Tue, 24 November 2009 13:16 Go to previous messageGo to next message
C. Kopf is currently offline C. KopfFriend
Messages: 37
Registered: November 2009
Member
Hi radek,

thanks again for your help, comments below again.

Eclipse User wrote on Tue, 24 November 2009 06:34
Originally posted by: dvorak.radek.gmail.com

Hi Chris,

Comments below.

Regards,
/Radek


On Tue, 24 Nov 2009 11:51:32 +0100, C. Kopf
<christian.kopf@fokus.fraunhofer.de> wrote:

> Well I found out the following:
>
> The ecore model as is has several subpackages and a total
> "package-nesting-level" > 4.
> Arrow When using the same ecore-metamodel from the workspace location
> I can reach the element the way:
>
> ARSEP::genericstructure::infrastructure::arsep::ARPart

In general, nested packages in EMF is not the best idea, try to
search for what the EMF folks have said about that Wink


Well i got that. Probably I should first of all use a different name for ist Wink "hierarchy-depth", sorry!
I do not get the permission to change the ecoremodel.
Quote:

When resolving qualified name using modeltype, the rest of the name path
is resolved against the package the modeltype declaration refers to.
You say you have 4 level nesting, so use
ARSEP::infrastructure::arsep::ARPart


Well i meant the hierarchy-depth is more than 4 ( > ) - dont mind.
Quote:

Note, you can declare a model type for any package in the hierarchy, like

modeltype INFRA uses "specific uri for 'infrastructure' package".

This could help in reducing verbosity of your type references.


That works, but only when using the metamodel from the platform, which is actually what I want, so this is fine so far. But is there no simple way to address the element? in my ecore model more than 40 (sub)packages exist, do I really need to specify a modeltype for each?
Quote:

>
> Exclamation the same does not work, when using the same ecore model from
> platform location. (I need it that way, because my tranformation should
> use the ecore model of an already existing eclipse-plugin.)
> In the metamodel-explorer the URI of the element is shown in brackets
> (Arsep3.genericstructure.infrastructure.arsep.ARPart) but the subpackage
> structure is not shown anymore for the ecorer metamodel at platform.
>

Well, EMF does not generate Java code for empty packages so unless the
generated
subpackages custom modify its initialization code to refer to a dummy
parent package
(as OCL, QVT metamnodels do), the browser has no idea about them as they do
not get into the global registry.
If the package is loaded from an ecore file the hierarchical relationship
is clearly there.

> Question So the question is, how can I refer to the element (ARPart) when
> using the metamodel at the platform?
>
> Thanks again for your help!
>
> Chris
>
>



well let me add some of the code, probably that'll make things clearer.

modeltype ARSEP uses Arsep3('http://as3.org/3.1.1');
modeltype oCTp uses oCTp5metamodel('http://www.svc17.de/compiler/octp5.ecore');


transformation ArsepToOctp5(in arsep : ARSEP, out octp : OCTP);

main() {
	arsep.objectsOfType(ARPart)->map arpackage2module();
}
// ...

Changing ARPart into ARSEP::genericstructure::infrastructure::arsep::ARPart did not help as said. It is still marked as "unrecognized variable".



and the part of the ecore file (as I mentioned above the file as is, is much bigger, with more than 40 subpackages included):

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<ecore:EPackage name="ARSEP" nsURI="http://as3.org/3.1.1" nsPrefix="ar">
<eSubpackages name="genericstructure" nsURI="http://as3.org/3.1.1/gs" nsPrefix="ar">
  <eSubpackages name="infrastructure" nsURI="http://as3.org/3.1.1/gs/i" nsPrefix="ar">
   <eSubpackages name="arsep" nsURI="http://as3.org/3.1.1/gs/i/a" nsPrefix="ar">
	<eClassifiers xsi:type="ecore:EClass" name="ARPart">
            <eAnnotations source="Stereotype">
                <details key="Stereotype" value="splitable"/>
            </eAnnotations>
            <eStructuralFeatures xsi:type="ecore:EReference" name="subPackages" upperBound="-1"
                 containment="true">
<!-- ... -->
              <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
                <details key="documentation" value="Contained sub packages."/>
              </eAnnotations>
              <eAnnotations source="Stereotype">
                <details key="Stereotype" value="splitable"/>
              </eAnnotations>
            </eStructuralFeatures>
	</eClassifiers>
  </eSubpackages>
 </eSubpackages>
</eSubpackages>
</ecore:EPackage>
</xmi:XMI>


In the Metamodel-Explorer-View this part is shown (in platform) as follows:

- platform
....- Arsep
........- ARPart [arsep.genericstructure.infrastructure.arsep.ARPart]



Thanks a lot for your help and sorry for bothering you again!

[Updated on: Tue, 24 November 2009 13:39]

Report message to a moderator

Re: [QVTo] Unrecognized variable [message #499960 is a reply to message #499881] Tue, 24 November 2009 15:12 Go to previous message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Chris,

Referring to your previous post, saying

>> When using the same ecore-metamodel from the workspace location I can
>> reach the element the way:
>> ARSEP::genericstructure::infrastructure::arsep::ARPart
>> :!: the same does not work, when using the same ecore model from
>> platform location. (I need it that way, because my tranformation should
>> use the ecore model of an already existing eclipse-plugin.)
>> In the metamodel-explorer the URI of the element is shown in brackets
>> (Arsep3.genericstructure.infrastructure.arsep.ARPart) but the
>> subpackage structure is not shown anymore for the ecorer metamodel at
>> platform.

Check please if the root package in your ecore file contains any
EClassifiers.
As I have mentioned, empty packages (not counting its subpackages) do not
have a generated Java package populated into package registry in the
running
platform.

That is most likely the reason why you have different resolution in
worskpace vs. platform.

Type references can be qualified - <modeltype>::<p1>::..::<pn>, where <p1>
is a
subpackage of the modeltype referenced package.

or simple - just a simple type name resolved with the scope of packages
referenced by declared
modeltypes. Though the spec says packages should be searched recursively,
the implementation
does not do that, a known issue. Raise an SCR if it's essential for you.


Regards,
/Radek


On Tue, 24 Nov 2009 14:16:45 +0100, C. Kopf
<christian.kopf@fokus.fraunhofer.de> wrote:

> Hi radek,
>
> thanks again for your help, comments below again.
>
> Eclipse User wrote on Tue, 24 November 2009 06:34
>> Originally posted by: dvorak.radek.gmail.com
>> Hi Chris,
>> Comments below.
>> Regards,
>> /Radek
>> On Tue, 24 Nov 2009 11:51:32 +0100, C. Kopf
>> <christian.kopf@fokus.fraunhofer.de> wrote:
>> > Well I found out the following:
>> >
>> > The ecore model as is has several subpackages and a total >
>> "package-nesting-level" > 4.
>> > :arrow: When using the same ecore-metamodel from the workspace
>> location > I can reach the element the way:
>> >
>> > ARSEP::genericstructure::infrastructure::arsep::ARPart
>> In general, nested packages in EMF is not the best idea, try to
>> search for what the EMF folks have said about that ;)
>> Well i got that. Probably I should first of all use a different name
>> for ist ;) "hierarchy-depth", sorry!
>> I do not get the permission to change the ecoremodel.
>> When resolving qualified name using modeltype, the rest of the name
>> path
>> is resolved against the package the modeltype declaration refers to.
>> You say you have 4 level nesting, so use
>> ARSEP::infrastructure::arsep::ARPart
>
> Well i meant the hierarchy-depth is more than 4 ( > ) - dont mind.
> Quote:
>> Note, you can declare a model type for any package in the hierarchy,
>> like
>> modeltype INFRA uses "specific uri for 'infrastructure' package".
>> This could help in reducing verbosity of your type references.
>
> That works, but only when using the metamodel from the platform, which
> is actually what I want, so this is fine so far. But is there no simple
> way to address the element? in my ecore model more than 40 (sub)packages
> exist, do I really need to specify a modeltype for each?
> Quote:
>> >
>> > :!: the same does not work, when using the same ecore model from >
>> platform location. (I need it that way, because my tranformation
>> should > use the ecore model of an already existing eclipse-plugin.)
>> > In the metamodel-explorer the URI of the element is shown in
>> brackets > (Arsep3.genericstructure.infrastructure.arsep.ARPart) but
>> the subpackage > structure is not shown anymore for the ecorer
>> metamodel at platform.
>> >
>> Well, EMF does not generate Java code for empty packages so unless
>> the generated
>> subpackages custom modify its initialization code to refer to a dummy
>> parent package
>> (as OCL, QVT metamnodels do), the browser has no idea about them as
>> they do
>> not get into the global registry.
>> If the package is loaded from an ecore file the hierarchical
>> relationship is clearly there.
>> > :?: So the question is, how can I refer to the element (ARPart)
>> when > using the metamodel at the platform?
>> >
>> > Thanks again for your help!
>> >
>> > Chris
>> >
>> >
>
>
>
> well let me add some of the code, probably that'll make things clearer.
>
> modeltype ARSEP uses Arsep3('http://as3.org/3.1.1');
> modeltype oCTp uses
> oCTp5metamodel('http://www.svc17.de/compiler/octp5.ecore');
>
>
> transformation ArsepToOctp5(in arsep : ARSEP, out octp : OCTP);
>
> main() {
> arsep.objectsOfType(ARPart)->map arpackage2module();
> }
> // ...
> Changing ARPart into
> ARSEP::genericstructure::infrastructure::arsep::ARPart did not help as
> said. It is still marked as "unrecognized variable".
>
>
>
> and the part of the ecore file (as I mentioned above the file as is, is
> much bigger, with more than 40 subpackages included):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
> <ecore:EPackage name="ARSEP" nsURI="http://as3.org/3.1.1" nsPrefix="ar">
> <eSubpackages name="genericstructure" nsURI="http://as3.org/3.1.1/gs"
> nsPrefix="ar">
> <eSubpackages name="infrastructure" nsURI="http://as3.org/3.1.1/gs/i"
> nsPrefix="ar">
> <eSubpackages name="arsep" nsURI="http://as3.org/3.1.1/gs/i/a"
> nsPrefix="ar">
> <eClassifiers xsi:type="ecore:EClass" name="ARPart">
> <eAnnotations source="Stereotype">
> <details key="Stereotype" value="splitable"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference"
> name="subPackages" upperBound="-1"
> containment="true">
> <!-- ... -->
> <eAnnotations
> source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="Contained sub
> packages."/>
> </eAnnotations>
> <eAnnotations source="Stereotype">
> <details key="Stereotype" value="splitable"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </eSubpackages>
> </eSubpackages>
> </eSubpackages>
> </ecore:EPackage>
> </xmi:XMI>
>
> In the Metamodel-Explorer-View this part is shown (in platform) as
> follows:
>
> - platform
> - Arsep
> - ARPart [arsep.genericstructure.infrastructure.arsep.ARPart]
>
>
>
> Thanks a lot for your help and sorry for bothering you again!
Previous Topic:How ATL is different from Xtend
Next Topic:[QVTO] mapping to a set, adding to result does not work
Goto Forum:
  


Current Time: Tue Oct 22 21:57:15 GMT 2019

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

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

Back to the top