Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSelf-reference in viatra
https://www.eclipse.org/forums/index.php/mv/msg/1085219/1758263/#msg_1758263
In the past days, i tried to use viatra to copy the TTC model, but when i copy elements of Switch and Segment, it is hard to implement the self-reference 'connectsTo' with vql and xtend. Could you offer me any advice? Or could you show me an example? The attachment is the meta-model of TTC, you can refer to is.
Hope for your reply and thanks in advance!]]>zhang ph2017-03-26T08:17:51-00:00Re: Self-reference in viatra
https://www.eclipse.org/forums/index.php/mv/msg/1085219/1758343/#msg_1758343
I don't really understand what are you trying to achieve here. In general, self-references can be easily extended in VQL using two variables, like `Switch.connectsTo(a,b);` or even `Switch.connectsTo(a,a);` depending on what you want to achieve. If you provide a more precise use case, I would be better equipped to suggest a use.
However, if you only want to copy the model (or a subtree of it), you could also have a look at the EcoreUtil#copy static method provided by EMF.
Best regards,
Zoltán]]>Zoltan Ujhelyi2017-03-27T20:20:16-00:00Re: Self-reference in viatra
https://www.eclipse.org/forums/index.php/mv/msg/1085219/1758731/#msg_1758731
Thanks for your advice and sorry for my late reply !
The purpose of mine is to check whether VIATRA can finish this task and what about the performance is, not just copy the model. and fortunately i have finished the copy task. But i found the consumed time of 1st transformation is about 25 minutes(Maybe it is unacceptable for me) and the 2nd transformation is less 1 second(It's excellent), the model element is 1,565,000 and in my test i referred to the tutorial on http://static.incquerylabs.com/projects/viatra/viatra-docs/ViatraDocs.html with the event-driven mode .]]>zhang ph2017-04-01T07:40:14-00:00Re: Self-reference in viatra
https://www.eclipse.org/forums/index.php/mv/msg/1085219/1758733/#msg_1758733
without seeing any detailed performance measurement results, I am only guessing, but I believe, the indexing required for one of the queries should be the culprit.
I'd do the following steps here:
1. Ensure the pattern editor provides no warnings, especially cartesian product warnings. The ones detected can increase initialization time and memory consumption greatly.
2. Look at our query optimization guide [1] and review your patterns.
3. Execute the query performance suite [2] and find out which query seems expensive. If the result is unclear, and you can share the problematic pattern(s), we can try to help figuring out what goes wrong.