Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » XML representation of OCL constraints ?
XML representation of OCL constraints ? [message #488841] Wed, 30 September 2009 13:18 Go to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Hi,
I am working on a definition of an XML based representation of DMTF
management profiles. Such profiles are able to define constraints on the
CIM classes they use in the profile. We are already able to specify OCL
constraints on the CIM classes, but there is some resistance in
accepting a text based language like OCL in a otherwise XML representation.

Therefore, I am i nsearch of a XML representation of OCL. That is, an
OCL constraint would be represented in some XML syntax, but the OCL
semantics would still be maintained.

-> Does anyone know about prior work in this direction ?

I ran across MathML from the W3C, which seems to provide a reasonable
framework for the XML constructs, and it contains a rich set of
mathematical operations including some (or probably most) of those that
are defined in OCL, but it is not clear to me at a first glance how
objects and their elements (basically the elements in a UML user model)
could be referenced in MathML.

-> Does anyone know about prior work to use MathML for defining
constraints on UML user models ?

Andy
Re: XML representation of OCL constraints ? [message #488952 is a reply to message #488841] Wed, 30 September 2009 20:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Andreas

OCL's concrete syntax is textual.

OCL's abstract syntax is a model that may be serialised to an XMI file.

OCL is re-used by many languages, so MDT/OCL supports extensibility.

An example of the AST form may be found in:

< http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.qvt.declarative/tests/org.eclipse.qvt.declarative.t est.parser.qvtrelation/src/org/eclipse/qvt/declarative/test/ parser/qvtrelation/models/expressions.reference.eqvtrelation ?revision=1.5&root=Modeling_Project>


which may look rathyer frightening becuase it is a compiled
representation and so has type annotations throughout. The source QVT
Relation from which it came is at

< http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.qvt.declarative/tests/org.eclipse.qvt.declarative.t est.parser.qvtrelation/src/org/eclipse/qvt/declarative/test/ parser/qvtrelation/models/expressions.qvtr?revision=1.1& root=Modeling_Project>

I'm not sure that your target is completely logical.

Ever since Fortran, all languages have used a very similar expression
representation that has only improved slightly through use of ".".
Why put a myriad of angle brackets and new lines in something that
you want to be readable?

In your management profile allow OCL expressions to be

.... value="some-ocl-expression" ....

Regards

Ed Willink

Andreas Maier wrote:
> Hi,
> I am working on a definition of an XML based representation of DMTF
> management profiles. Such profiles are able to define constraints on the
> CIM classes they use in the profile. We are already able to specify OCL
> constraints on the CIM classes, but there is some resistance in
> accepting a text based language like OCL in a otherwise XML representation.
>
> Therefore, I am i nsearch of a XML representation of OCL. That is, an
> OCL constraint would be represented in some XML syntax, but the OCL
> semantics would still be maintained.
>
> -> Does anyone know about prior work in this direction ?
>
> I ran across MathML from the W3C, which seems to provide a reasonable
> framework for the XML constructs, and it contains a rich set of
> mathematical operations including some (or probably most) of those that
> are defined in OCL, but it is not clear to me at a first glance how
> objects and their elements (basically the elements in a UML user model)
> could be referenced in MathML.
>
> -> Does anyone know about prior work to use MathML for defining
> constraints on UML user models ?
>
> Andy
XML representation of OCL constraints ? [message #488996 is a reply to message #488952] Thu, 01 October 2009 07:15 Go to previous messageGo to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Ed,
the difficulty is that the acceptance of OCL in that community is
hampered by the perceived obscureness of the OCL spec (a perception that
I can understand well), and by the need to have an OCL validator that
can easily be integrated with runtime environments that host the user
model that is to be validated. In our use case, the objects that are
targeted by the OCL constraints are in a CIM server that supports a
certain API for accessing the objects (instances, classes), and the OCL
validator would be invoked in a test tool that runs against that CIM server.

Is there a list of OCL validators and syntax checkers somewhere ?

Also, the management profile description is already in XML, and thus it
would be natural to also express constraints in some form of XML.

That XML needs to be manually editable using a standard XML editor, so
any form of XMI rendered OCL is out of question, and any language that
is used calls for some form of syntax validation support. I like the OCL
syntax validation provided by RSA, but there the objects are in a UML
user model, and not in our runtime environment.

Andy


Ed Willink wrote:
> Hi Andreas
>
> OCL's concrete syntax is textual.
>
> OCL's abstract syntax is a model that may be serialised to an XMI file.
>
> OCL is re-used by many languages, so MDT/OCL supports extensibility.
>
> An example of the AST form may be found in:
>
> < http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.qvt.declarative/tests/org.eclipse.qvt.declarative.t est.parser.qvtrelation/src/org/eclipse/qvt/declarative/test/ parser/qvtrelation/models/expressions.reference.eqvtrelation ?revision=1.5&root=Modeling_Project>
>
>
> which may look rathyer frightening becuase it is a compiled
> representation and so has type annotations throughout. The source QVT
> Relation from which it came is at
>
> < http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.qvt.declarative/tests/org.eclipse.qvt.declarative.t est.parser.qvtrelation/src/org/eclipse/qvt/declarative/test/ parser/qvtrelation/models/expressions.qvtr?revision=1.1& root=Modeling_Project>
>
>
> I'm not sure that your target is completely logical.
>
> Ever since Fortran, all languages have used a very similar expression
> representation that has only improved slightly through use of ".".
> Why put a myriad of angle brackets and new lines in something that
> you want to be readable?
>
> In your management profile allow OCL expressions to be
>
> ... value="some-ocl-expression" ....
>
> Regards
>
> Ed Willink
>
> Andreas Maier wrote:
>> Hi,
>> I am working on a definition of an XML based representation of DMTF
>> management profiles. Such profiles are able to define constraints on
>> the CIM classes they use in the profile. We are already able to
>> specify OCL constraints on the CIM classes, but there is some
>> resistance in accepting a text based language like OCL in a otherwise
>> XML representation.
>>
>> Therefore, I am i nsearch of a XML representation of OCL. That is, an
>> OCL constraint would be represented in some XML syntax, but the OCL
>> semantics would still be maintained.
>>
>> -> Does anyone know about prior work in this direction ?
>>
>> I ran across MathML from the W3C, which seems to provide a reasonable
>> framework for the XML constructs, and it contains a rich set of
>> mathematical operations including some (or probably most) of those
>> that are defined in OCL, but it is not clear to me at a first glance
>> how objects and their elements (basically the elements in a UML user
>> model) could be referenced in MathML.
>>
>> -> Does anyone know about prior work to use MathML for defining
>> constraints on UML user models ?
>>
>> Andy
Re: XML representation of OCL constraints ? [message #489188 is a reply to message #488996] Thu, 01 October 2009 18:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Andreas

MDT/OCL provides a validator.

If you're using XML then syntax checking is irrelevant. Semantic
checking is close to validation.

I always recommend Jos Warmer and Anneke Kleppe's book for OCL;
certainly not the specification. You will find at the back that it
offers an alternate business oriented syntax. Perhaps you want to
define a new new lightweight XML source syntax. EMF will give
you a fair amount of support for it, GMF even more. A modest
tranlation would then yield a true OCL AST and enable all the
OCL evaluation tooling.

Have you considered BPEL?

Regards

Ed Willink

Andreas Maier wrote:
> Ed,
> the difficulty is that the acceptance of OCL in that community is
> hampered by the perceived obscureness of the OCL spec (a perception that
> I can understand well), and by the need to have an OCL validator that
> can easily be integrated with runtime environments that host the user
> model that is to be validated. In our use case, the objects that are
> targeted by the OCL constraints are in a CIM server that supports a
> certain API for accessing the objects (instances, classes), and the OCL
> validator would be invoked in a test tool that runs against that CIM
> server.
>
> Is there a list of OCL validators and syntax checkers somewhere ?
>
> Also, the management profile description is already in XML, and thus it
> would be natural to also express constraints in some form of XML.
>
> That XML needs to be manually editable using a standard XML editor, so
> any form of XMI rendered OCL is out of question, and any language that
> is used calls for some form of syntax validation support. I like the OCL
> syntax validation provided by RSA, but there the objects are in a UML
> user model, and not in our runtime environment.
>
> Andy
>
>
> Ed Willink wrote:
>> Hi Andreas
>>
>> OCL's concrete syntax is textual.
>>
>> OCL's abstract syntax is a model that may be serialised to an XMI file.
>>
>> OCL is re-used by many languages, so MDT/OCL supports extensibility.
>>
>> An example of the AST form may be found in:
>>
>> < http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.qvt.declarative/tests/org.eclipse.qvt.declarative.t est.parser.qvtrelation/src/org/eclipse/qvt/declarative/test/ parser/qvtrelation/models/expressions.reference.eqvtrelation ?revision=1.5&root=Modeling_Project>
>>
>>
>> which may look rathyer frightening becuase it is a compiled
>> representation and so has type annotations throughout. The source QVT
>> Relation from which it came is at
>>
>> < http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.qvt.declarative/tests/org.eclipse.qvt.declarative.t est.parser.qvtrelation/src/org/eclipse/qvt/declarative/test/ parser/qvtrelation/models/expressions.qvtr?revision=1.1& root=Modeling_Project>
>>
>>
>> I'm not sure that your target is completely logical.
>>
>> Ever since Fortran, all languages have used a very similar expression
>> representation that has only improved slightly through use of ".".
>> Why put a myriad of angle brackets and new lines in something that
>> you want to be readable?
>>
>> In your management profile allow OCL expressions to be
>>
>> ... value="some-ocl-expression" ....
>>
>> Regards
>>
>> Ed Willink
>>
>> Andreas Maier wrote:
>>> Hi,
>>> I am working on a definition of an XML based representation of DMTF
>>> management profiles. Such profiles are able to define constraints on
>>> the CIM classes they use in the profile. We are already able to
>>> specify OCL constraints on the CIM classes, but there is some
>>> resistance in accepting a text based language like OCL in a otherwise
>>> XML representation.
>>>
>>> Therefore, I am i nsearch of a XML representation of OCL. That is, an
>>> OCL constraint would be represented in some XML syntax, but the OCL
>>> semantics would still be maintained.
>>>
>>> -> Does anyone know about prior work in this direction ?
>>>
>>> I ran across MathML from the W3C, which seems to provide a reasonable
>>> framework for the XML constructs, and it contains a rich set of
>>> mathematical operations including some (or probably most) of those
>>> that are defined in OCL, but it is not clear to me at a first glance
>>> how objects and their elements (basically the elements in a UML user
>>> model) could be referenced in MathML.
>>>
>>> -> Does anyone know about prior work to use MathML for defining
>>> constraints on UML user models ?
>>>
>>> Andy
XML representation of OCL constraints ? [message #489303 is a reply to message #489188] Fri, 02 October 2009 10:28 Go to previous message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Ed,
thanks for the good thoughts and pointers.

No, I have not considered BPEL (shame on me ... the authors sit in the
next building here in the Boeblingen IBM Lab ...), I should probably
take a look at it.

Andy

Ed Willink wrote:
> Hi Andreas
>
> MDT/OCL provides a validator.
>
> If you're using XML then syntax checking is irrelevant. Semantic
> checking is close to validation.
>
> I always recommend Jos Warmer and Anneke Kleppe's book for OCL;
> certainly not the specification. You will find at the back that it
> offers an alternate business oriented syntax. Perhaps you want to
> define a new new lightweight XML source syntax. EMF will give
> you a fair amount of support for it, GMF even more. A modest
> tranlation would then yield a true OCL AST and enable all the
> OCL evaluation tooling.
>
> Have you considered BPEL?
>
> Regards
>
> Ed Willink
>
Previous Topic:EnumerationLiterals?
Next Topic:Overriding oclIsUndefined method?
Goto Forum:
  


Current Time: Thu Apr 25 01:55:58 GMT 2024

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

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

Back to the top