Home » Archived » M2M (model-to-model transformation) » [QVTo] Unrecognized variable("unrecognized variable" error occures in simpel transformation mapping)
|
Re: [QVTo] Unrecognized variable [message #499672 is a reply to message #499634] |
Mon, 23 November 2009 16:12 |
Eclipse User |
|
|
|
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 #499853 is a reply to message #499837] |
Tue, 24 November 2009 11:34 |
Eclipse User |
|
|
|
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 |
C. Kopf 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.
> 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.
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: |
>
> 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!
[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 |
Eclipse User |
|
|
|
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!
|
|
|
Goto Forum:
Current Time: Wed Apr 24 22:18:23 GMT 2024
Powered by FUDForum. Page generated in 0.03568 seconds
|