Skip to main content



      Home
Home » Modeling » VIATRA » Incquery - how to query the association relationship in UML(Incquery - how to query the association relationship in UML)
Incquery - how to query the association relationship in UML [message #1758328] Mon, 27 March 2017 13:06 Go to next message
Eclipse UserFriend
hi,

I am trying to use Incquery to query the content of UML file. However , I am not sure how to write the pattern for UML association relationship. Can you please advice on this.

@Edge(source = sub, target = sup, label = "impl")
@Format(color = "#0000FF", lineWidth = 1, lineStyle = "dashed")
pattern associationImpl(sub : Class, sup : Class) {
Property.Owner(IR,sub);
Property(IR);
Property.type(IR,sup);
}

Regards
Laila
Re: Incquery - how to query the association relationship in UML [message #1758345 is a reply to message #1758328] Mon, 27 March 2017 16:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I would start with the features of the Association class, such as Association.memberEnds to collect the two properties the association collects, and then navigate to the owners of said properties. As an example, look for the implementation of the related EndType derived feature of Association class of the UML metamodel [1].

[1] http://git.eclipse.org/c/viatra/org.eclipse.viatra.git/tree/integration/plugins/org.eclipse.viatra.integration.uml/src/org/eclipse/viatra/integration/uml/derivedfeatures/DerivedFeatures.vql#n468

Best regards,
Zoltán
Re: Incquery - how to query the association relationship in UML [message #1758392 is a reply to message #1758345] Tue, 28 March 2017 07:28 Go to previous messageGo to next message
Eclipse UserFriend
You could try out the Query by Example addon ( https://viatra.net/news/2016/7/introducing-viatra-query-by-example ), that helps specifically in exploring a metamodel and defining queries. Even better, the blog post uses UML as an example as well.
Re: Incquery - how to query the association relationship in UML [message #1758563 is a reply to message #1758392] Thu, 30 March 2017 03:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi Zoltan,
Thanks for your reply..
I tried the following but it not seem to work, am I doing something wrong.
Also "propert.owner" is not seem to be supported by incquery.

@Edge(source = src, target = targ, label = "associate")
pattern association(src:Class , targ:Class){
Association(Ass_0);
find associationEndType(Ass_0,pro);
TypedElement.type(pro, targ);

Property.owner(pro,src);
}
pattern associationEndType(
self : Association,
pro : Property
) {
Association.memberEnd(self, pro);


}
salwa

[Updated on: Thu, 30 March 2017 03:40] by Moderator

Re: Incquery - how to query the association relationship in UML [message #1758661 is a reply to message #1758563] Fri, 31 March 2017 07:02 Go to previous message
Eclipse UserFriend
Hi,

What do you mean by not supported? Does it return an error message of it being a derived feature? In that case, have a look at the UML integration feature available in the IncQuery/VIATRA update site (see https://wiki.eclipse.org/VIATRA/Integration/UMLSupport).

Or is it some other kind of issue?

Zoltán
Previous Topic:Importing Ecore metamodel into Modelspace with VIATRA2 R3.1
Next Topic:Self-reference in viatra
Goto Forum:
  


Current Time: Thu Jul 24 00:08:16 EDT 2025

Powered by FUDForum. Page generated in 0.07743 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top