Conversion EMF to RDF - RDF to EMF

228 views
Skip to first unread message

martina

unread,
Jul 26, 2010, 8:34:31 AM7/26/10
to emftriple-discuss, g.hil...@gmail.com
Hello,
referring to your paper published at
http://www.abdn.ac.uk/~r01srt7/swese2008/pdf/swese2008_submission_14.pdf
(in particular figure 1 at page 2), I want to define OWL/RDFS model
for a custom EMF model (ecore). My purpose is to convert EMF instance
(XMI) to RDF instance of above RDFS schema but I want also return to
EMF objects from RDF serialization of model.
At this time I'm able to run the transformation from an EMF model
(saved into an xmi file) to a RDF through RDFizer but not the vice-
versa: I saw that it is possible to obtain a serialization of the RDF
into XMI, but I would return to EMF object. Is this transformation
possible? In this case, can you help me in the process of conversion
in order to obtain my goal?

Moreover, now I don't provide ATL rules in order to map object model
to RDF and viceversa. It seems that actual version hides this step.
So, what kind of mapping can I define for this version of library?

Following instruction to build source locally, I have found several
issue on plugin dependences and relation: have you a target
definition, so I can build right platform setting?

Finally, I try to run Example3 contained into
"com.emf4sw.examples.zip" available in the download section at
http://code.google.com/p/emftriple/downloads/list, but it doesn't work
and it generates the following exception:

Exception in thread "main"
org.eclipse.m2m.atl.engine.emfvm.VMException:
org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined cannot be cast to
org.eclipse.emf.ecore.EObject
at __applyOWLClass2EClass#120(owl2ecore.atl[87:43-87:55])
local variables: self=owl2ecore : ASMModule, link=TransientLink
{rule = OWLClass2EClass, sourceElements = {o =
com.emf4sw.owl.impl.OWLClassImpl@c1dc0b (name: DayOfWeek)},
targetElements = {ann_rdf =
org.eclipse.emf.ecore.impl.EAnnotationImpl@1ea71d4 (source: OWLClass),
e = org.eclipse.emf.ecore.impl.EClassImpl@d73c3c (name: DayOfWeek)
(instanceClassName: null) (abstract: false, interface: false),
ann_unionOf =
org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl@b38dba (key:
null, value: null)}, variables = {dataProperties = [], name =
DayOfWeek, objectProperties =
[com.emf4sw.owl.impl.ObjectPropertyImpl@59e205 (name:
bottomObjectProperty)], superTypes = []}}, o=IN!DayOfWeek, e=OUT!
DayOfWeek, ann_rdf=OUT!<unnamed>, ann_uri=OclUndefined,
ann_name=OclUndefined, name='DayOfWeek', objectProperties=Sequence {IN!
bottomObjectProperty}, dataProperties=Sequence {}, superTypes=Sequence
{}
at __exec__#28(owl2ecore.atl)
local variables: self=owl2ecore : ASMModule, e=TransientLink {rule =
OWLClass2EClass, sourceElements = {o =
com.emf4sw.owl.impl.OWLClassImpl@c1dc0b (name: DayOfWeek)},
targetElements = {ann_rdf =
org.eclipse.emf.ecore.impl.EAnnotationImpl@1ea71d4 (source: OWLClass),
e = org.eclipse.emf.ecore.impl.EClassImpl@d73c3c (name: DayOfWeek)
(instanceClassName: null) (abstract: false, interface: false),
ann_unionOf =
org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl@b38dba (key:
null, value: null)}, variables = {dataProperties = [], name =
DayOfWeek, objectProperties =
[com.emf4sw.owl.impl.ObjectPropertyImpl@59e205 (name:
bottomObjectProperty)], superTypes = []}}
at main#27(owl2ecore.atl)
local variables: self=owl2ecore : ASMModule
Java Stack:
org.eclipse.m2m.atl.engine.emfvm.VMException:
org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined cannot be cast to
org.eclipse.emf.ecore.EObject
at
org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:
643)
at
org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:
388)
at
org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:
388)
at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:208)
at
org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(EMFVMLauncher.java:
170)
at
org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.launch(EMFVMLauncher.java:
139)
at com.atl.common.trans.Transformations$1.apply(Transformations.java:
129)
at com.atl.common.trans.Transformations$1.apply(Transformations.java:
1)
at
com.atl.common.trans.Transformations.transform(Transformations.java:
60)
at com.emf4sw.owl.atl.OWLResource2Ecore.apply(OWLResource2Ecore.java:
45)
at com.emf4sw.examples.Example3.main(Example3.java:32)
Caused by: java.lang.ClassCastException:
org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined cannot be cast to
org.eclipse.emf.ecore.EObject
at
org.eclipse.m2m.atl.engine.emfvm.adapter.EMFModelAdapter.set(EMFModelAdapter.java:
551)
at
org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:
474)
... 10 more

I obtain the same exception also if I run the code in the page
http://code.google.com/p/emftriple/wiki/EMF4SWTransformations in
section "OWL to Ecore".
I followed the installation instruction step by step, in particular
the section "Install from Source" (http://code.google.com/p/emftriple/
wiki/Installation) and I tried to transform also other ontology but
everyone generate exceptions.

Thanks

Marta Anna Vitulano

Guillaume Hillairet

unread,
Aug 9, 2010, 1:48:19 PM8/9/10
to emftriple-discuss
Hi Marta,

see comments below.

