Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Executing OCL queries
[QVTO] Executing OCL queries [message #483433] Tue, 01 September 2009 14:55 Go to next message
Christian Saad is currently offline Christian SaadFriend
Messages: 39
Registered: July 2009
Member
Hi everyone,

I'm using OCL to carry out some calculations on EMF models. This works
quite well, however I'd like to replace essential OCL with imperative OCL
because its additional expressions would enable the definition of more
elaborate queries (but I don't need or want query-external side-effects
nor any other QVT-related functionality).

Is there a way to easily switch from standard OCL to the imperative OCL
implementation of the QVT project? I tried some things, e.g. replacing the
environment factory...

OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);

...but unfortunately, without any success.

Any help would be highly appreciated :)

Regards,
Chris
Re: [QVTO] Executing OCL queries [message #483512 is a reply to message #483433] Tue, 01 September 2009 19:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Chris,

We do not support standalone Imperative OCL directly, so by using QVTO
component
you can't parse and evaluate Imperative OCL expressions.

I agree that separation of this functionality seems natural and we
definitely
are going to do some steps in this direction, just to get a cleaner design.
Anyway, it's unlikely that this will appear as API of QVTO in Helios.

What we do support is calling into QVT libraries from plain OCL, by using
a special OCL environment factory. It's possible to separate the
complex logic, which can be expressed more effectively in QVT queries and
reused in standard OCL expressions.

Currently, it's not part of the QVTO API, but we will expose this as API in
Helios, as it's pretty handy.

Regards,
/Radek



On Tue, 01 Sep 2009 16:55:15 +0200, C. Saad
<christian.saad@informatik.uni-augsburg.de> wrote:

> Hi everyone,
>
> I'm using OCL to carry out some calculations on EMF models. This works
> quite well, however I'd like to replace essential OCL with imperative
> OCL because its additional expressions would enable the definition of
> more elaborate queries (but I don't need or want query-external
> side-effects nor any other QVT-related functionality).
>
> Is there a way to easily switch from standard OCL to the imperative OCL
> implementation of the QVT project? I tried some things, e.g. replacing
> the environment factory...
>
> OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);
>
> ..but unfortunately, without any success.
>
> Any help would be highly appreciated :)
>
> Regards,
> Chris
>
Re: [QVTO] Executing OCL queries [message #483601 is a reply to message #483512] Wed, 02 September 2009 09:58 Go to previous messageGo to next message
Christian Saad is currently offline Christian SaadFriend
Messages: 39
Registered: July 2009
Member
Hi Radek,

thanks for your quick answer! Ok, so I guess there is no easy way around
this problem, but I'm not willing to let go just yet ;)
Would it be possible as a workaround, e.g. to define kind of a pseudo-QVT
transformation that in reality only executes the query (unfortunately my
knowledge of QVT is very limited) or could the I-OCL interpreter be
somehow "exported" as a separate plugin?

Regards,
Chris

radek dvorak wrote:

> Hi Chris,

> We do not support standalone Imperative OCL directly, so by using QVTO
> component
> you can't parse and evaluate Imperative OCL expressions.

> I agree that separation of this functionality seems natural and we
> definitely
> are going to do some steps in this direction, just to get a cleaner design.
> Anyway, it's unlikely that this will appear as API of QVTO in Helios.

> What we do support is calling into QVT libraries from plain OCL, by using
> a special OCL environment factory. It's possible to separate the
> complex logic, which can be expressed more effectively in QVT queries and
> reused in standard OCL expressions.

> Currently, it's not part of the QVTO API, but we will expose this as API in
> Helios, as it's pretty handy.

> Regards,
> /Radek



> On Tue, 01 Sep 2009 16:55:15 +0200, C. Saad
> <christian.saad@informatik.uni-augsburg.de> wrote:

>> Hi everyone,
>>
>> I'm using OCL to carry out some calculations on EMF models. This works
>> quite well, however I'd like to replace essential OCL with imperative
>> OCL because its additional expressions would enable the definition of
>> more elaborate queries (but I don't need or want query-external
>> side-effects nor any other QVT-related functionality).
>>
>> Is there a way to easily switch from standard OCL to the imperative OCL
>> implementation of the QVT project? I tried some things, e.g. replacing
>> the environment factory...
>>
>> OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);
>>
>> ..but unfortunately, without any success.
>>
>> Any help would be highly appreciated :)
>>
>> Regards,
>> Chris
>>
Re: [QVTO] Executing OCL queries [message #483763 is a reply to message #483601] Wed, 02 September 2009 20:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Chris,

Comments inlined below.

>
> thanks for your quick answer! Ok, so I guess there is no easy way around
> this problem, but I'm not willing to let go just yet ;)
> Would it be possible as a workaround, e.g. to define kind of a
> pseudo-QVT transformation that in reality only executes the query

This is what I meant by involving QVT libraries and calling its helper
operations
from OCL. For instance, you can define a library with a helper operation
on a String:

library MyStrings;

helper String::echo() : String {
return self;
}


Then you can write an expression using Essential OCL syntax, which
can access the operation you have defined in your QVT library.

Something like: self.echo() = self

The way how to enable QVT in your OCL expression is using a dedicated OCL
environment factory provided by QVTO, which can be initialised with
set of URIs referencing required QVT libraries and importing its
operations into your
OCL.

Note, this example is simplistic to illustrate the concept, for sure you
can define complex queries on your models using the full QVT lang features.

> (unfortunately my knowledge of QVT is very limited) or could the I-OCL
> interpreter be somehow "exported" as a separate plugin?
>

As I have mentioned, quite uncertain for this release cycle as we have
limited resources
in our team and have other essential topics to solve ;(.

Regards,
/Radek


> Regards,
> Chris
>
> radek dvorak wrote:
>
>> Hi Chris,
>
>> We do not support standalone Imperative OCL directly, so by using QVTO
>> component
>> you can't parse and evaluate Imperative OCL expressions.
>
>> I agree that separation of this functionality seems natural and we
>> definitely
>> are going to do some steps in this direction, just to get a cleaner
>> design.
>> Anyway, it's unlikely that this will appear as API of QVTO in Helios.
>
>> What we do support is calling into QVT libraries from plain OCL, by
>> using
>> a special OCL environment factory. It's possible to separate the
>> complex logic, which can be expressed more effectively in QVT queries
>> and
>> reused in standard OCL expressions.
>
>> Currently, it's not part of the QVTO API, but we will expose this as
>> API in
>> Helios, as it's pretty handy.
>
>> Regards,
>> /Radek
>
>
>
>> On Tue, 01 Sep 2009 16:55:15 +0200, C. Saad
>> <christian.saad@informatik.uni-augsburg.de> wrote:
>
>>> Hi everyone,
>>>
>>> I'm using OCL to carry out some calculations on EMF models. This
>>> works quite well, however I'd like to replace essential OCL with
>>> imperative OCL because its additional expressions would enable the
>>> definition of more elaborate queries (but I don't need or want
>>> query-external side-effects nor any other QVT-related functionality).
>>>
>>> Is there a way to easily switch from standard OCL to the imperative
>>> OCL implementation of the QVT project? I tried some things, e.g.
>>> replacing the environment factory...
>>>
>>> OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);
>>>
>>> ..but unfortunately, without any success.
>>>
>>> Any help would be highly appreciated :)
>>>
>>> Regards,
>>> Chris
>>>
>
>
Re: [QVTO] Executing OCL queries [message #753516 is a reply to message #483512] Thu, 27 October 2011 14:42 Go to previous messageGo to next message
Peter Mising name is currently offline Peter Mising nameFriend
Messages: 95
Registered: July 2009
Member
Hi Radek,
is there a standalone Imperative OCL yet? When not, is there a easy way
to use this functionality?
Thanks and Greetings
Peter

Am Di 01.09.09 21:46, schrieb radek dvorak:
> Hi Chris,
>
> We do not support standalone Imperative OCL directly, so by using QVTO
> component
> you can't parse and evaluate Imperative OCL expressions.
>
> I agree that separation of this functionality seems natural and we
> definitely
> are going to do some steps in this direction, just to get a cleaner design.
> Anyway, it's unlikely that this will appear as API of QVTO in Helios.
>
> What we do support is calling into QVT libraries from plain OCL, by using
> a special OCL environment factory. It's possible to separate the
> complex logic, which can be expressed more effectively in QVT queries and
> reused in standard OCL expressions.
>
> Currently, it's not part of the QVTO API, but we will expose this as API in
> Helios, as it's pretty handy.
>
> Regards,
> /Radek
>
>
>
> On Tue, 01 Sep 2009 16:55:15 +0200, C. Saad
> <christian.saad@informatik.uni-augsburg.de> wrote:
>
>> Hi everyone,
>>
>> I'm using OCL to carry out some calculations on EMF models. This works
>> quite well, however I'd like to replace essential OCL with imperative
>> OCL because its additional expressions would enable the definition of
>> more elaborate queries (but I don't need or want query-external
>> side-effects nor any other QVT-related functionality).
>>
>> Is there a way to easily switch from standard OCL to the imperative
>> OCL implementation of the QVT project? I tried some things, e.g.
>> replacing the environment factory...
>>
>> OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);
>>
>> ..but unfortunately, without any success.
>>
>> Any help would be highly appreciated :)
>>
>> Regards,
>> Chris
>>
>
Re: [QVTO] Executing OCL queries [message #753553 is a reply to message #753516] Thu, 27 October 2011 16:21 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

ImperativeOCL could very easily benefit from the revised MDT/OCL
implementation in which the library is fully modelled and for which as
from Juno M3 there is a direct OCL2Java code generation that shifts
parsing to genmodel time and thereafter executes 5 to 100 times faster
than interpreted OCL.

Regards

Ed Willink



On 27/10/2011 15:42, Peter wrote:
> Hi Radek,
> is there a standalone Imperative OCL yet? When not, is there a easy
> way to use this functionality?
> Thanks and Greetings
> Peter
>
> Am Di 01.09.09 21:46, schrieb radek dvorak:
>> Hi Chris,
>>
>> We do not support standalone Imperative OCL directly, so by using QVTO
>> component
>> you can't parse and evaluate Imperative OCL expressions.
>>
>> I agree that separation of this functionality seems natural and we
>> definitely
>> are going to do some steps in this direction, just to get a cleaner
>> design.
>> Anyway, it's unlikely that this will appear as API of QVTO in Helios.
>>
>> What we do support is calling into QVT libraries from plain OCL, by
>> using
>> a special OCL environment factory. It's possible to separate the
>> complex logic, which can be expressed more effectively in QVT queries
>> and
>> reused in standard OCL expressions.
>>
>> Currently, it's not part of the QVTO API, but we will expose this as
>> API in
>> Helios, as it's pretty handy.
>>
>> Regards,
>> /Radek
>>
>>
>>
>> On Tue, 01 Sep 2009 16:55:15 +0200, C. Saad
>> <christian.saad@informatik.uni-augsburg.de> wrote:
>>
>>> Hi everyone,
>>>
>>> I'm using OCL to carry out some calculations on EMF models. This works
>>> quite well, however I'd like to replace essential OCL with imperative
>>> OCL because its additional expressions would enable the definition of
>>> more elaborate queries (but I don't need or want query-external
>>> side-effects nor any other QVT-related functionality).
>>>
>>> Is there a way to easily switch from standard OCL to the imperative
>>> OCL implementation of the QVT project? I tried some things, e.g.
>>> replacing the environment factory...
>>>
>>> OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);
>>>
>>> ..but unfortunately, without any success.
>>>
>>> Any help would be highly appreciated :)
>>>
>>> Regards,
>>> Chris
>>>
>>
>
Previous Topic:Profile with ATL
Next Topic:[ATL] Query a model element using XPATH expression
Goto Forum:
  


Current Time: Tue Apr 16 18:18:33 GMT 2024

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

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

Back to the top