Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the property{0}(QVTo, Relationships, ATL, SemanticUtil_8, Error)
[QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the property{0} [message #719373] Fri, 26 August 2011 20:48 Go to next message
n_uu_b Missing name is currently offline n_uu_b Missing nameFriend
Messages: 5
Registered: August 2011
Junior Member
Hi everybody,

I'm a beginner in QVTo and I made a transformation in ATL (Concept to UML).
But when I wrote this same transformation in QVTo I had an error in a relationship 'concept'.

-> Code in ATL
create OUT : Concept from IN : Uml;
...
rule Attribute2Property {
	from attribute : Uml!Property
	to property : Concept!Property 
	(
		name <- attribute.name,
		concept <- attribute.owner
	)
}


-> Code in QVTo
modeltype UML uses uml(eclipse.org/uml2/3.0.0/UML');
...
main() {
	Uml.objectsOfType(Property) -> map Attribute2PropertyC();
}
...
mapping Property::Attribute2PropertyC() : PropertyC {
	name := self.name;
	concept := self.owner; //This line has a error
}


The error is The type 'uml::Element' does not conform to the type 'pimconcept::Concept' of the property 'concept' and the one happens when I write transformation code for relationships.

Please, How can I solve this problem? Does ATL work differently of QVTo in relationships? What's the correct sintax to write this transformation?
I'll be really grateful if anyone can help me.
Thanks.
  • Attachment: Concept.jpg
    (Size: 37.10KB, Downloaded 315 times)
Re: [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the propert [message #719439 is a reply to message #719373] Sat, 27 August 2011 06:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

QVTo is primarily imperative (with a surprisingly declarative style).
[QVTr is declarative but lacking in good implementations.]
ATL is primarily declarative with optional imperative capabilities

so there is a fundamental difference in principle; declarative is often
more abstract/obscure; imperative is often more direct/explicit.

You haven't provided your meta-models, so I have to guess a bit

name := self.name;

is probably a String to String mapping, and so as a PrimitiveType, the
same value can be used untransformed for both input and output.

concept := self.owner; //This line has a error

is probably a Concept::Object to Uml::Object mapping and so needs to be
transformed. I've never found an ATL definition that enables me to
predict how the mapping occurs automatically, but I presume it does.
QVTo has a definition, but you need to be quite astute to read between
the inconsistencies and ambiguities. QVTo requires you to invoke a
mapping explicitly as you have already done for the child descent using
'map Attribute2PropertyC()'. If 'owner' is a parent you can avoid losing
the mapping by passing it as an argument to the nested mapping.
Otherwise you can use one of the 'resolve' helpers to recover the
mapping from the trace data.

Regards

Ed Willink


On 26/08/2011 21:48, n_uu_b wrote:
> Hi everybody,
>
> I'm a beginner in QVTo and I made a transformation in ATL (Concept to UML).
> But when I wrote this same transformation in QVTo I had an error in a relationship 'concept'.
>
> -> Code in ATL
>
> create OUT : Concept from IN : Uml;
> ..
> rule Attribute2Property {
> from attribute : Uml!Property
> to property : Concept!Property
> (
> name<- attribute.name,
> concept<- attribute.owner
> )
> }
>
>
> -> Code in QVTo
>
> modeltype UML uses uml(eclipse.org/uml2/3.0.0/UML');
> ..
> main() {
> Uml.objectsOfType(Property) -> map Attribute2PropertyC();
> }
> ..
> mapping Property::Attribute2PropertyC() : PropertyC {
> name := self.name;
> concept := self.owner; //This line has a error
> }
>
>
> The error is The type 'uml::Element' does not conform to the type 'pimconcept::Concept' of the property 'concept' and the one happens when I write transformation code for relationships.
>
> Please, How can I solve this problem? Does ATL work differently of QVTo in relationships? What's the correct sintax to write this transformation?
> I'll be really grateful if anyone can help me.
> Thanks.
Re: [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the propert [message #719552 is a reply to message #719439] Sat, 27 August 2011 19:07 Go to previous messageGo to next message
n_uu_b Missing name is currently offline n_uu_b Missing nameFriend
Messages: 5
Registered: August 2011
Junior Member
Hello,

First of all, Thanks Edward for your great answer.
And second I need to correct an error that I did. The transformation is Uml2Concept and not Concept2Uml how I said.

Well, now I want to understand more about what you said.
"QVTo requires you to invoke a mapping explicitly as you have already done for the child descent using 'map Attribute2PropertyC()'".
This means that I need to create a new mapping like Element2Concept(), and put it in concept := self.owner -> Element2Concept(); Is it?

"Otherwise you can use one of the 'resolve' helpers to recover the mapping from the trace data".
And here you told something like that concept := self.owner.resolveone(Concept); Am I correct?

Metamodels
Uml eclipse.org/uml2/3.0.0/UML
Concept s3.postimage.org/9ejxh0qe2/Concept.jpgs3.postimage.org/9ejxh0qe2/Concept.jpg

Thanks again.
Re: [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the propert [message #719631 is a reply to message #719552] Sun, 28 August 2011 05:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

Your suggestions are distinctly plausible, but I'm not a sufficiently
expert QVTo user to say that they're correct.

Regards

Ed Willink

On 27/08/2011 20:07, n_uu_b wrote:
> Hello,
>
> First of all, Thanks Edward for your great answer.
> And second I need to correct an error that I did. The transformation
> is Uml2Concept and not Concept2Uml how I said.
>
> Well, now I want to understand more about what you said.
> "QVTo requires you to invoke a mapping explicitly as you have already
> done for the child descent using 'map Attribute2PropertyC()'".
> This means that I need to create a new mapping like Element2Concept(),
> and put it in concept := self.owner -> Element2Concept(); Is it?
>
> "Otherwise you can use one of the 'resolve' helpers to recover the
> mapping from the trace data".
> And here you told something like that concept :=
> self.owner.resolveone(Concept); Am I correct?
>
> Metamodels
> Uml eclipse.org/uml2/3.0.0/UML
> Concept s3.postimage.org/9ejxh0qe2/Concept.jpg
>
> Thanks again.
Re: [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the propert [message #719632 is a reply to message #719552] Sun, 28 August 2011 05:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

Your suggestions are distinctly plausible, but I'm not a sufficiently
expert QVTo user to say that they're correct.

Regards

Ed Willink

On 27/08/2011 20:07, n_uu_b wrote:
> Hello,
>
> First of all, Thanks Edward for your great answer.
> And second I need to correct an error that I did. The transformation
> is Uml2Concept and not Concept2Uml how I said.
>
> Well, now I want to understand more about what you said.
> "QVTo requires you to invoke a mapping explicitly as you have already
> done for the child descent using 'map Attribute2PropertyC()'".
> This means that I need to create a new mapping like Element2Concept(),
> and put it in concept := self.owner -> Element2Concept(); Is it?
>
> "Otherwise you can use one of the 'resolve' helpers to recover the
> mapping from the trace data".
> And here you told something like that concept :=
> self.owner.resolveone(Concept); Am I correct?
>
> Metamodels
> Uml eclipse.org/uml2/3.0.0/UML
> Concept s3.postimage.org/9ejxh0qe2/Concept.jpg
>
> Thanks again.
Re: [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the propert [message #719637 is a reply to message #719552] Sun, 28 August 2011 05:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

Your suggestions are distinctly plausible, but I'm not a sufficiently
expert QVTo user to say that they're correct.

Regards

Ed Willink

On 27/08/2011 20:07, n_uu_b wrote:
> Hello,
>
> First of all, Thanks Edward for your great answer.
> And second I need to correct an error that I did. The transformation
> is Uml2Concept and not Concept2Uml how I said.
>
> Well, now I want to understand more about what you said.
> "QVTo requires you to invoke a mapping explicitly as you have already
> done for the child descent using 'map Attribute2PropertyC()'".
> This means that I need to create a new mapping like Element2Concept(),
> and put it in concept := self.owner -> Element2Concept(); Is it?
>
> "Otherwise you can use one of the 'resolve' helpers to recover the
> mapping from the trace data".
> And here you told something like that concept :=
> self.owner.resolveone(Concept); Am I correct?
>
> Metamodels
> Uml eclipse.org/uml2/3.0.0/UML
> Concept s3.postimage.org/9ejxh0qe2/Concept.jpg
>
> Thanks again.
Re: [QVTo] - Relationships (ATL2QVTo) - The type {2} does not conform to the type {1} of the propert [message #719746 is a reply to message #719631] Sun, 28 August 2011 18:30 Go to previous message
n_uu_b Missing name is currently offline n_uu_b Missing nameFriend
Messages: 5
Registered: August 2011
Junior Member
Hi,

I'm trying to make tests with my conclusions about what you said and I've removed the errors using the 'resolve', but I'll see if the PSMs generated are correct comparing the XMIs generated by transformations in ATL and QVT.

Thank you very much for your attention.
Previous Topic:org.eclipse.m2m.internal.qvt.oml.emf.util.EmfException
Next Topic:How to give reference of Metamodel in workspace in QVT
Goto Forum:
  


Current Time: Wed Dec 11 00:32:50 GMT 2024

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

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

Back to the top