Overview
ADL uses three syntaxes, cADL (constraint form of ADL), ODIN (Object Data Instance Notation), and openEHR Expression Language (EL), to express constraints on data which are instances of an underlying information model, which may be expressed in UML, relational form, or in a programming language. ADL itself is a very simple 'glue' syntax, which uses two other syntaxes for expressing structured constraints and data, respectively. The cADL syntax is used to express the archetype definition section, while the ODIN syntax is used to express data which appears in the language, description, and terminology sections of an ADL archetype. The top-level structure of an ADL archetype is shown in the figure below.
This main part of this document describes cADL and ADL path syntax, before going on to describe the combined ADL syntax, archetypes, specialisation, terminology integration and templates.
An Example
The following is an example of a very simple archetype, giving a feel for the syntax. The main point to glean from the following is that the notion of 'guitar' is defined in terms of constraints on a generic model of the concept "INSTRUMENT". The names mentioned down the left-hand side of the definition section (INSTRUMENT, size etc) are alternately class and attribute names from an object model. Each block of braces encloses a specification for some particular set of instances that conform to a specific concept, such as 'guitar' or 'neck', defined in terms of constraints on types from a generic class model. The leaf pairs of braces enclose constraints on primitive types such as Integer, String, Boolean and so on.
archetype (adl_version=2.0.5; rm_release=1.1.5)
adl-test-instrument.guitar.v1.0.4
language
original_language = <[iso_639-1::en]>
definition
INSTRUMENT[id1] matches {
size matches {|60..120|} -- size in cm
date_of_manufacture matches {yyyy-mm-??} -- year & month ok
parts cardinality matches {0..*} matches {
PART[id2] matches { -- neck
material matches {[ac1]} -- timber or nickel alloy
}
PART[id3] matches { -- body
material matches {[at3]} -- timber
}
}
}
terminology
term_definitions = <
["en"] = <
["id1"] = <
text = <"guitar">;
description = <"stringed instrument">
>
["id2"] = <
text = <"neck">;
description = <"neck of guitar">
>
["id3"] = <
text = <"body">;
description = <"body of guitar">
>
["at3"] = <
text = <"timber">;
description = <"straight, seasoned timber">
>
["at4"] = <
text = <"nickel alloy">;
description = <"frets">
>
>
>
value_sets = <
["ac1"] = <
id = <"ac1">
members = <"at3", "at4">
>
>
>