Model Structure

Overview

The core package defines the main BMM meta-model, within which the model sub-package defines the top-level structure of a model which is an instance of the BMM. The UML for this package is shown below.

LANG bmm.core.model
Figure 1. base.bmm.core.model Package - Model structure

Naming Convention

In a BMM model, names typically appear in the common case-sensitive form used by the model users, and may therefore follow one of a number of common conventions, including 'camel case', 'snake-case' and so on. When used computationally within an instantiated BMM model, it is assumed that case-insensitive matching is used. This means that the class name "Hashable" refers to the same class as "HASHABLE". Note however that underscores are not removed during matching, so that the classes "HashMap" and "HASH_MAP" are understood as different classes.

a future version of BMM may define an option to import schemas using differing naming styles, with transformation into a single style for the target model.

Model Semantics

In BMM, a model is understood as a set of package and module definitions that are developed and maintained as a unit, by some organisation, and usually having an associated hierarchical namespace. The abstract BMM_MODULE class is the ancestor for any kind of module, which is understood as a container for features of various kinds, including the usual properties, routines, and so on. A BMM model is structured in the same general way as a UML model, i.e. with a hierarchical package containment structure and a set of module definitions, where a commonly used type of module is the class. The following illustrates the structure of a typical 'class' or 'object' model.

bmm structure
Figure 2. BMM model structure

The BMM_MODEL class defines the single instance of each distinct BMM model that may exist within a collection of models, such as shown in the model_access package above. It provides an interface that enables any class definition to be retrieved, as well as various accessor functions to interrogate the model. A BMM Model has a name (the inherited name attribute) that is used to identify the model as a whole within a system using multiple models. It contains a number of other meta-data attributes describing authorship etc, and otherwise contains a list of package and class definitions.

Packages

In BMM, packages have the same role as in UML - as non-semantic organisational logical containers of classes, usually corresponding to file system folders in software implementations. They provide an organisational convenience, and in an instantiated BMM model, contain references to class definitions. A model validity checker ensures that every class is contained within exactly one package.

Package paths are only used in BMM to specify package structures in the serialised form in an efficient way, i.e. by using paths to avoid defining a hierarchy in which only lower packages contain classes. They are not used as namespaces as in UML. Consequently, all classes in a BMM model should be uniquely named.

Use of other Models

A model may use another model. This is the same kind of relationship denoted by the 'import' keyword in many programming languages. In BMM, the use of other models is declared once only, in the using model, rather than on a per-class level as in some languages (e.g. Java). The use of another model makes its contents available for use in declarations (e.g. inheritance) and expressions within the using model. This is achieved by populating the BMM_CLASS.scope attribute with a reference to the used model. In a serial form, a typical syntax such as other_model_name::Class would be used.

Documentation

