Access to UML stereotypes from ATL EMFTVM script... [message #1820924] |
Sat, 01 February 2020 00:38 |
Olivier Hurez-Martin Messages: 20 Registered: May 2019 |
Junior Member |
|
|
Hello,
Currently working on a SysML to OWL model transformation project, using Eclipse EMF 2019-12 and ATL 4.2.0.
I recently discovered that helpers ATL scripts can't access the SysML stereotypes embedded in sample input SysML models, when launched using EMFTVM ANT tasks. They do however, when run from an Eclipse EMFTVM launch configuration.
I could not spot the difference between my settings in build.xml and those from the exported launch config file.
Both files are listed below.
My question is: how should I correct the ANT script so the transformation rules (particularly their filters) and helpers can see the SysML UML stereotypes and process them the way they do when run from the launch config?
Thank you!
-- Olivier.
sysml2owl-emftvm.launch
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.atl.emftvm.launcher.EMFTVMTransformation">
<stringAttribute key="ATL File Name" value="//TestEMFTVM/transformations/SYSML2OWL.atl"/>
<booleanAttribute key="Disable JIT compiler" value="false"/>
<booleanAttribute key="Display Profiling Data" value="false"/>
<booleanAttribute key="Display Timing Data" value="true"/>
<mapAttribute key="Inout Model Options"/>
<mapAttribute key="Inout Models"/>
<mapAttribute key="Inout Models Output Locations"/>
<mapAttribute key="Input Model Options"/>
<mapAttribute key="Input Models">
<mapEntry key="IN" value="platform:/resource/TestEMFTVM/models/SampleModel.uml"/>
</mapAttribute>
<mapAttribute key="Metamodel Options"/>
<mapAttribute key="Metamodels">
<mapEntry key="OWL" value="platform:/resource/TestEMFTVM/metamodels/OWL/OWL.ecore"/>
<mapEntry key="UML" value="http://www.eclipse.org/uml2/5.0.0/UML"/>
</mapAttribute>
<stringAttribute key="Module Name" value="SYSML2OWL"/>
<stringAttribute key="Module Path" value="/TestEMFTVM/transformations/"/>
<mapAttribute key="Output Model Options">
<mapEntry key="OUT" value="allowIntermodelReferences derivedFile"/>
</mapAttribute>
<mapAttribute key="Output Models">
<mapEntry key="OUT" value="platform:/resource/TestEMFTVM/models/SampleModel.owl"/>
</mapAttribute>
<listAttribute key="Superimpose">
<listEntry value="//TestEMFTVM/transformations/SYSMLLIB.asm"/>
</listAttribute>
</launchConfiguration>
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- See examples at: https://github.com/dwagelaar/emftvm.maven.example/blob/master/build.xml
https://github.com/eclipse/atl/blob/master/plugins/org.eclipse.m2m.atl.emftvm.compiler/compiler-compiler/build.xml
-->
<project name="SysML2OWL" default="all">
<property name="project.basedir" value="${basedir}" />
<property name="project.metamodels" value="${project.basedir}/metamodels" />
<property name="project.models" value="${project.basedir}/models" />
<property name="project.transformations" value="${project.basedir}/transformations" />
<property name="project.local.dependencies" value="${project.basedir}/repository/dependencies" />
<property name="project.build.directory" value="${project.basedir}/target" />
<property name="project.build.library" location="${project.build.directory}/lib" />
<property name="project.build.models" value="${project.build.directory}/models" />
<property name="project.build.transformations" value="${project.build.directory}/transformations" />
<property name="project.build.logs" value="${project.build.directory}/logs" />
<!-- Change this value if you want to use another input model -->
<property name="modelName" value="SampleModel"/>
<property name="inModel" value="${modelName}.uml"/>
<property name="odmEcoreOutput" value="${modelName}-ODM.ecore"/>
<property name="odmXmiOutput" value="${modelName}-ODM.xmi"/>
<target name="clean">
<delete dir="${project.build.library}" includes="*.jar" excludes='antlr-runtime-*.jar'></delete>
<delete dir="${project.build.transformations}" includes="*.emftvm"></delete>
<delete dir="${project.build.models}" includes="*.jar"></delete>
</target>
<target name="all" depends="loadMetamodels,compileATL,transform" />
<target name="loadMetamodels" depends="getLibrary">
<emftvm.registerMetamodel packageClass="org.eclipse.emf.ecore.EcorePackage"
resourceFactoryClass="org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl" fileExtension="ecore" />
<emftvm.registerMetamodel packageClass="org.eclipse.uml2.uml.UMLPackage"
resourceFactoryClass="org.eclipse.uml2.uml.internal.resource.UMLResourceFactoryImpl" fileExtension="uml" />
<emftvm.registerMetamodel packageClass="org.eclipse.emf.ecore.EcorePackage"
resourceFactoryClass="org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl" fileExtension="xmi" />
<emftvm.registerMetamodel packageClass="org.eclipse.emf.ecore.EcorePackage"
resourceFactoryClass="org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl" fileExtension="xml" />
<emftvm.loadMetamodel name="UML" uri="http://www.eclipse.org/uml2/5.0.0/UML" />
<emftvm.loadMetamodel name="OWL" uri="file:/${project.metamodels}/OWL/OWL.ecore" />
<emftvm.loadMetamodel name="XML" uri="file:/${project.metamodels}/XML/XML.ecore"/>
</target>
<target name="compileATL" depends="loadMetamodels">
<emftvm.compile module="SYSML2OWL"
modulepath="${project.transformations}/" outputpath="${project.build.transformations}/" charset="UTF-8" />
<emftvm.compile module="SYSMLLIB"
modulepath="${project.transformations}/" outputpath="${project.build.transformations}/" charset="UTF-8" />
<emftvm.compile module="OWL2XML"
modulepath="${project.transformations}/" outputpath="${project.build.transformations}/" charset="UTF-8" />
</target>
<target name="transform" depends="compileATL">
<echo message="Loading model ${inModel}" />
<emftvm.loadModel name="${modelName}" uri="file:/${project.models}/${inModel}" />
<echo message="Running file:/${project.build.transformations}/SYSML2OWL.emftvm" />
<emftvm.run modulepath="file:/${project.build.transformations}/" module="SYSML2OWL">
<metamodel name="UML" />
<metamodel name="OWL" />
<inputmodel name="${modelName}" as="IN" />
<outputmodel name="${modelName}-ODM-ECORE" uri="file:/${project.build.models}/${odmEcoreModel}" as="OUT" allowInterModelReferences="true" />
<outputmodel name="${modelName}-ODM-match" as="match" uri="file:/${project.build.logs}/${modelName}-ODM-match.trace"/>
<inoutmodel name="${modelName}-ODM-trace" as="trace" uri="file:/${project.build.logs}/${modelName}-ODM.trace"/>
</emftvm.run>
<echo message="Saving OWL model as Ecore" />
<emftvm.saveModel name="${modelName}-ODM-match" uri="file:/${project.build.logs}/${modelName}-ODM-match.trace" />
<emftvm.saveModel name="${modelName}-ODM-trace" uri="file:/${project.build.logs}/${modelName}-ODM.trace" />
<emftvm.saveModel name="${modelName}-ODM-ECORE" uri="file:/${project.build.models}/${odmEcoreOutput}" />
<emftvm.saveModel name="${modelName}-ODM-ECORE" uri="file:/${project.build.models}/${odmXmiOutput}" />
</target>
<target name="getLibrary" depends="init">
<get src="https://repo.maven.apache.org/maven2/org/eclipse/equinox/org.eclipse.equinox.common/3.6.0.v20100503/org.eclipse.equinox.common-3.6.0.v20100503.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/emf/org.eclipse.emf.ecore/2.12.0/org.eclipse.emf.ecore-2.12.0.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/emf/org.eclipse.emf.common/2.12.0/org.eclipse.emf.common-2.12.0.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/emf/org.eclipse.emf.ecore.xmi/2.12.0/org.eclipse.emf.ecore.xmi-2.12.0.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/emf/org.eclipse.emf.mapping.ecore2xml/2.9.0-v20150806-0404/org.eclipse.emf.mapping.ecore2xml-2.9.0-v20150806-0404.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.0_BETA/asm-6.0_BETA.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/core/runtime/3.10.0-v20140318-2214/runtime-3.10.0-v20140318-2214.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/uml2/uml/5.0.0-v20140602-0749/uml-5.0.0-v20140602-0749.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/uml2/common/2.0.0-v20140602-0749/common-2.0.0-v20140602-0749.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/uml2/types/2.0.0-v20140602-0749/types-2.0.0-v20140602-0749.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/uml2/uml/profile/standard/1.0.0-v20140602-0749/standard-1.0.0-v20140602-0749.jar"
dest="${project.build.library}" skipexisting="true" />
<get src="https://repo.eclipse.org/content/groups/atl/org/eclipse/m2m/atl/org.eclipse.m2m.atl.emftvm.ant.standalone/4.1.0/org.eclipse.m2m.atl.emftvm.ant.standalone-4.1.0.jar"
dest="${project.build.library}" skipexisting="true" />
<taskdef resource="org/eclipse/m2m/atl/emftvm/ant/antlib.xml">
<classpath>
<fileset dir="${project.build.library}" includes="**/*.jar" />
</classpath>
</taskdef>
</target>
<target name="init">
<mkdir dir="${project.build.library}" />
<mkdir dir="${project.build.models}" />
<mkdir dir="${project.build.logs}" />
<mkdir dir="${project.build.transformations}" />
</target>
</project>
[Updated on: Sat, 01 February 2020 00:41] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01938 seconds