Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Contents
Prev Next

Walk Through Examples

If you are new to using the Schema Composer for NIEM, please take the time to read through these examples. Each example contains important information that will help to ensure that your models use valid Niem-core subsets, which will ultimately produce valid XML schema files.

Example 1: Adding Classes and Selecting Attributes

This 'walk-through' example demonstrates how to use Enterprise Architect's Schema Composer to perform basic operations of adding Classes and selecting attributes to be included in a NIEM subset Package.

Step

Description

1

Open an Enterprise Architect project that contains the NIEM 3.0 Reference Model and also the NIEM 3 MPD Types.

If you don't have such a project, then open a new project and load the Reference Model and MPD Types, using the Model Wizard.

2

Using the Model Wizard, add a fresh copy of the NIEM 3 IEPD Starter Model to your project.

The Starter Model contains a Package named 'myMPD', that in turn contains both a diagram and an object instance named 'myMPD' and a sub-Package named 'myMPD exchange'.

Replace the name 'myMPD' with something more appropriate, if you prefer.

3

The starter model contains a Schema Composer artifact named 'schemaComposer_Niem-core-subset'. Locate this artifact in the Project Browser, then double-click on it. This will open the Schema Composer and load the profile 'schemaComposer_Niem-core-subset'.

The lower part of the Schema Composer contains three columns. From left to right, they are labelled 'Classes', 'Attributes' and 'Schema'.

4

Using the Project Browser, locate the Package 'Niem-core' in the NIEM 3.0 Reference Model.

Within that Package, locate the Class AircraftType.

Drag and drop AircraftType onto the left-hand column of the Schema Composer (labelled 'Classes').

You will notice that Classes ConveyanceType and ItemType are added automatically to the list of Classes.

ItemType and ConveyanceType are supertypes from which AircraftType is derived.

5

Select AircraftType in the 'Classes' column.

You will notice that the center column, 'Attributes', displays the full list of attributes belonging to this Class.

To include an attribute in the subset schema, you simply place a checkmark beside it.

Place a checkmark beside AircraftTailIdentification. The type of AircraftTailIdentification is IdentificationType.

Notice that IdentificationType has been added to the list of Classes.

Enterprise Architect automatically adds to the 'Classes' list, those classifiers that are referenced as types of the attributes you select.

6

Select the Class IdentificationType in the left-hand column of the Schema Composer.

In the center column, place a check mark beside the attribute IdentificationID. The type of IdentificationID is string. Notice that string has been added to the list of Classes.

7

Now, select the Class ConveyanceType in the left-hand column of the Schema Composer.

Place a check mark beside the attribute ConveyanceMotorizedIndicator.

The type 'boolean' is added to the list of Classes.

8

Select the Class ItemType in the left-hand column of the Schema Composer.

Place check marks beside the attributes ItemMakeName, ItemModelName and ItemModelYearDate.

The types ProperNameTextType and TextType are automatically added to the list of Classes. TextType is the base Class for ProperNameTextType. gYear is also added to the list of Classes.

9

Click on the Update button to save the selected Classes and attributes to the profile, then click on the Generate button.

In the window that opens, select 'NIEM Model Subset', then click on the Generate button.

When specifying the target Package, choose the Package that is the parent of the namespace Packages you are subsetting into.

In this example, we are generating a subset of the Niem-core Package, so locate your Starter Model Package, then locate the Niem-core Package within it. Select the parent Package of the 'Niem-core' Package. Click on the OK button.

Note: When creating more complex models, your subset might include Classes from several different <<Namespace>> Packages.

Enterprise Architect's Schema Composer will copy the Classes that you are subsetting into target Packages whose Tagged Value 'targetNamespace' matches that of the source Package from which the original Class was drawn. In this scenario, the subset <<Namespace>> Packages must be children of the Package you choose as the generation target.

10

Once the generation is complete, expand the target <<Namespace>> Packages.

You will see the Classes you selected with their reduced sets of attributes.

Example 2: Using Association Types

This 'walk-through' example demonstrates how to use Enterprise Architect's Schema Composer to add association types and the types they reference, to your NIEM subset Package.

Step

Description

1

Open an Enterprise Architect project that contains the NIEM 3.0 Reference Model and also the NIEM 3 MPD Types.

If you don't have such a project, then open a new project and load the Reference Model and MPD Types using the Model Wizard.

2

Using the Model Wizard, add a fresh copy of the NIEM 3 IEPD Starter Model to your project.