A documentation attribute is inherited from BMM_MODEL_ELEMENT into BMM_MODULE, BMM_FEATURE and `BMM_PACKAGE_CONTAINER, enabling packages, classes, routines and properties to be individually documented using a keyed table (i.e. Hash) of values.

It is strongly recommended to use the following key /type combinations for the relevant purposes:

  • "purpose": String

  • "keywords": List<String>

  • "use": String

  • "misuse": String

  • "references": String

Other keys and value types may be freely added.

Other Meta-data

The BMM_MODEL_ELEMENT meta-class also defines the attribute extensions of type Hash<String, Any>, to enable representation of meta-data of any type on any model node. This provides a means of extending BMM.

The Any Class and Type

While a BMM model defines a model in terms of class declarations, it must always have a top class named Any from which all others inherit. Similar to the root class in a typical OOPL type systems (sometimes called 'Object'), the Any class defines semantics true for all objects such as equality (i.e. semantics for an '=' operator) and copying.

A BMM model may define its own Any class, but if it does not, the BMM_MODEL instance representing the model will produce a standard 'Any' class via the any_class_definition() method. This will create the following structure, including a default package structure, and an Any type.

LANG bmm any class
Figure 3. Default Any class

The Any type defined by the model’s Any class, or else the default one above, will be used as the inheritance parent for every class in the model that doesn’t have any other inheritance parent. As a result, the inheritance graph will always have the Any type as its top node.

Class Definitions

BMM_PACKAGE_CONTAINER Class

  • Definition

  • Effective

  • BMM

  • UML

Class

BMM_PACKAGE_CONTAINER (abstract)

Description

A BMM model component that contains packages and classes.

Inherit

BMM_DECLARATION

Attributes

Signature

Meaning

0..1

packages: Hash <String ,BMM_PACKAGE>

Child packages; keys all in upper case for guaranteed matching.

1..1
(redefined)

scope: BMM_PACKAGE_CONTAINER

Model element within which a referenceable element is known.

Functions

Signature

Meaning

0..1

package_at_path (
a_path: String [1]
): BMM_PACKAGE

Package at the path a_path.

1..1

do_recursive_packages (
action: EL_PROCEDURE_AGENT[1]
): void

Recursively execute action, which is a procedure taking a BMM_PACKAGE argument, on all members of packages.

1..1

has_package_path (
a_path: String [1]
): `Boolean `

True if there is a package at the path a_path; paths are delimited with delimiter {BMM_DEFINITIONS}_Package_name_delimiter_.

BMM_PACKAGE_CONTAINER (abstract)

A BMM model component that contains packages and classes.

Inherits: BMM_DECLARATION

Attributes

name: `String ` [1..1]

Name of this model element.
Inherited from BMM_DECLARATION

documentation: Hash <String ,Any > [0..1]

Optional documentation of this element, as a keyed list.

It is strongly recommended to use the following key /type combinations for the relevant purposes:

  • "purpose": String

  • "keywords": List<String>

  • "use": String

  • "misuse": String

  • "references": String

Other keys and value types may be freely added.
Inherited from BMM_DECLARATION

scope: BMM_PACKAGE_CONTAINER [1..1]

Model element within which a referenceable element is known.

extensions: Hash <String ,Any > [0..1]

Optional meta-data of this element, as a keyed list. May be used to extend the meta-model.
Inherited from BMM_DECLARATION

packages: Hash <String ,BMM_PACKAGE> [0..1]

Child packages; keys all in upper case for guaranteed matching.

Functions

is_root_scope (): Boolean `

Post_result: `Result = (scope = self)
[1..1]

True if this declaration entity is the root of the declaration hierarchy.
Inherited from BMM_DECLARATION

package_at_path (
a_path: String [1]
): BMM_PACKAGE [0..1]

Package at the path a_path.

do_recursive_packages (
action: EL_PROCEDURE_AGENT[1]
): void [1..1]

Recursively execute action, which is a procedure taking a BMM_PACKAGE argument, on all members of packages.

has_package_path (
a_path: String [1]
): `Boolean ` [1..1]

True if there is a package at the path a_path; paths are delimited with delimiter {BMM_DEFINITIONS}_Package_name_delimiter_.

{
    "name": "BMM_PACKAGE_CONTAINER",
    "documentation": "A BMM model component that contains packages and classes.",
    "is_abstract": true,
    "ancestors": [
        "BMM_DECLARATION"
    ],
    "properties": {
        "packages": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "packages",
            "documentation": "Child packages; keys all in upper case for guaranteed matching.",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "BMM_PACKAGE"
                ]
            }
        },
        "scope": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "scope",
            "documentation": "Model element within which a referenceable element is known.",
            "is_mandatory": true,
            "type": "BMM_PACKAGE_CONTAINER"
        }
    },
    "functions": {
        "package_at_path": {
            "name": "package_at_path",
            "documentation": "Package at the path `_a_path_`.",
            "parameters": {
                "a_path": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_path",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_PACKAGE"
            },
            "is_nullable": true
        },
        "do_recursive_packages": {
            "name": "do_recursive_packages",
            "documentation": "Recursively execute `_action_`, which is a procedure taking a `BMM_PACKAGE` argument, on all members of packages.",
            "parameters": {
                "action": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "action",
                    "type": "EL_PROCEDURE_AGENT"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "void"
            }
        },
        "has_package_path": {
            "name": "has_package_path",
            "documentation": "True if there is a package at the path `_a_path_`; paths are delimited with delimiter `{BMM_DEFINITIONS}_Package_name_delimiter_`.",
            "parameters": {
                "a_path": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_path",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        }
    }
}
bmm package container

BMM_PACKAGE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

BMM_PACKAGE

Description

Abstraction of a package as a tree structure whose nodes can contain other packages and classes.

The name may be qualified if it is a top-level package.

Inherit

BMM_PACKAGE_CONTAINER

Attributes

Signature

Meaning

0..1

classes: List <BMM_CLASS>

Classes listed as being in this package.

Functions

Signature

Meaning

0..1

root_classes (): List <BMM_CLASS>

Obtain the set of top-level classes in this package, either from this package itself or by recursing into the structure until classes are obtained from child packages. Recurse into each child only far enough to find the first level of classes.

1..1

path (): `String `

Full path of this package back to root package.

BMM_PACKAGE

Abstraction of a package as a tree structure whose nodes can contain other packages and classes.

The name may be qualified if it is a top-level package.

Inherits: BMM_DECLARATION, BMM_PACKAGE_CONTAINER

Attributes

name: `String ` [1..1]

Name of this model element.
Inherited from BMM_DECLARATION

documentation: Hash <String ,Any > [0..1]

Optional documentation of this element, as a keyed list.

It is strongly recommended to use the following key /type combinations for the relevant purposes:

  • "purpose": String

  • "keywords": List<String>

  • "use": String

  • "misuse": String

  • "references": String

Other keys and value types may be freely added.
Inherited from BMM_DECLARATION

scope: BMM_PACKAGE_CONTAINER [1..1]

Model element within which a referenceable element is known.
Inherited from BMM_PACKAGE_CONTAINER

extensions: Hash <String ,Any > [0..1]

Optional meta-data of this element, as a keyed list. May be used to extend the meta-model.
Inherited from BMM_DECLARATION

packages: Hash <String ,BMM_PACKAGE> [0..1]

Child packages; keys all in upper case for guaranteed matching.
Inherited from BMM_PACKAGE_CONTAINER

classes: List <BMM_CLASS> [0..1]

Classes listed as being in this package.

Functions

is_root_scope (): Boolean `

