Some of you know that I am working on an implementation of a structured-text language in the ORM/SBVR family. After more than a year of work, I'd like to report some recent milestones.
The CQL Data Definition Language is complete but for most external constraints, which I'm working on completing now. I can dump any nORMa model to CQL, and I can generate Ruby code for an object-oriented API to manage the fact populations allowed by the model. I can also compile the CQL, emitting either the same CQL or the same Ruby code, except where the Ruby code depends on constraints that were not converted in the first instance. The generated Ruby code doesn't yet enforce any constraints other than those implied by its structure.
In some cases, nORMa models require additional readings or changes in the wording of readings to allow CQL to parse the input. For example, it's not legal to use names of existing concepts (entity types or value types) as linking words in a reading; such names may only be used where the implied concept is intended.
The generators make use of Ruby code to store a compiled model, and
this code is itself generated from a nORMa (or CQL!) meta-model. My metamodel adopts relevant terminology from SBVR, so rather than use "model" or "schema", I use "vocabulary". I also use the term "concept" to denote a object type (entity type or value type). The metamodel also includes a number of extensions to the core ORM2 concepts, such as units for value types, ability to import (and alias concepts from) external vocabularies. These features aren't yet implemented in the CQL language yet. However, I believe that my metamodel is a suitable basis for evolving a shared understanding of fact orientation, and I'd welcome this discussion to be re-opened by anyone with an interest in improving it.
After completing the external constraints, I will implement relational mapping and conceptual queries (most query syntax is already recognised), and the generated Ruby data management code will be wired up to retrieve, modify and save data from the relational database.
In the meantime, I plan to make the nORMa->CQL converter available as a web service through my website http://dataconstellation.com. Until I do that, feel free to make contact with me by emailing firstname.lastname@example.org, and send me an nORMa file if you want to know how your model will look in CQL.
At present, almost all of the implementation of CQL is open source, hosted on rubyforge.org as the ActiveFacts project. The Ruby version of these tools will always be open source, but in future, I envisage commercialising application generators for languages other than Ruby, so if you would take objection to helping me in such an endeavour, please refrain! I need some way to rationalise the many months of effort that have gone into the tools so far.
I'll follow up with a couple of simple examples of CQL, and leave it to you to comment.