Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [ETL][Newbie] how to execute ETL script
[ETL][Newbie] how to execute ETL script [message #432528] Thu, 30 July 2009 16:58 Go to next message
Eclipse UserFriend
Originally posted by: d.clowes.lboro.ac.uk

Hello all,

I have a meta-model crafted in EMF (myModel.ecore), and I have several xml
files with data. Ihave used the EMF project wizard to create the ECore
meta-model from the XSD for the data. I have written a simple ETL script
to copy a couple of items of data. I therefore have:
myModel.ecore
xmlModel.ecore
data.model (XML file renamed to .model)
newData.model (empty model file based on myModel.ecore)

I have tried using the run as ETL config, declaring the models, however I
keep getting a "Type 'xmlModel!xmlClass' not found " error. I have also
tried to copy the ANT scripts form the OO2DB example but get the error
"testETL.xml:15: java.lang.NullPointerException", The ANT file is shown at
bottom.

I assume it's something simple I'm not understanding if anyone has any
suggestions that would be great.

Thanks,
Darren



<?xml version="1.0"?>
<project default="main">
<target name="loadModels">

<epsilon.emf.register file="DocumentModel.ecore"/>
<epsilon.emf.register file="tdl.ecore"/>

<epsilon.loadModel name="DocumentStructure" type="EMF">
<parameter name="modelFile" file="populated.model"/>
<parameter name="metamodelUri" value="DocumentStructure"/>
<parameter name="readOnLoad" value="true"/>
<parameter name="storeOnDisposal" value="true"/>
</epsilon.loadModel>

<epsilon.loadModel name="DocumentModel" type="EMF">
<parameter name="modelFile" file="XMF_Prep_Main_Section_4.model"/>
<parameter name="metamodelUri" value="DocumentModel"/>
<parameter name="readOnLoad" value="true"/>
<parameter name="storeOnDisposal" value="false"/>
</epsilon.loadModel>
</target>

<target name="main" depends="loadModels">
<epsilon.etl src="DocXML.etl">
<model ref="DocumentModel"/>
<model ref="DocumentStructure"/>
</epsilon.etl>
</target>

</project>
Re: [ETL][Newbie] how to execute ETL script [message #432791 is a reply to message #432528] Thu, 30 July 2009 17:23 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Darren,

Darren Clowes wrote:
> Hello all,
>
> I have a meta-model crafted in EMF (myModel.ecore), and I have several
> xml files with data. Ihave used the EMF project wizard to create the
> ECore meta-model from the XSD for the data.

Ok, with you so far. Sounds good.

> I have written a simple ETL
> script to copy a couple of items of data.

I don't quite understand what the ETL script will do.

I therefore have:
> myModel.ecore
> xmlModel.ecore
> data.model (XML file renamed to .model)
> newData.model (empty model file based on myModel.ecore)

Ok. Is xmlModel.ecore the metamodel created by EMF from your XSD?

>
> I have tried using the run as ETL config, declaring the models, however
> I keep getting a "Type 'xmlModel!xmlClass' not found " error. I have
> also tried to copy the ANT scripts form the OO2DB example but get the
> error "testETL.xml:15: java.lang.NullPointerException", The ANT file is
> shown at bottom.

The error from ETL sounds like there's something wrong with either the
launch configuration or the transformation rules.

Can you send me the metamodels (myModel and xmlModel), the models
(data.model and newData.model) and the ETL file? I'll see if I can
recreate the error.

Many thanks,
Louis.
Re: [ETL][Newbie] how to execute ETL script [message #441281 is a reply to message #432528] Fri, 31 July 2009 10:13 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Darren,

Just been speaking to a colleague about using Epsilon to load XML files
as models. A couple of gotchas:

- Be sure to use the "XML Model" type when adding a model to your launch
configuration.

- Ensure that the XML file contains a schema definition, otherwise EMF
will complain. This is bad:

<?xml version="1.0" encoding="UTF-8"?>
<yourRootElement>

This is good:

<?xml version="1.0" encoding="UTF-8"?>
<yourRootElement xsi:schemaLocation="YourSchema YourSchema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Cheers,
Louis.


Darren Clowes wrote:
> Hello all,
>
> I have a meta-model crafted in EMF (myModel.ecore), and I have several
> xml files with data. Ihave used the EMF project wizard to create the
> ECore meta-model from the XSD for the data. I have written a simple ETL
> script to copy a couple of items of data. I therefore have:
> myModel.ecore
> xmlModel.ecore
> data.model (XML file renamed to .model)
> newData.model (empty model file based on myModel.ecore)
>
> I have tried using the run as ETL config, declaring the models, however
> I keep getting a "Type 'xmlModel!xmlClass' not found " error. I have
> also tried to copy the ANT scripts form the OO2DB example but get the
> error "testETL.xml:15: java.lang.NullPointerException", The ANT file is
> shown at bottom.
>
> I assume it's something simple I'm not understanding if anyone has any
> suggestions that would be great.
>
> Thanks,
> Darren
>
>
>
> <?xml version="1.0"?>
> <project default="main">
> <target name="loadModels">
>
> <epsilon.emf.register file="DocumentModel.ecore"/>
> <epsilon.emf.register file="tdl.ecore"/>
>
> <epsilon.loadModel name="DocumentStructure" type="EMF">
> <parameter name="modelFile" file="populated.model"/>
> <parameter name="metamodelUri" value="DocumentStructure"/>
> <parameter name="readOnLoad" value="true"/>
> <parameter name="storeOnDisposal" value="true"/>
> </epsilon.loadModel>
>
> <epsilon.loadModel name="DocumentModel" type="EMF">
> <parameter name="modelFile"
> file="XMF_Prep_Main_Section_4.model"/>
> <parameter name="metamodelUri" value="DocumentModel"/>
> <parameter name="readOnLoad" value="true"/>
> <parameter name="storeOnDisposal" value="false"/>
> </epsilon.loadModel>
> </target>
>
> <target name="main" depends="loadModels">
> <epsilon.etl src="DocXML.etl">
> <model ref="DocumentModel"/>
> <model ref="DocumentStructure"/>
> </epsilon.etl>
> </target>
>
> </project>
>
Re: [ETL][Newbie] how to execute ETL script [message #441406 is a reply to message #441281] Fri, 31 July 2009 10:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.clowes.lboro.ac.uk

Thanks louis,

That helped lots and it is now working after fixing a couple of ETL error
as well.

Thanks.

Darren
Re: [ETL][Newbie] how to execute ETL script [message #441584 is a reply to message #441406] Fri, 31 July 2009 11:07 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Darren Clowes wrote:
> Thanks louis,
>
> That helped lots and it is now working after fixing a couple of ETL
> error as well.
>
> Thanks.
>
> Darren
>

Great! Glad this worked. I think EMF is rather picky about what XML it
will parse.

Cheers,
Louis.
Re: [ETL][Newbie] how to execute ETL script [message #571824 is a reply to message #432528] Thu, 30 July 2009 17:23 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Darren,

Darren Clowes wrote:
> Hello all,
>
> I have a meta-model crafted in EMF (myModel.ecore), and I have several
> xml files with data. Ihave used the EMF project wizard to create the
> ECore meta-model from the XSD for the data.

Ok, with you so far. Sounds good.

> I have written a simple ETL
> script to copy a couple of items of data.

I don't quite understand what the ETL script will do.

I therefore have:
> myModel.ecore
> xmlModel.ecore
> data.model (XML file renamed to .model)
> newData.model (empty model file based on myModel.ecore)

Ok. Is xmlModel.ecore the metamodel created by EMF from your XSD?

>
> I have tried using the run as ETL config, declaring the models, however
> I keep getting a "Type 'xmlModel!xmlClass' not found " error. I have
> also tried to copy the ANT scripts form the OO2DB example but get the
> error "testETL.xml:15: java.lang.NullPointerException", The ANT file is
> shown at bottom.

The error from ETL sounds like there's something wrong with either the
launch configuration or the transformation rules.

Can you send me the metamodels (myModel and xmlModel), the models
(data.model and newData.model) and the ETL file? I'll see if I can
recreate the error.

Many thanks,
Louis.
Re: [ETL][Newbie] how to execute ETL script [message #571949 is a reply to message #432528] Fri, 31 July 2009 10:13 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Darren,

Just been speaking to a colleague about using Epsilon to load XML files
as models. A couple of gotchas:

- Be sure to use the "XML Model" type when adding a model to your launch
configuration.

- Ensure that the XML file contains a schema definition, otherwise EMF
will complain. This is bad:

<?xml version="1.0" encoding="UTF-8"?>
<yourRootElement>

This is good:

<?xml version="1.0" encoding="UTF-8"?>
<yourRootElement xsi:schemaLocation="YourSchema YourSchema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Cheers,
Louis.


Darren Clowes wrote:
> Hello all,
>
> I have a meta-model crafted in EMF (myModel.ecore), and I have several
> xml files with data. Ihave used the EMF project wizard to create the
> ECore meta-model from the XSD for the data. I have written a simple ETL
> script to copy a couple of items of data. I therefore have:
> myModel.ecore
> xmlModel.ecore
> data.model (XML file renamed to .model)
> newData.model (empty model file based on myModel.ecore)
>
> I have tried using the run as ETL config, declaring the models, however
> I keep getting a "Type 'xmlModel!xmlClass' not found " error. I have
> also tried to copy the ANT scripts form the OO2DB example but get the
> error "testETL.xml:15: java.lang.NullPointerException", The ANT file is
> shown at bottom.
>
> I assume it's something simple I'm not understanding if anyone has any
> suggestions that would be great.
>
> Thanks,
> Darren
>
>
>
> <?xml version="1.0"?>
> <project default="main">
> <target name="loadModels">
>
> <epsilon.emf.register file="DocumentModel.ecore"/>
> <epsilon.emf.register file="tdl.ecore"/>
>
> <epsilon.loadModel name="DocumentStructure" type="EMF">
> <parameter name="modelFile" file="populated.model"/>
> <parameter name="metamodelUri" value="DocumentStructure"/>
> <parameter name="readOnLoad" value="true"/>
> <parameter name="storeOnDisposal" value="true"/>
> </epsilon.loadModel>
>
> <epsilon.loadModel name="DocumentModel" type="EMF">
> <parameter name="modelFile"
> file="XMF_Prep_Main_Section_4.model"/>
> <parameter name="metamodelUri" value="DocumentModel"/>
> <parameter name="readOnLoad" value="true"/>
> <parameter name="storeOnDisposal" value="false"/>
> </epsilon.loadModel>
> </target>
>
> <target name="main" depends="loadModels">
> <epsilon.etl src="DocXML.etl">
> <model ref="DocumentModel"/>
> <model ref="DocumentStructure"/>
> </epsilon.etl>
> </target>
>
> </project>
>
Re: [ETL][Newbie] how to execute ETL script [message #571963 is a reply to message #441281] Fri, 31 July 2009 10:50 Go to previous message
Darren  is currently offline Darren Friend
Messages: 40
Registered: September 2009
Member
Thanks louis,

That helped lots and it is now working after fixing a couple of ETL error
as well.

Thanks.

Darren
Re: [ETL][Newbie] how to execute ETL script [message #571980 is a reply to message #441406] Fri, 31 July 2009 11:07 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Darren Clowes wrote:
> Thanks louis,
>
> That helped lots and it is now working after fixing a couple of ETL
> error as well.
>
> Thanks.
>
> Darren
>

Great! Glad this worked. I think EMF is rather picky about what XML it
will parse.

Cheers,
Louis.
Previous Topic:Problem running ETL using Epsilon/ANT
Next Topic:[EGL] [newbie] Multiple input models problem
Goto Forum:
  


Current Time: Fri Dec 19 10:13:12 GMT 2014

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

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