Post_result: `Result = (scope = self)
[1..1]

True if this declaration entity is the root of the declaration hierarchy.
Inherited from BMM_DECLARATION

package_at_path (
a_path: String [1]
): BMM_PACKAGE [0..1]

Package at the path a_path.
Inherited from BMM_PACKAGE_CONTAINER

do_recursive_packages (
action: EL_PROCEDURE_AGENT[1]
): void [1..1]

Recursively execute action, which is a procedure taking a BMM_PACKAGE argument, on all members of packages.
Inherited from BMM_PACKAGE_CONTAINER

has_package_path (
a_path: String [1]
): `Boolean ` [1..1]

True if there is a package at the path a_path; paths are delimited with delimiter {BMM_DEFINITIONS}_Package_name_delimiter_.
Inherited from BMM_PACKAGE_CONTAINER

root_classes (): List <BMM_CLASS> [0..1]

Obtain the set of top-level classes in this package, either from this package itself or by recursing into the structure until classes are obtained from child packages. Recurse into each child only far enough to find the first level of classes.

path (): `String ` [1..1]

Full path of this package back to root package.

{
    "name": "BMM_PACKAGE",
    "documentation": "Abstraction of a package as a tree structure whose nodes can contain other packages and classes.\n\nThe `_name_` may be qualified if it is a top-level package.",
    "ancestors": [
        "BMM_PACKAGE_CONTAINER"
    ],
    "properties": {
        "classes": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "classes",
            "documentation": "Classes listed as being in this package.",
            "type_def": {
                "container_type": "List",
                "type": "BMM_CLASS"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "root_classes": {
            "name": "root_classes",
            "documentation": "Obtain the set of top-level classes in this package, either from this package itself or by recursing into the structure until classes are obtained from child packages. Recurse into each child only far enough to find the first level of classes.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "BMM_CLASS"
            },
            "is_nullable": true
        },
        "path": {
            "name": "path",
            "documentation": "Full path of this package back to root package.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        }
    }
}
bmm package

BMM_MODEL Class

  • Definition

  • Effective

  • BMM

  • UML

Class

BMM_MODEL

Description

Definition of the root of a BMM model (along with what is inherited from BMM_SCHEMA_CORE).

Inherit

BMM_PACKAGE_CONTAINER, BMM_MODEL_METADATA

Attributes

Signature

Meaning

0..1

class_definitions: Hash <String ,BMM_CLASS>

All classes in this model, keyed by type name.

0..1

used_models: List <BMM_MODEL>

List of other models 'used' (i.e. 'imported' by this model). Classes in the current model may refer to classes in a used model by specifying the other class’s scope meta-attribute.

Functions

Signature

Meaning

1..1

model_id (): `String `

Identifier of this model, lower-case, formed from:

<rm_publisher>_<model_name>_<rm_release>

E.g. "openehr_ehr_1.0.4".

1..1

class_definition (
a_name: String [1]
): BMM_CLASS

Retrieve the class definition corresponding to a_type_name (which may contain a generic part).

1..1

type_definition (): BMM_CLASS

Retrieve the class definition corresponding to a_type_name. If it contains a generic part, this will be removed if it is a fully open generic name, otherwise it will remain intact, i.e. if it is an effective generic name that identifies a BMM_GENERIC_CLASS_EFFECTIVE.

1..1

has_class_definition (
a_class_name: String [1]
): `Boolean `

True if a_class_name has a class definition in the model.

1..1

has_type_definition (
a_type_name: String [1]
): `Boolean `

True if a_type_name is already concretely known in the system, including if it is generic, which may be open, partially open or closed.

1..1

enumeration_definition (
a_name: String [1]
): BMM_ENUMERATION

Retrieve the enumeration definition corresponding to a_type_name.

0..1

primitive_types (): List <String >

List of keys in class_definitions of items marked as primitive types.

0..1

enumeration_types (): List <String >

List of keys in class_definitions of items that are enumeration types.

1..1

property_definition (): BMM_PROPERTY

Retrieve the property definition for a_prop_name in flattened class corresponding to a_type_name.

1..1

ms_conformant_property_type (
a_bmm_type_name: String [1],
a_bmm_property_name: String [1],
a_ms_property_name: String [1]
): `Boolean `

True if a_ms_property_type is a valid 'MS' dynamic type for a_property in BMM type a_bmm_type_name. 'MS' conformance means 'model-semantic' conformance, which abstracts away container types like List<>, Set<> etc and compares the dynamic type with the relation target type in the UML sense, i.e. regardless of whether there is single or multiple containment.

1..1

property_definition_at_path (): BMM_PROPERTY

Retrieve the property definition for a_property_path in flattened class corresponding to a_type_name.

1..1

class_definition_at_path (
a_type_name: String [1],
a_prop_path: String [1]
): BMM_CLASS

Retrieve the class definition for the class that owns the terminal attribute in a_prop_path in flattened class corresponding to a_type_name.

0..1

all_ancestor_classes (
a_class: String [1]
): List <String >

Return all ancestor types of a_class_name up to root class (usually Any, Object or something similar). Does not include current class. Returns empty list if none.

1..1

is_descendant_of (
a_class_name: String [1],
a_parent_class_name: String [1]
): `Boolean `

True if a_class_name is a descendant in the model of a_parent_class_name.

1..1

type_conforms_to (
a_desc_type: String [1],
an_anc_type: String [1]
): `Boolean `

Check conformance of a_desc_type to an_anc_type; the types may be generic, and may contain open generic parameters like 'T' etc. These are replaced with their appropriate constrainer types, or Any during the conformance testing process.

Conformance is found if:

  • [base class test] types are non-generic, and either type names are identical, or else a_desc_type has an_anc_type in its ancestors;

  • both types are generic and pass base class test; number of generic params matches, and each generic parameter type, after 'open parameter' substitution, recursively passes; type_name_conforms_to test

  • descendant type is generic and ancestor type is not, and they pass base classes test.

1..1

subtypes (
a_type: String [1]
): List <String >

Generate type substitutions for the supplied type, which may be simple, generic (closed, open or partially open), or a container type. In the generic and container cases, the result is the permutation of the base class type and type substitutions of all generic parameters.

Parameters
a_type

Name of a type.

1..1

any_class_definition (): BMM_SIMPLE_CLASS

BMM_SIMPLE_CLASS instance for the Any class. This may be defined in the BMM schema, but if not, use BMM_DEFINITIONS.any_class.

1..1

any_type_definition (): BMM_SIMPLE_TYPE

BMM_SIMPLE_TYPE instance for the Any type.

1..1

boolean_type_definition (): BMM_SIMPLE_TYPE

BMM_SIMPLE_TYPE instance for the Boolean type.

Invariants

Inv_top_level_scope: scope = self

BMM_MODEL

Definition of the root of a BMM model (along with what is inherited from BMM_SCHEMA_CORE).

Inherits: BMM_DECLARATION, BMM_PACKAGE_CONTAINER, BMM_MODEL_METADATA

Attributes

name: `String ` [1..1]

Name of this model element.
Inherited from BMM_DECLARATION

documentation: Hash <String ,Any > [0..1]

Optional documentation of this element, as a keyed list.

It is strongly recommended to use the following key /type combinations for the relevant purposes:

  • "purpose": String

  • "keywords": List<String>

  • "use": String

  • "misuse": String

  • "references": String

Other keys and value types may be freely added.
Inherited from BMM_DECLARATION

scope: BMM_PACKAGE_CONTAINER [1..1]

Model element within which a referenceable element is known.
Inherited from BMM_PACKAGE_CONTAINER

extensions: Hash <String ,Any > [0..1]

Optional meta-data of this element, as a keyed list. May be used to extend the meta-model.
Inherited from BMM_DECLARATION

packages: Hash <String ,BMM_PACKAGE> [0..1]

Child packages; keys all in upper case for guaranteed matching.
Inherited from BMM_PACKAGE_CONTAINER

rm_publisher: `String ` [1..1]

Publisher of model expressed in the schema.
Inherited from BMM_MODEL_METADATA

rm_release: `String ` [1..1]

Release of model expressed in the schema as a 3-part numeric, e.g. "3.1.0" .
Inherited from BMM_MODEL_METADATA

class_definitions: Hash <String ,BMM_CLASS> [0..1]

All classes in this model, keyed by type name.

used_models: List <BMM_MODEL> [0..1]

List of other models 'used' (i.e. 'imported' by this model). Classes in the current model may refer to classes in a used model by specifying the other class’s scope meta-attribute.

Functions

is_root_scope (): Boolean `