On Jul 26, 1:34 pm, martina <martina.vitul...@gmail.com> wrote:
> Hello,
> referring to your paper published athttp://www.abdn.ac.uk/~r01srt7/swese2008/pdf/swese2008_submission_14.pdf
> (in particular figure 1 at page 2), I want to define OWL/RDFS model
> for a custom EMF model (ecore). My purpose is to convert EMF instance
> (XMI) to RDF instance of above RDFS schema but I want also return to
> EMF objects from RDF serialization of model.
> At this time I'm able to run the transformation from an EMF model
> (saved into an xmi file) to a RDF through RDFizer but not the vice-
> versa: I saw that it is possible to obtain a serialization of the RDF
> into XMI, but I would return to EMF object. Is this transformation
> possible? In this case, can you help me in the process of conversion
> in order to obtain my goal?

The RDFIzer does what you want. You can checkout the updated wiki page
about it http://code.google.com/p/emftriple/wiki/RDFIzerGuide. I also
put a project example in the download section.

> Moreover, now I don't provide ATL rules in order to map object model
> to RDF and viceversa. It seems that actual version hides this step.
> So, what kind of mapping can I define for this version of library?

The ATL like transformation language is not available in this version
(maybe a new version will include it but can't say when). The mapping
is currently done via annotations on the EMF model, see wiki for info.

> Following instruction to build source locally, I have found several
> issue on plugin dependences and relation: have you a target
> definition, so I can build right platform setting?

You should get a working version if you follow installation
instructions, see http://code.google.com/p/emftriple/wiki/Installation.

> Finally, I try to run Example3 contained into
> "com.emf4sw.examples.zip" available in the download section athttp://code.google.com/p/emftriple/downloads/list, but it doesn't work
> and it generates the following exception:

The OWL2Ecore transformation is still unstable. I will try to fix it
as soon as possible.

martina

unread,
Aug 11, 2010, 5:48:51 AM8/11/10
to emftriple-discuss
Hi,
first of all thanks a lot for your help.
I followed installation instructions (both the section "Install for
Eclipse 3.6" or "Install from Source") and I tried to run Example1
contained into "com.emf4sw.rdfizer.examples" but it generates the
following exception:

Exception in thread "main" java.lang.NullPointerException
at com.atl.common.utils.Preconditions.checkNotNull(Preconditions.java:
57)
at com.atl.common.models.Models.emptyModel(Models.java:93)
at com.atl.common.utils.Parameters.initOneOutput(Parameters.java:95)
at com.atl.common.trans.Transformations$1.apply(Transformations.java:
122)
at com.atl.common.trans.Transformations$1.apply(Transformations.java:
1)
at
com.atl.common.trans.Transformations.transform(Transformations.java:
60)
at com.emf4sw.rdfizer.atl.RDF2Model.transform(RDF2Model.java:58)
at com.emf4sw.rdfizer.RDFIzer.toModel(RDFIzer.java:99)
at com.emf4sw.rdfizer.examples.Example1.main(Example1.java:66)

The section that generates the exception is concerning the
transformation from a RDF document (model.ttl) to model2.xmi in
particular the line
Resource model2 = rdfizer.toModel(rdf2);
I saw that you generated the file and so I think that this
transformation goes well for you but I tried it also before my first
mail and it didn't go and generated the same error.

Thanks for your time

On 9 Ago, 19:48, Guillaume Hillairet <g.hillai...@gmail.com> wrote:
> Hi Marta,
>
> see comments below.
>
> On Jul 26, 1:34 pm, martina <martina.vitul...@gmail.com> wrote:
>
> > Hello,
> > referring to your paper published athttp://www.abdn.ac.uk/~r01srt7/swese2008/pdf/swese2008_submission_14.pdf
> > (in particular figure 1 at page 2), I want to define OWL/RDFS model
> > for a custom EMF model (ecore). My purpose is to convert EMF instance
> > (XMI) to RDF instance of above RDFS schema but I want also return to
> > EMF objects from RDF serialization of model.
> > At this time I'm able to run the transformation from an EMF model
> > (saved into an xmi file) to a RDF through RDFizer but not the vice-
> > versa: I saw that it is possible to obtain a serialization of the RDF
> > into XMI, but I would return to EMF object. Is this transformation
> > possible? In this case, can you help me in the process of conversion
> > in order to obtain my goal?
>
> The RDFIzer does what you want. You can checkout the updated wiki page
> about ithttp://code.google.com/p/emftriple/wiki/RDFIzerGuide. I also
> put a project example in the download section.
>
> > Moreover, now I don't provide ATL rules in order to map object model
> > to RDF and viceversa. It seems that actual version hides this step.
> > So, what kind of mapping can I define for this version of library?
>
> The ATL like transformation language is not available in this version
> (maybe a new version will include it but can't say when). The mapping
> is currently done via annotations on the EMF model, see wiki for info.
>
> > Following instruction to build source locally, I have found several
> > issue on plugin dependences and relation: have you a target
> > definition, so I can build right platform setting?
>
> You should get a working version if you follow installation
> instructions, seehttp://code.google.com/p/emftriple/wiki/Installation.

Guillaume Hillairet

unread,
Aug 11, 2010, 8:52:47 AM8/11/10
to emftriple-discuss
Hi,

Can you tell me which version you are using? It should be 0.6.1.
I haven't been able to reproduce the same error, but found some
others.
I will fix that asap.

BRs
Guillaume

martina

unread,
Aug 11, 2010, 10:08:44 AM8/11/10
to emftriple-discuss
Yes, I'm using the latest version 0.6.1.
Message has been deleted

martina

unread,
Aug 27, 2010, 11:11:54 AM8/27/10
to emftriple-discuss
Hi,

with the new updates everything seems to work good.
Thanks a lot
Reply all
Reply to author
Forward
0 new messages