New opportunities in life

written by Raphael

As of today I'm no longer an employee at empuxa GmbH. I terminated my contract about a month ago and can't help but feel relieved - the last days before my abrogation where very unpleasant. I'd like to thank my dear girlfriend, our friends and families for seeing this through with me. Thank you, all of you.

This new won freedom holds many opportunities for me. I've been working on my bachelor thesis for six weeks now and I'm making some progress. There's also some new commissional work which will keep me busy the next few weeks. As soon as I have something presentable I'll post it here.

Aside, I'm going to spend some time improving my Mac OS X development skills to implement some of my own ideas. The future looks good :-)


A first presentation

written by Raphael

This monday I had my first presentation of my bachelor thesis about the 'Transformation of OCL to Schematron'. Needless to say that I have been incredible nervous about this because I was not sure if I had worked hard enough the first month. It turned out that there were no major concerns with my thesis. Lucky me :)

The basic approach to the transformation stayed the same - I just added some specific tidbits. Here's a small excerpt from my presentation:

The first images presents how I am planning on working on my bachelor thesis. I'd like to see my thesis as an iterative process which consists of:

  1. thinking about how to transform a small piece of OCL to Schematron
  2. trying to program the small transformation
  3. evaluate if the transformation matches all my needs

bachelor thesis planning

The second images presents the transformation itself:

  1. parse OCL input file
    • split input into single OCL expressions
    • type those OCL expressions according to OCL ConcreteSyntax
  2. transform single OCL expressions according to given transformation rules
  3. create Schematron output file

OCL transformation


Thoughts on my bachelor thesis

written by Raphael

The practical part of my bachelor thesis is a program that takes OCL rules as input and transforms these rules into Schematron; it transforms constraints defined on top of UML models into constraints defined on top of XML data.

At first I wanted to write my own LALR-Parser for OCL, parse the input into one parse tree and then serialize this tree into the corresponding Schematron output. The major problem is that a LALR-Parser for OCL, even a generated one, seems to take up too much time to develop and test; plus the only LALR-Parser Generator for Ruby, racc, does not work for me at the time of this writing.

My new approach looks somewhat different and utilizes the OCL expression definitions as given in the v2.2 standard document.

  1. Parse EBNF definitions for OCL using the CPAN Parse::EBNF module
  2. Parse OCL input file; represent each constraint as a (context, expression) pair
  3. Match all expressions with their corresponding OCL expression definition
  4. Match all context with their corresponding XPath2 expression
  5. Serialize all pairs, prepending Schematron header, appending Schematron footers, grouping pairs by context

Given I find a practical way to match the Concrete Syntax of OCL into Schematron rules this approach should work just fine.

I'm currently working on a small prototype which transforms the following OCL rule

context Person inv: self.Age >= 0

into its Schematron equivalent:

<?xml version="1.0" encoding="utf-8"?>
<schema
  xmlns="http://purl.oclc.org/dsdl/schematron"
  queryBinding='xslt2'
  schemaVersion='ISO19757-3'>
  <title>generated Schematron transformation</title>
  <pattern>
    <rule context="Person">
      <assert test="(attribute(age) cast as xs:integer) ge 0">
        self.Age >= 0
      </assert>
    </rule>
  </pattern>
</schema>

The OCL definition parsing works great. I'm currently working on extracting the (context, expression) pairs from the input and matching the expressions with a given OCL expression.

There's still plenty of work ahead, and I'm not sure how to handle more complexe OCL expressions yet...