Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Improved CSV connectivity layer (alpha)(Code available at google labs)
Improved CSV connectivity layer (alpha) [message #1217357] Thu, 28 November 2013 22:15 Go to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 240
Registered: October 2009
Location: Mexico
Senior Member

Hi all,

I did a small work on the CSV connectivity layer. Basically I added support for headers, including files in which each line has a different number of fields. It is also now possible to define the field separator. There are three new configuration values: Field Separator, Known Headers and Varargs Headers. The first lets you specify a different field separator, the second one tells the EMC that the first row of your CSV file are the headers. The third one tells the EMC that some lines may not have fields for all the headers, or what we call varargs headers.

If you are using headers, it is now possible to access each filed by its header within EOL. So for example if you have a CSV like this:
Rk,Year,Age,Tm,Lg,,W,L,W-L%,G,Finish,
1,1978,37,Atlanta Braves,NL,,69,93,.426,162,6,
2,1979,38,Atlanta Braves,NL,,66,94,.413,160,6,
3,1980,39,Atlanta Braves,NL,,81,80,.503,161,4,


You can use the following script to get all the teams (Tm):
for (row in baseball!Row.all()) {
	row.Tm.println();
}


If you have varargs headers, your CSV may look like this.
source,target
Corradini.etal1996,
Agrawal.etal2006,
DiRuscio.etal2012,Stevens2007,Czarnecki.etal2009,Czarnecki.Helsen2006,Stevens2008,
Syriani.Vangheluwe2010,Agrawal.etal2006,Jouault.Kurtev2006a,
Aranda.etal2012,France.Rumpe2007,Schmidt2006,Kent2002,


To access the variable argument fields, use the name of the last header, thus:
for (row in qiqqa!Row.all()) {
	row.source.print();
	" is connected to ".println();
	for (t in row.target) {
		t.println();
	}
}


Will print a source, followed by all its targets.

In the case you don't have headers, or to easily "upgrade" from the old CSV EMC, a default "field" attribute lets you access all the fields of a row:
for (row in qiqqaNH!Row.all()) {
	row.field.println();
}

Will print each of the rows in the file.

Next in my TO-DO is to add support for model storing.

Any comments and ideas are welcome.

The plugins are available at google labs (alpha):
https://epsilonlabs.googlecode.com/svn/trunk/ImprovedCSVHHR

Please remember that this is super preliminary work and somethings my not work Very Happy

Cheers,


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech

[Updated on: Fri, 29 November 2013 11:04]

Report message to a moderator

Re: Improved CSV connectivity layer (alpha) [message #1218630 is a reply to message #1217357] Fri, 29 November 2013 11:06 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 240
Registered: October 2009
Location: Mexico
Senior Member

Hi all,

I have provided a new commit which adds support for storing the CSV models. The CSV model configuration dialog now provides the fields "read on load" and "store on disposal", and the specific configuration of CSV has been moved to a separate section.

Hope someone finds it useful!

Cheers,


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: Improved CSV connectivity layer (alpha) [message #1219019 is a reply to message #1218630] Fri, 29 November 2013 16:49 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Thanks for your work! If it's not too much work, a quick blog post or some sort of tutorial would be great for potential users Smile.
Re: Improved CSV connectivity layer (alpha) [message #1219020 is a reply to message #1219019] Fri, 29 November 2013 16:59 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 240
Registered: October 2009
Location: Mexico
Senior Member

Hi Antonio,

What additional information would be useful? Where can I post/upload the tutorial? (I don't own a blog which I regularly update).


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: Improved CSV connectivity layer (alpha) [message #1219023 is a reply to message #1219020] Fri, 29 November 2013 18:02 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Just some basic step-by-step usage instructions (ideally with screenshots) would be nice: basically, how to install the plugins and how to use them.

Instead of a blog post, you could do a small slide deck and upload it somewhere, like SlideShare, for instance. That might be less work for you Smile.
Re: Improved CSV connectivity layer (alpha) [message #1219061 is a reply to message #1217357] Sat, 30 November 2013 14:50 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 240
Registered: October 2009
Location: Mexico
Senior Member

ArcaneBeans: Extended EMC for CVS Files http://arcanebeans.blogspot.com/2013/11/extended-emc-for-cvs-files.html?spref=tw

Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: Improved CSV connectivity layer (alpha) [message #1219083 is a reply to message #1217357] Sun, 01 December 2013 14:43 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Great, thanks!
Re: Improved CSV connectivity layer (alpha) [message #1403371 is a reply to message #1219083] Wed, 23 July 2014 10:25 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 240
Registered: October 2009
Location: Mexico
Senior Member

Hi all,

I have just commited (to Epsilon Labs) an additional plugin that provides a specialized csv model loader for the ANT scripts. I will also provide it as an additional patch to the enhancement request bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422937). Let me know any issues.

Regards,



Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech

[Updated on: Wed, 23 July 2014 10:29]

Report message to a moderator

Re: Improved CSV connectivity layer (alpha) [message #1404384 is a reply to message #1403371] Thu, 31 July 2014 19:37 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Horacio,

Thanks for doing this. I'll bring this in as soon as we've released 1.2.

Cheers,
Dimitris
Previous Topic:[ETL] M2XML Transformation Configuration Problem
Next Topic:Content assist based on ecore metamodel
Goto Forum:
  


Current Time: Thu Mar 28 16:50:31 GMT 2024

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

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

Back to the top