Prev Next

Example NIEM Schema

This page provides an overview of defining a new NIEM compliant schema, from start to finish.

The framework Packages that are required for NIEM modeling have been described in previous topics. The Model Wizard (Start Page 'Create from Pattern' tab) also provides a Package that acts as a convenient starting point for defining your IEPD. When this is imported to your model you will find diagrams containing instances of the IEPD types, with the run-state set to show the core properties that you are most likely to need to set.

This section describes the process of taking the sample IEPD from the Pattern, and creating a 'Hello World' style message, where a request is made for a personalized message based on a facial image. The response will be the identity of the pictured person and a personalized message for them.

Import NIEM framework Packages

Modeling with NIEM in Enterprise Architect starts with the standard types defined by the NIEM Technical Architecture Committee and the Object Management Group NIEM-UML specification, as described here. These are available from our Reusable Asset Server and the Model Patterns wizard.

To import these into your model:

  • Open the Start Page 'Create from Pattern' tab (the Model Wizard)
  • Find the Perspective 'NIEM 3, 4 and 5'
  • Select the Packages required for your model
  • Click on the Create Model(s) button to import the selected patterns into your model.


  • All NIEM 5 models require the NIEM IEPD Types Package as well as one of the NIEM Reference Model Packages
  • All NIEM 3 and 4 models require the NIEM MPD Types Package as well as one of the NIEM Reference Model Packages
  • All NIEM 2.1 models require the NIEM 2.1 Reference Model Package but not an MPD Types Package, as the NIEM 2.1 MPD elements are available from the NIEM 2.1 MPD Diagram Toolbox



NIEM Framework

The power of NIEM comes primarily from the extensive library of types that you can use to build your own schemas. Enterprise Architect provides complete NIEM frameworks for NIEM 5, as well as all versions of NIEM 3 and NIEM 4.  These frameworks are all available from the Start Page 'Create from Pattern' tab (the Model Wizard).

This tutorial is using the NIEM 5.0 framework, so select that pattern for import.

IEPD Types from NIEM-UML

A user-defined NIEM schema is built around an IEPD that defines, for consumers of the schema, how to use the various XSD files that are included and what message types are being defined.

When modeling in UML, an IEPD is created using instances of a number of Classes defined in the UML Profile. Enterprise Architect provides these Classes in a Package that is available from the Start Page 'Create from Pattern' tab (the Model Wizard).

All NIEM 5 models will require these IEPD types, so select the 'NIEM 5 IEPD Types' pattern for import.

Subset NIEM Namespaces

The Starter Model pattern includes a Schema Composer Artifact to use for specifying a subset. Double-click on it to open the Schema Composer and begin the subsetting process.

We want our request message to send a facial image to be used for facial recognition. To do that, we need to subset the appropriate types from the Biometrics Package. Start by locating the type FaceImageType in the Domains\Biom Package within the NIEM 5.0 Reference Model. Drag this type into the Schema Composer. The super-types from which this type inherits are automatically added to the Schema Composer.

Our response message requires PersonType from the 'niem-core' Package. Drag this type onto the Schema Composer as well.

This image shows the selection of a subset of the types and properties across a number of namespaces within the NIEM 5.0 Reference Model:

Enterprise Architect Schema Composer - Defining a NIEM 5 subset model<br />

Once the required types are selected, you can generate the subset. When prompted, select the parent Package into which the subset namespace Packages will be generated. After generation, the Classes in the subset Packages should resemble this:

Enterprise Architect Browser window - NIEM 5 subset model.<br />

We can now create a NIEM PIM diagram and place all our subset Classes on that diagram, to produce something that resembles this:

Create extension types

We will be defining two messages, a request and a response.  For each of these messages, we need to define the document root elements.  These will be modeled as extensions to the NIEM schema.  Now that we have defined our subset Packages we can define these document roots. Because we are only creating two simple document types, all that is needed is a PropertyHolder and ObjectType for each message. The ObjectTypes link to the types we've selected from the NIEM framework, to describe the contents of each message as shown:

Customize the IEPD

The instance of the IEPD Class carries information that identifies the IEPD, and the links between it and the various other model artifacts determine what is generated (and where it is generated to) when generating the schema files and catalog files.  The main points are described here.



IEPD Metadata

The top level object in the Pattern is an instance of the IEPD class. The name of the IEPD is the name of the Object itself. All other properties are in the Run-State of the object.

This figure shows how the IEPD might look after providing real information.

Enterprise Architect - NIEM PIM diagram showing the IEPD instance specification.

NIEM-UML recommends the last section of iepdBaseURI matches the name of the IEPD, and specifies that the iepdVersionID will be appended to the iepdBaseURI to produce the generated iepdURI. This example follows that convention.

The Pattern defaults the value of iepdClassCode to 'iepd'. This means that the IEPD is intended to represent an Information Exchange Package Document (IEPD). This is the most common type of IEPD, and it is what we want to create, so it has been left with the default value.

Defined Document Types

An IEPD is expected to define one or more document types. Each one will be an instance of IEPConformanceTargetType named 'IEPConformanceTarget'. The provided model Pattern already includes one of these, but we need a second one as shown here:

Enterprise Architect - NIEM PIM diagram showing definition of document root elements.

Note the instances of QualifiedNamesType, with the qualifiedName relationship to a PropertyHolder. This specifies that the top level of the document being described will be an element from one of the contained attributes. The section Create Extension Packages in the topic Creating a NIEM Data Model describes how this is defined.

Package Usage

The relationships connecting the IEPD instance to the Information Models specify which schema files are to be generated with this IEPD. In this example we use types from two different NIEM namespaces. The sub-setting process has created an InformationModel Package for each, where the Namespace Tagged Values match the original, and the purpose is set to subset. We also create an extension Package where we define our own types and how the NIEM types will be used.

This figure shows how this looks:

Enterprise Architect - NIEM PIM diagram showing Package Usage.

The relationships used also specify how the Package is used and the relative path to the schema defined by that Package.

Additional Files

All IEPD Packages are expected by NIEM to contain - at a minimum - a change log and a readme, but there are several other types of Artifact that are also supported. In Enterprise Architect, each is defined using a stereotyped relationship to an Artifact. As with the Package use, the relationship specifies where the file will be located.

In this image a ReadMe, ChangeLog and a sample document are described for each of the document types. This will add information about those files to the target catalog file. The files will not be created by Enterprise Architect, and their content is beyond the scope of this tutorial.

Enterprise Architect - NIEM PIM diagram showing Artifact Usage.

Generate IEPD

To generate your IEPD:

  • Select the IEPD instance specification, either on the diagram or in the Browser window.
  • From the 'Specialize' ribbon, select the option 'Technologies > NIEM > Generate NIEM Schema'
Enterprise Architect - Generating schema files from NIEM 5 model.<br />

The dialog shows the standard NIEM artifacts and the list of linked namespaces that can be generated as schemas. Set the target directory and click on the Generate button to create the modeled IEPD.

Learn More