Some created elements are not serialized [message #1863518] |
Wed, 07 February 2024 13:27 |
Yves BERNARD Messages: 152 Registered: July 2014 |
Senior Member |
|
|
The attached archive contains a modified version of the "UML2OWL" transformation initially written by Guillaume Hillairet. It has been adapted to work with EMFTVM plus other miscellaneous changes.
The launcher provided executes this transformation on the UML PrimitiveTypes Library of Eclipse. According to the traces generated by the execution, the RDFSDataypes corresponding to the primitive types defined in the library are actually created but they are not visible in the resulting ecore file. Instead, only the corresponding URI are, while they are a secondary target of the matching rule that
should transform the primitive type (i.e. PrimitiveType2RDFSDataType).
I created a lazy version of that matching rule (PrimitiveType2RDFSDataType_lazy). If the transformation is modified in order to executed it for all the primitive type instances. The corresponding RDFSDataType are serialized in the resulting ecore file.
How can we explain this behavior and how can I fix it so that the matching rule works as expected?
Yves
|
|
|
Re: Some created elements are not serialized [message #1863533 is a reply to message #1863518] |
Wed, 07 February 2024 20:49 |
|
The rules are firing correctly, but something goes wrong in serialization, because elements that end up outside the output EMF Resource do not get included in the output file. I'm suspecting lots of elements are created twice, but that doesn't explain why some elements end up outside the EMF Resource. EMFTVM checks for each output element whether it is contained by another element or not. When it is not contained, the element is added to the output Resource explicitly. OWL.ecore is a plain Ecore metamodel, without any special behaviour.
When removing everything from your transformation module except the PrimitiveType2RDFSDataType rule, everything works. You could try to reconstruct the transformation rule by rule, until it stops working...
Cheers,
Dennis
|
|
|
Re: Some created elements are not serialized [message #1863584 is a reply to message #1863533] |
Tue, 13 February 2024 16:23 |
Yves BERNARD Messages: 152 Registered: July 2014 |
Senior Member |
|
|
Hi Dennis,
Thank you.
Actually I discovered can fix it by changing the order in which the target are specified in the rule PrimitiveType2RDFSDataType:
to
x_uri : OWL!UniformResourceIdentifier (
name <- p.name--thisModule.primitiveTypeMap.get(p.name)
),
x : OWL!RDFSDataType (
uriRef <- Set{x_u}
),
x_u : OWL!URIReference (
uri <- x_uri
)
Works (i.e. RDFSDataTypes are serialized in the file together with the URIs)...
While
to
x : OWL!RDFSDataType (
uriRef <- Set{x_u}
),
x_u : OWL!URIReference (
uri <- x_uri
),
x_uri : OWL!UniformResourceIdentifier (
name <- p.name--thisModule.primitiveTypeMap.get(p.name)
)
Does not works (i.e. RDFSDataTypes are NOT serialized in the file)!
Yves
Yves
|
|
|
Powered by
FUDForum. Page generated in 0.03130 seconds