Post_result: `Result = (scope = self)
[1..1]

True if this declaration entity is the root of the declaration hierarchy.
Inherited from BMM_DECLARATION

package_at_path (
a_path: String [1]
): BMM_PACKAGE [0..1]

Package at the path a_path.
Inherited from BMM_PACKAGE_CONTAINER

do_recursive_packages (
action: EL_PROCEDURE_AGENT[1]
): void [1..1]

Recursively execute action, which is a procedure taking a BMM_PACKAGE argument, on all members of packages.
Inherited from BMM_PACKAGE_CONTAINER

has_package_path (
a_path: String [1]
): `Boolean ` [1..1]

True if there is a package at the path a_path; paths are delimited with delimiter {BMM_DEFINITIONS}_Package_name_delimiter_.
Inherited from BMM_PACKAGE_CONTAINER

model_id (): `String ` [1..1]

Identifier of this model, lower-case, formed from:

<rm_publisher>_<model_name>_<rm_release>

E.g. "openehr_ehr_1.0.4".

class_definition (
a_name: String [1]
): BMM_CLASS [1..1]

Retrieve the class definition corresponding to a_type_name (which may contain a generic part).

type_definition (): BMM_CLASS [1..1]

Retrieve the class definition corresponding to a_type_name. If it contains a generic part, this will be removed if it is a fully open generic name, otherwise it will remain intact, i.e. if it is an effective generic name that identifies a BMM_GENERIC_CLASS_EFFECTIVE.

has_class_definition (
a_class_name: String [1]
): `Boolean ` [1..1]

True if a_class_name has a class definition in the model.

has_type_definition (
a_type_name: String [1]
): `Boolean ` [1..1]

True if a_type_name is already concretely known in the system, including if it is generic, which may be open, partially open or closed.

enumeration_definition (
a_name: String [1]
): BMM_ENUMERATION [1..1]

Retrieve the enumeration definition corresponding to a_type_name.

primitive_types (): List <String > [0..1]

List of keys in class_definitions of items marked as primitive types.

enumeration_types (): List <String > [0..1]

List of keys in class_definitions of items that are enumeration types.

property_definition (): BMM_PROPERTY [1..1]

Retrieve the property definition for a_prop_name in flattened class corresponding to a_type_name.

ms_conformant_property_type (
a_bmm_type_name: String [1],
a_bmm_property_name: String [1],
a_ms_property_name: String [1]
): `Boolean ` [1..1]

True if a_ms_property_type is a valid 'MS' dynamic type for a_property in BMM type a_bmm_type_name. 'MS' conformance means 'model-semantic' conformance, which abstracts away container types like List<>, Set<> etc and compares the dynamic type with the relation target type in the UML sense, i.e. regardless of whether there is single or multiple containment.

property_definition_at_path (): BMM_PROPERTY [1..1]

Retrieve the property definition for a_property_path in flattened class corresponding to a_type_name.

class_definition_at_path (
a_type_name: String [1],
a_prop_path: String [1]
): BMM_CLASS [1..1]

Retrieve the class definition for the class that owns the terminal attribute in a_prop_path in flattened class corresponding to a_type_name.

all_ancestor_classes (
a_class: String [1]
): List <String > [0..1]

Return all ancestor types of a_class_name up to root class (usually Any, Object or something similar). Does not include current class. Returns empty list if none.

is_descendant_of (
a_class_name: String [1],
a_parent_class_name: String [1]
): `Boolean ` [1..1]

True if a_class_name is a descendant in the model of a_parent_class_name.

type_conforms_to (
a_desc_type: String [1],
an_anc_type: String [1]
): `Boolean ` [1..1]

Check conformance of a_desc_type to an_anc_type; the types may be generic, and may contain open generic parameters like 'T' etc. These are replaced with their appropriate constrainer types, or Any during the conformance testing process.

Conformance is found if:

  • [base class test] types are non-generic, and either type names are identical, or else a_desc_type has an_anc_type in its ancestors;

  • both types are generic and pass base class test; number of generic params matches, and each generic parameter type, after 'open parameter' substitution, recursively passes; type_name_conforms_to test

  • descendant type is generic and ancestor type is not, and they pass base classes test.

subtypes (
a_type: String [1]
): List <String > [1..1]

Generate type substitutions for the supplied type, which may be simple, generic (closed, open or partially open), or a container type. In the generic and container cases, the result is the permutation of the base class type and type substitutions of all generic parameters.

Parameters
a_type

Name of a type.

any_class_definition (): BMM_SIMPLE_CLASS [1..1]

BMM_SIMPLE_CLASS instance for the Any class. This may be defined in the BMM schema, but if not, use BMM_DEFINITIONS.any_class.

any_type_definition (): BMM_SIMPLE_TYPE [1..1]

BMM_SIMPLE_TYPE instance for the Any type.

boolean_type_definition (): BMM_SIMPLE_TYPE [1..1]

BMM_SIMPLE_TYPE instance for the Boolean type.

Invariants

Inv_top_level_scope: scope = self

{
    "name": "BMM_MODEL",
    "documentation": "Definition of the root of a BMM model (along with what is inherited from `BMM_SCHEMA_CORE`).",
    "ancestors": [
        "BMM_PACKAGE_CONTAINER",
        "BMM_MODEL_METADATA"
    ],
    "properties": {
        "class_definitions": {
            "_type": "P_BMM_GENERIC_PROPERTY",
            "name": "class_definitions",
            "documentation": "All classes in this model, keyed by type name.",
            "type_def": {
                "root_type": "Hash",
                "generic_parameters": [
                    "String",
                    "BMM_CLASS"
                ]
            }
        },
        "used_models": {
            "_type": "P_BMM_CONTAINER_PROPERTY",
            "name": "used_models",
            "documentation": "List of other models 'used' (i.e. 'imported' by this model). Classes in the current model may refer to classes in a used model by specifying the other class's `_scope_` meta-attribute.",
            "type_def": {
                "container_type": "List",
                "type": "BMM_MODEL"
            },
            "cardinality": {
                "lower": 0,
                "upper_unbounded": true
            }
        }
    },
    "functions": {
        "model_id": {
            "name": "model_id",
            "documentation": "Identifier of this model, lower-case, formed from:\n\n`<rm_publisher>_<model_name>_<rm_release>`\n\nE.g. `\"openehr_ehr_1.0.4\"`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "String"
            }
        },
        "class_definition": {
            "name": "class_definition",
            "documentation": "Retrieve the class definition corresponding to `_a_type_name_` (which may contain a generic part).",
            "parameters": {
                "a_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_CLASS"
            }
        },
        "type_definition": {
            "name": "type_definition",
            "documentation": "Retrieve the class definition corresponding to `_a_type_name_`. If it contains a generic part, this will be removed if it is a fully open generic name, otherwise it will remain intact, i.e. if it is an effective generic name that identifies a `BMM_GENERIC_CLASS_EFFECTIVE`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_CLASS"
            }
        },
        "has_class_definition": {
            "name": "has_class_definition",
            "documentation": "True if `_a_class_name_` has a class definition in the model.",
            "parameters": {
                "a_class_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_class_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "has_type_definition": {
            "name": "has_type_definition",
            "documentation": "True if `_a_type_name_` is already concretely known in the system, including if it is generic, which may be open, partially open or closed.",
            "parameters": {
                "a_type_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_type_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "enumeration_definition": {
            "name": "enumeration_definition",
            "documentation": "Retrieve the enumeration definition corresponding to `_a_type_name_`.",
            "parameters": {
                "a_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_ENUMERATION"
            }
        },
        "primitive_types": {
            "name": "primitive_types",
            "documentation": "List of keys in `_class_definitions_` of items marked as primitive types.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            },
            "is_nullable": true
        },
        "enumeration_types": {
            "name": "enumeration_types",
            "documentation": "List of keys in `_class_definitions_` of items that are enumeration types.",
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            },
            "is_nullable": true
        },
        "property_definition": {
            "name": "property_definition",
            "documentation": "Retrieve the property definition for `_a_prop_name_` in flattened class corresponding to `_a_type_name_`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_PROPERTY"
            }
        },
        "ms_conformant_property_type": {
            "name": "ms_conformant_property_type",
            "documentation": "True if `_a_ms_property_type_` is a valid 'MS' dynamic type for `_a_property_` in BMM type `_a_bmm_type_name_`. 'MS' conformance means 'model-semantic' conformance, which abstracts away container types like `List<>`, `Set<>` etc and compares the dynamic type with the relation target type in the UML sense, i.e. regardless of whether there is single or multiple containment.",
            "parameters": {
                "a_bmm_type_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_bmm_type_name",
                    "type": "String"
                },
                "a_bmm_property_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_bmm_property_name",
                    "type": "String"
                },
                "a_ms_property_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_ms_property_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "property_definition_at_path": {
            "name": "property_definition_at_path",
            "documentation": "Retrieve the property definition for `_a_property_path_` in flattened class corresponding to `_a_type_name_`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_PROPERTY"
            }
        },
        "class_definition_at_path": {
            "name": "class_definition_at_path",
            "documentation": "Retrieve the class definition for the class that owns the terminal attribute in `a_prop_path` in flattened class corresponding to `a_type_name`.",
            "parameters": {
                "a_type_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_type_name",
                    "type": "String"
                },
                "a_prop_path": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_prop_path",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_CLASS"
            }
        },
        "all_ancestor_classes": {
            "name": "all_ancestor_classes",
            "documentation": "Return all ancestor types of `_a_class_name_` up to root class (usually `Any`, `Object` or something similar). Does  not include current class. Returns empty list if none.",
            "parameters": {
                "a_class": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_class",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            },
            "is_nullable": true
        },
        "is_descendant_of": {
            "name": "is_descendant_of",
            "documentation": "True if `_a_class_name_` is a descendant in the model of `_a_parent_class_name_`.",
            "parameters": {
                "a_class_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_class_name",
                    "type": "String"
                },
                "a_parent_class_name": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_parent_class_name",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "type_conforms_to": {
            "name": "type_conforms_to",
            "documentation": "Check conformance of `_a_desc_type_` to `_an_anc_type_`; the types may be generic, and may contain open generic parameters like 'T' etc. These are replaced with their appropriate constrainer types, or Any during the conformance testing process.\n\nConformance is found if:\n\n* [base class test] types are non-generic, and either type names are identical, or else `_a_desc_type_` has `_an_anc_type_` in its ancestors;\n* both types are generic and pass base class test; number of generic params matches, and each generic parameter type, after 'open parameter' substitution, recursively passes; `_type_name_conforms_to_` test\n* descendant type is generic and ancestor type is not, and they pass base classes test.",
            "parameters": {
                "a_desc_type": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_desc_type",
                    "type": "String"
                },
                "an_anc_type": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "an_anc_type",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "Boolean"
            }
        },
        "subtypes": {
            "name": "subtypes",
            "documentation": "Generate type substitutions for the supplied type, which may be simple, generic (closed, open or partially open), or a container type. In the generic and container cases, the result is the permutation of the base class type and type substitutions of all generic parameters.",
            "parameters": {
                "a_type": {
                    "_type": "P_BMM_SINGLE_FUNCTION_PARAMETER",
                    "name": "a_type",
                    "documentation": "Name of a type.",
                    "type": "String"
                }
            },
            "result": {
                "_type": "P_BMM_CONTAINER_TYPE",
                "container_type": "List",
                "type": "String"
            }
        },
        "any_class_definition": {
            "name": "any_class_definition",
            "documentation": "`BMM_SIMPLE_CLASS` instance for the `Any` class. This may be defined in the BMM schema, but if not, use `BMM_DEFINITIONS._any_class_`.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_SIMPLE_CLASS"
            }
        },
        "any_type_definition": {
            "name": "any_type_definition",
            "documentation": "`BMM_SIMPLE_TYPE` instance for the `Any` type.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_SIMPLE_TYPE"
            }
        },
        "boolean_type_definition": {
            "name": "boolean_type_definition",
            "documentation": "`BMM_SIMPLE_TYPE` instance for the `Boolean` type.",
            "result": {
                "_type": "P_BMM_SIMPLE_TYPE",
                "type": "BMM_SIMPLE_TYPE"
            }
        }
    },
    "invariants": {
        "Inv_top_level_scope": "scope = self"
    }
}
bmm model

