Prev | Next |
Example NIEM Schema
This page provides an overview of defining a new NIEM compliant schema, from start to finish.
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 Model Wizard to the 'Model Patterns' page
- Find the Perspective 'NIEM 3 and 4'
- Select the Packages required for your model
- Click on 'Create Patterns' to import the selected patterns into your model.
Note:
- All NIEM 3 or 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
Component |
Details |
---|---|
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 4, as well as all versions of NIEM 3. These frameworks are all available from the 'Model Patterns' page of the 'Model Wizard'. This tutorial is using the NIEM 4.0 framework, so select that pattern for import. |
Model Package Description Types from NIEM-UML |
A user defined NIEM schema is built around a Model Package Description (MPD) which 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 MPD 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 'Model Patterns' page of the 'Model Wizard'. All NIEM 3 and NIEM 4 models will require these MPD types, so select the NIEM MPD Types pattern for import. |
Create Model Package Description
Previously, the framework packages that are required for NIEM modeling were described. The Model Wizard also provides a package that acts as a convenient starting point for defining your MPD. When this is imported to your model you will find a diagram containing instances of the MPD types described above 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 MPD 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.
Component |
Description |
---|---|
Model Package Description Metadata |
The top level object in the Pattern is an instance of the ModelPackageDescription class. The name of the MPD is the name of the Object itself. All other properties are in the Run-State of the object. This figure shows how the MPD might look after providing real information.
NIEM-UML recommends the last section of mpdBaseURI matches the name of the MPD, and specifies that the mpdVersionID will be appended to the mpdBaseURI to produce the generated mpdURI. This example follows that convention. The Pattern defaults the value of mpdClassCode to 'iepd'. This means that the MPD is intended to represent an Information Exchange Package Document (IEPD). This is the most common type of MPD, 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 'IEPConformance Target'. The provided model Pattern already includes one of these, but we need a second one as shown here:
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. For now, an empty type will be enough. |
Package Usage |
The relationships connecting the Model Package Description to the Information Models specify which schema files are to be generated with this MPD. In this example we will use types from two different NIEM namespaces. To do this, we first create an InformationModel Package for each, where the Namespace Tagged Values match the original, and the purpose is set to subset. We will also need an extension Package where we can define our own types and how the NIEM types will be used. This figure shows how this will look:
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 described above, the relationship specifies where the file will be located. In this image a ReadMe, ChangeLog and a sample document for each of the document types are described. 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.
|
Subset NIEM Namespaces
The Model Package Description is now complete, but we have three empty Information Model Packages. The first two should be filled by selecting types and properties from namespaces within the NIEM framework packages.
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.
Our request message specifies that it will 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 4.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 4.0 Reference Model:
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:
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
When describing the MPD earlier, we referred to a PropertyHolder that contained the possible document roots for our two messages. 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:
Generate IEPD
Right-click on the instance of the ModelPackageDescription.
Select 'Extensions | NIEM | Generate NIEM Schema'.
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 to create the modeled MPD.
Learn More