|
|
|
|
|
|
Re: [ETL] There is an ETL Metamodel? [message #1708148 is a reply to message #1708113] |
Mon, 14 September 2015 09:26 |
|
Hi Nicolas,
The entry point to the API is EtlModule. A quick example appears below (valid against the current version of the code in the Git repository / the new interim version that will appear within the next few hours - version number should be 1.3.0.20150914...):
public static void main(String[] args) throws Exception {
EtlModule module = new EtlModule();
module.parse(new File("..."));
if (!module.getParseProblems().isEmpty()) return;
module.getTransformationRules(); // Returns a list of transformation rules
TransformationRule rule = module.getTransformationRules().get(0);
rule.getBody(); // Returns the body of the first rule
rule.getGuard(); // Returns the guard of the first rule
}
As I mentioned in a previous post this API is under active development so if you spot any omissions please let us know.
Cheers,
Dimitris
|
|
|
|
|
|
|
|
|
|
|
Re: [ETL] There is an ETL Metamodel? [message #1721758 is a reply to message #1721743] |
Fri, 29 January 2016 21:11 |
|
Hi Nicolas,
The ETL syntax supports model declaration statements. For example you can add the following at the top of the Tree2Graph transformation [1] to declare the Tree and Graph models.
model Tree driver EMF {metamodelUri="Tree"};
model Graph driver EMF {metamodelUri="Graph"};
Model declaration statements are currently ignored at runtime - and hence are undocumented - but they're essential for static analysis (which is still work in progress).
To identify source/target models, you could add additional key-value pairs to model declarations (see below) or deduce this by inspecting the rules of the transformation.
model Tree driver EMF {metamodelUri="Tree", role="source"};
Cheers,
Dimitris
[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/examples/org.eclipse.epsilon.examples.tree2graph
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04246 seconds