Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Can QVTO handle ecore models with extended metadata?
[QVTO] Can QVTO handle ecore models with extended metadata? [message #500190] Wed, 25 November 2009 10:02 Go to next message
No real name is currently offline No real nameFriend
Messages: 8
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------080602090809090307050300
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hello,
in the thread you can find at these links:
news://news.eclipse.org:119/hdu7jl$t1r$1@build.eclipse.org
http://www.eclipse.org/forums/index.php?S=6c565de225f39d0cfd 95316e6b67a05a&t=msg&goto=498553

a problem is described when trying to transform a model with ATL. The
problem seems to be that ecore metamodel contains extended metadata and
ATL does not seem to be able to handle extended metadata. I had this
problem, too, so i tried to use QVTO for transformation.

I tested a simple example, but i get an error here, too. I created a
simple xml schema and created a ecore model from this xml schema. In
this ecore model extended metadata is used to create the correct names
of the attributes in the xml files, since the attributes are called
differently in the schema and in the ecore file.

When i try a very simple transformation on a model created with the
ecore editor i get the following error:
org.eclipse.m2m.internal.qvt.oml.emf.util.EmfException: Failed to save
model to platform:/resource/Foo/FooTransformation.schema

Since i don't have much experience with QVTO i am not sure, if it is
because of the extended metadata, but using the same transformation on a
model without extended metadata did not lead to an error.

I attached the xml schema, the ecore model created from the schema and
the qvto transformation.

Is there anyone who successfully did a transormation on models, where
the metamodel contained extended metadata?

Klaus

--------------080602090809090307050300
Content-Type: text/xml;
name="foo.xsd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="foo.xsd"

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:foo="http://www.foo.com/fooSchema"
targetNamespace="http://www.foo.com/fooSchema">
<xs:element name="FOO_container" type="foo:FOO_container" />
<xs:complexType name="FOO_container">
<xs:sequence>
<xs:element name="Id" type="xs:string" />
<xs:element name="Container" type="foo:FOO_container"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required" />
</xs:complexType>
</xs:schema>


--------------080602090809090307050300
Content-Type: text/xml;
name="schema.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="schema.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage 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" name="schema"
nsURI="http://www.foo.com/fooSchema" nsPrefix="schema">
<eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=""/>
<details key="kind" value="mixed"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="elementWildcard"/>
<details key="name" value=":mixed"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"
transient="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="xmlns:prefix"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"
transient="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="xsi:schemaLocation"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="fOOContainer" upperBound="-2"
eType="#//FOOContainer" volatile="true" transient="true" derived="true" containment="true"
resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="FOO_container"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FOOContainer">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="FOO_container"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="Id"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="container" lowerBound="1"
eType="#//FOOContainer" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="Container"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id1" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//ID"
iD="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="id"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>


--------------080602090809090307050300
Content-Type: text/plain;
name="FooTransformation.qvto"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="FooTransformation.qvto"

bW9kZWx0eXBlIHNjaGVtYSB1c2VzIHNjaGVtYSgnaHR0cDovL3d3dy5mb28u Y29tL2Zvb1Nj
aGVtYScpIDsKCnRyYW5zZm9ybWF0aW9uIEZvb1RyYW5zZm9ybWF0aW9uKGlu IGZvb0luIDog
c2NoZW1hLCBvdXQgZm9vT3V0IDogc2NoZW1hKTsKCm1haW4oKSB7Cglmb29J bi5yb290T2Jq
ZWN0cygpW0ZPT0NvbnRhaW5lcl0gLT4gbWFwIGRvU3R1ZmYoKTsKfQoKbWFw cGluZyBzY2hl
bWE6OkZPT0NvbnRhaW5lcjo6ZG9TdHVmZigpIDogc2NoZW1hOjpGT09Db250 YWluZXJ7Cglp
ZCA6PSBzZWxmLmlkOwp9
--------------080602090809090307050300--
Re: [QVTO] Can QVTO handle ecore models with extended metadata? [message #500351 is a reply to message #500190] Wed, 25 November 2009 18:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Klaus,

We do not handle ExtendedData in any special way, we rely on what EMF
does ;).
However, it should work, if I got it right your concern is to
serialize, deserialize your models as plain XML based on your schema, while
being able to manipulate your data in QVTO as models.

First, your metamodel needs to be generated as Java and deployed in
platform.
Note, we still have to add some extra processing to make this working with
dynamic models.

There is an example on this topic,
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.qvt.oml/examples/org.eclipse.m2m.qvt.oml.econ20 09.tutorial/projects/qvto.Uml2Xhtml/transforms/Uml2Xhtml_vfi nal.qvto?root=Modeling_Project&sortdir=down&view=mar kup

just checkout the whole project and note the usage of DocumentRoot in the
output model.

Regards,
/Radek


On Wed, 25 Nov 2009 11:02:02 +0100, Klaus Simon <busta_k@gmx.de> wrote:

> Hello,
> in the thread you can find at these links:
> news://news.eclipse.org:119/hdu7jl$t1r$1@build.eclipse.org
> http://www.eclipse.org/forums/index.php?S=6c565de225f39d0cfd 95316e6b67a05a&t=msg&goto=498553
>
> a problem is described when trying to transform a model with ATL. The
> problem seems to be that ecore metamodel contains extended metadata and
> ATL does not seem to be able to handle extended metadata. I had this
> problem, too, so i tried to use QVTO for transformation.
>
> I tested a simple example, but i get an error here, too. I created a
> simple xml schema and created a ecore model from this xml schema. In
> this ecore model extended metadata is used to create the correct names
> of the attributes in the xml files, since the attributes are called
> differently in the schema and in the ecore file.
>
> When i try a very simple transformation on a model created with the
> ecore editor i get the following error:
> org.eclipse.m2m.internal.qvt.oml.emf.util.EmfException: Failed to save
> model to platform:/resource/Foo/FooTransformation.schema
>
> Since i don't have much experience with QVTO i am not sure, if it is
> because of the extended metadata, but using the same transformation on a
> model without extended metadata did not lead to an error.
>
> I attached the xml schema, the ecore model created from the schema and
> the qvto transformation.
>
> Is there anyone who successfully did a transormation on models, where
> the metamodel contained extended metadata?
>
> Klaus
Re: [QVTO] Can QVTO handle ecore models with extended metadata? [message #500485 is a reply to message #500351] Thu, 26 November 2009 10:38 Go to previous message
No real name is currently offline No real nameFriend
Messages: 8
Registered: July 2009
Junior Member
Hello Radek,

i just made another test, and it seems to work :-).

What i want to do : I have a program where i do some calculations on a
model based on a self-developed ecore-metamodel. I want to be able to
export this model as a xml-file which conforms to a given xml schema. I
could do this with a xsl transformation on the serialized file. But it
would be nicer to create an ecore-metamodel from that schema and do the
transformation on the model. Seems like i can do that with QVTo.

Thanks for your answer and best regards,
Klaus



radek dvorak schrieb:
> Hi Klaus,
>
> We do not handle ExtendedData in any special way, we rely on what EMF
> does ;).
> However, it should work, if I got it right your concern is to
> serialize, deserialize your models as plain XML based on your schema, while
> being able to manipulate your data in QVTO as models.
>
> First, your metamodel needs to be generated as Java and deployed in
> platform.
> Note, we still have to add some extra processing to make this working
> with dynamic models.
>
> There is an example on this topic,
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.qvt.oml/examples/org.eclipse.m2m.qvt.oml.econ20 09.tutorial/projects/qvto.Uml2Xhtml/transforms/Uml2Xhtml_vfi nal.qvto?root=Modeling_Project&sortdir=down&view=mar kup
>
>
> just checkout the whole project and note the usage of DocumentRoot in
> the output model.
>
> Regards,
> /Radek
>
>
> On Wed, 25 Nov 2009 11:02:02 +0100, Klaus Simon <busta_k@gmx.de> wrote:
>
>> Hello,
>> in the thread you can find at these links:
>> news://news.eclipse.org:119/hdu7jl$t1r$1@build.eclipse.org
>> http://www.eclipse.org/forums/index.php?S=6c565de225f39d0cfd 95316e6b67a05a&t=msg&goto=498553
>>
>>
>> a problem is described when trying to transform a model with ATL. The
>> problem seems to be that ecore metamodel contains extended metadata and
>> ATL does not seem to be able to handle extended metadata. I had this
>> problem, too, so i tried to use QVTO for transformation.
>>
>> I tested a simple example, but i get an error here, too. I created a
>> simple xml schema and created a ecore model from this xml schema. In
>> this ecore model extended metadata is used to create the correct names
>> of the attributes in the xml files, since the attributes are called
>> differently in the schema and in the ecore file.
>>
>> When i try a very simple transformation on a model created with the
>> ecore editor i get the following error:
>> org.eclipse.m2m.internal.qvt.oml.emf.util.EmfException: Failed to save
>> model to platform:/resource/Foo/FooTransformation.schema
>>
>> Since i don't have much experience with QVTO i am not sure, if it is
>> because of the extended metadata, but using the same transformation on a
>> model without extended metadata did not lead to an error.
>>
>> I attached the xml schema, the ecore model created from the schema and
>> the qvto transformation.
>>
>> Is there anyone who successfully did a transormation on models, where
>> the metamodel contained extended metadata?
>>
>> Klaus
Previous Topic:[QVTO] mapping to a set, adding to result does not work
Next Topic:[ATL] Calling Java within an ATL transformation
Goto Forum:
  


Current Time: Thu Mar 28 12:31:03 GMT 2024

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

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

Back to the top