ActiveFacts Project Status

Constellation Query Language

The Constellation Query Language implementation available in version 0.8.8 compiles all features of ORM2 implemented by NORMA with only minuscule differences. Entity Types, Value Types, Fact Types (including objectified), Reference Modes, and all types of constraints - Value and Role Value Restriction, Presence Constraints (which covers Mandatory, Uniqueness, and Frequency constraints), Subset, Equality, Exclusion, Mandatory Exclusion, and Ring constraints.

This version allows Terms (object type names) to contain spaces, but the generators sometimes remove (or fail to remove) spaces in situations they shouldn't. Multiple adjectives are also supported, and adjectives need to be hyphenated in only one occurrence in a definition. Join Constraints are handled incorrectly in some cases (as before), but now you get a warning (even sometimes when the behaviour is correct). Hyphenated non-terms (like semi-trailer) are now allowed.

This version provides functionality not available in NORMA. Additions include:

  • Business Context Notes, which are annotations indicating why a particular modeling construct was used, and who approved that.
  • Definition of Units using conversion formulae. A library of 500 standard unit conversions is provided.
  • Value Types may be defined to utilise those units.

These features must be completed for the upcoming 0.9.0 release:

  • Term Synonyms
  • Imported vocabularies (including multi-lingual versioning)
  • Improved model validation

Beyond that, the query syntax will be completed and queries will be generated to SQL.

Constellation Query Language generators

The CQL generator allows conversion of NORMA files. At the present release, deontic constraints and example fact populations are not emitted.

The Ruby generator is functional. Not all constraints are emitted to Ruby yet, but any combination of facts allowed by the vocabulary may be represented.

The SQL generators are generating correct and useful SQL, using a relational mapping algorithm that produces similar results to NORMA. This algorithm will be extended to emit more constraints, and to provide more control over the generation of object names (sometimes column name conflicts can occur due to excessive name contraction), and to directly support Ruby on Rails. Deontic constraints are still handled as Alethic.

The Constellation API

The Constellation API (in Ruby) supports the generated Ruby code, by allowing any fact population to be asserted into a constellation for a given vocabulary. The generated Ruby module for a vocabulary can be told which object types are tables in the SQL, and can infer all the column names and object mappings from that.

Processing of the deny operation (which removes facts from a constellation) does not yet propagate denial through mandatory roles. There is not yet a validate operation to verify that all verifible constraints are met. Where a constellation is known to be incomplete, that's not yet able to be recorded (this will be used in determining which constraints can be checked) There is not yet any support within the API for database persistence (creating a constellation from query results, and creating, deleting or updating database rows by saving a constellation).

The ORM2 Metamodel

The ORM2 Metamodel is generated to Ruby from CQL or ORM2 to support the creation and manipulation of any fact-based model. Some changes are upcoming to support synonyms, including allowing a vocabulary to provide a translation of an existing vocabulary, such as a Dutch or Japanese version of an English language model. Diagrams can now be modelled in the metamodel.