[ETL][Newbie] how to execute ETL script [message #432528] |
Thu, 30 July 2009 16:58 |
Eclipse User |
|
|
|
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 |
Louis Rose 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 |
Louis Rose 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 #571824 is a reply to message #432528] |
Thu, 30 July 2009 17:23 |
Louis Rose 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 |
Louis Rose 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>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04005 seconds