The Starter Model contains a Package named 'myMPD', that in turn contains both a diagram and an object instance named 'myMPD' and a sub-Package named 'myMPD exchange'.

Replace the name 'myMPD' with something more appropriate, if you prefer.

3

The starter model contains a Schema Composer artifact named 'schemaComposer_Niem-core-subset'. Locate this artifact in the Project Browser, then double-click on it. This will open the Schema Composer and load the profile 'schemaComposer_Niem-core-subset'.

The lower part of the Schema Composer contains three columns. From left to right, they are labeled 'Classes', 'Attributes' and 'Schema'.

4

Using the Project Browser, locate the Package 'Niem-core' in the NIEM 3.0 Reference Model.

Within that Package, locate the Class 'PersonLocationAssociationType'.

Drag and drop 'PersonLocationAssociationType' onto the left-hand column of the Schema Composer (labelled 'Classes').

You will notice that the center column 'Attributes' displays PersonLocationAssociationType.Attributes and also PersonLocationAssociationType.Associations.

Place check marks beside both of the associations, Location and Person.

The types LocationType and PersonType are automatically added to the Schema Composer's 'Classes' list.

5

The Class PersonLocationAssociationType is derived from the supertype 'nc:AssocationType', but in this case the supertype is not automatically added to the Classes list.

If you want to include any attributes of the supertype 'nc:AssociationType' in your generated subset, you must add 'nc:AssociationType' to the Schema Composer's Class list manually, then select the required attributes.

If you don't want to specifically include attributes of 'nc:AssociationType', then there is no need to add it to the Classes list.

When the schema file is eventually generated from the subset Package, Enterprise Architect will generate an element and type definition for 'nc:AssociationType' if and when it is required, even if it is not explicitly modeled.

6

Click on the Update button, then click on the Generate button.

Example 3: Using Substitution Groups and Property Holders

This 'walk-through' example demonstrates how to use Enterprise Architect's Schema Composer to correctly add substitution groups and property holders to your NIEM subset Package.

Step

Description

1

Open an Enterprise Architect project that contains the NIEM 3.0 Reference Model and also the NIEM 3 MPD Types.

If you don't have such a project, then open a new project and load the Reference Model and MPD Types using the Model Wizard.

2

Using the Model Wizard, add a fresh copy of the NIEM 3 IEPD Starter Model to your project.

The Starter Model contains a Package named 'myMPD', that in turn contains both a diagram and an object instance named 'myMPD' and a sub-Package named 'myMPD exchange'.

Replace the name 'myMPD' with something more appropriate, if you prefer.

3

The starter model contains a Schema Composer artifact named 'schemaComposer_Niem-core-subset'. Locate this artifact in the Project Browser, then double-click on it. This will open the Schema Composer and load the profile 'schemaComposer_Niem-core-subset'.

The lower part of the Schema Composer contains three columns. From left to right, they are labeled 'Classes', 'Attributes' and 'Schema'.

4

Using the Project Browser, locate the Package 'Niem-core' in the NIEM 3.0 Reference Model.

Within that Package, locate the Class 'AircraftType'.

Drag and drop 'AircraftType' onto the left-hand column of the Schema Composer (labeled 'Classes').

You will notice that the Classes ConveyanceType and ItemType are added automatically to the list of Classes.

ItemType and ConveyanceType are supertypes from which AircraftType is derived.

5

Select the Class 'AircraftType' in the left-hand column of the Schema Composer.

In the center column, place a check mark beside the attribute AircraftWingColor (notice that this attribute has no type specified).

The Class AircraftWingColorPropertyHolder is automatically added to the list of classes.

6

Select the Class 'AircraftWingColorPropertyHolder' in the left-hand column. Notice that this Class also has an attribute with the name 'AircraftWingColor' that has no type specified.

Place a check mark beside AircraftWingColor and also beside AircraftWingColorText.

7

In this case, the attribute AircraftWingColor is the head of the substitution group and provides the connection between the Class AircraftType and the Class AircraftWingColorPropertyHolder.

AircraftWingColorText is the actual attribute (of type TextType) that will be added to AircraftType.

8

Some PropertyHolder types will have several attributes - the substitution group head, plus a number of others. You must always select the head of the substitution group in both the client and the supplier Classes. Then select additional attributes from the supplier Class as required. The additional attributes will ultimately be added to the client Class (by means of the substitution group) once the schema file is generated.