Latest Specifications

Documentation

Get Involved

Tutorials

Downloads

Users / Vendors

HSBC
Model Two Zero
FireStar Software

NRL: The Natural Rule Language

The Natural Rule Language is a model-driven language aimed at improving quality and time to market in integration projects. It enables users to constrain, modify and map data in diverse formats. NRL works at a high level, and is designed for automatic translation to execution languages.

NRL's main remit is to provide a user-friendly alternative to languages like OCL, XSLT, XPath, Schematron, and many others, particularly in scenarios where they would be considered too technical.

NRL is:

  • An open specification - click the links on the left.
  • Readable - hence a safe investment. If you discard an NRL-based product tomorrow, you are left with readable specifications.
  • Relatively model-independent: it can express constraints over UML and XML Schema, for example.
  • Designed for translation to target languages - the abstract syntax is clearly, and fully specified, and can be mapped to Java, XSLT, and so on.

Getting Started

Take a look at the basic user guide to get started. Download a copy of the NRL Parser to parse NRL and create translations to your target language.

Status and Usage

Implementations of NRL have been used in production environments in financial services since 2006, and run business critical applications. While the languages is continually being improved, it is mature and proven.

Here are some of the things that have been done using NRL:

  • The validation rules of FpML have been expressed in NRL, and are a rule reference implementation for the standard from version 4.6 onwards. See here.
  • Many very large XML to XML mappings - on the order of 600 rules per mapping - have been completed using the NRL action language.
  • Routing rules for XML flows have been expressed using NRL: constraints control which destination can accept messages.

Here is what you can do with NRL:

  • Use it to constrain your models.
  • Use it to modify / enrich your models (using the action language).
  • Build it into your application wherever you use scripting right now, and your application will become more accessible.
  • Use model-based generation in some of the few cases where it will work very well.

Background and People

NRL was first conceived in 2005 as an alternative English-like syntax for the CLiX constraint language for XML. It was extended from 2006 to replace OCL in an environment where OCL was not appropriate. The action language was added in 2007, to meet frequent demands for modifying data in response to validation. It has since grown into a more complete language that can be used for tasks like enrichment and mapping.

The initial specifications were written by Christian Nentwich (Model Two Zero) and Rob James (HSBC). Over the years, the following people have provided valuable feedback and input:

  • Dave Carlson
  • Peter Geraghty
  • Serdar Sokmen

Contact

Any questions, write to christian AT modeltwozero.com (Christian Nentwich) or lostamigo AT gmail.com (Rob James).

Get Natural Rule Language at SourceForge.net. Fast, secure and Free Open Source software downloads

Latest News

  • April 11, 2011: Code generator tutorial written by Adriana Alexandru released.
  • March 11, 2011: Parser version 1.4.1 released (release notes).
  • April 7, 2010: NRL version 1.4 released, specifications and parsers updated. Action language parser and XML Schema mode loaders now open source.
  • March 5, 2010: Action language parser and XML Schema model loaders to be open source from version 1.4, donated by Model Two Zero.
  • November 15, 2009: Site cleaned up. Parser release package 1.3.1 available for download.
  • October 8, 2009: OMG's MDMI Specification v1.0 is adopted; uses NRL in proof-of-concept mappings.
  • March 18, 2009: Versions 1.3.1 of constraint and action language released.