BMM_MODULE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

BMM_MODULE (abstract)

Description

Meta-type defining a generalised module concept. Descendants define actual structure and contents.

Inherit

BMM_DECLARATION

Attributes

Signature

Meaning

1..1
(redefined)

scope: BMM_MODEL

Model within which module is defined.

BMM_MODULE (abstract)

Meta-type defining a generalised module concept. Descendants define actual structure and contents.

Inherits: BMM_DECLARATION

Attributes

name: `String ` [1..1]

Name of this model element.
Inherited from BMM_DECLARATION

documentation: Hash <String ,Any > [0..1]

Optional documentation of this element, as a keyed list.

It is strongly recommended to use the following key /type combinations for the relevant purposes:

  • "purpose": String

  • "keywords": List<String>

  • "use": String

  • "misuse": String

  • "references": String

Other keys and value types may be freely added.
Inherited from BMM_DECLARATION

scope: BMM_MODEL [1..1]

Model within which module is defined.

extensions: Hash <String ,Any > [0..1]

Optional meta-data of this element, as a keyed list. May be used to extend the meta-model.
Inherited from BMM_DECLARATION

Functions

is_root_scope (): Boolean `

Post_result: `Result = (scope = self)
[1..1]

True if this declaration entity is the root of the declaration hierarchy.
Inherited from BMM_DECLARATION

{
    "name": "BMM_MODULE",
    "documentation": "Meta-type defining a generalised module concept. Descendants define actual structure and contents.",
    "is_abstract": true,
    "ancestors": [
        "BMM_DECLARATION"
    ],
    "properties": {
        "scope": {
            "_type": "P_BMM_SINGLE_PROPERTY",
            "name": "scope",
            "documentation": "Model within which module is defined.",
            "is_mandatory": true,
            "type": "BMM_MODEL"
        }
    }
}
bmm module