ActiveFacts Project Status

Constellation Query Language

The Constellation Query Language implementation available in version 0.8.5 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 Constraints, Presence Constraints (which covers Mandatory, Uniqueness, and Frequency constraints), Subset, Equality, Exclusion, Mandatory Exclusion, and Ring constraints.

At this version Terms (object type names) may not contain spaces. Terms may not appear in readings (unless in lower-case) and readings may only contain single adjectives (hyphen-binding). Deontic constraints are recognised using the annotation (otherwise action). Join Constraints may also be defined beyond those available in NORMA. Example data may be declared.

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

New features are being developed for an upcoming 0.9.0 release:

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, 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 retract operation (which removes facts from a constellation) does not yet propagate retraction 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 semantic 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.