Prev | Next |
Subsetting NIEM with the Schema Composer
Enterprise Architect's Schema Composer is a tool that can greatly simplify the process of creating subsets from the NIEM Reference Model namespace Packages.
Access
Use either of the methods outlined here to display the Schema Composer window and then display the 'New Model Transform' dialog,
Enter a name for the new model transform, then from the 'Schema Set' drop-down list choose 'National Information Exchange Model (NIEM)'.
Save the profile as a Model Artifact within a suitable Package in your project (the root Package of your IEPD is suitable - then the Artifact will be easy to find).
Ribbon |
Specialize > Tools > Schema Composer > Open Schema Composer : New > Model Transform |
Creating a Subset Model
NIEM experts suggest that a good first step is to create a UML model of your XML exchange, as it allows you to capture your business requirements without being unduly influenced by how things are done in NIEM.
Once you have a first draft of a UML model for your exchange, you can then begin to re-create that model using NIEM.
Initially, finding appropriate types and properties within the NIEM Reference Model can seem to be an impossible task. This will become much easier as you gain experience and familiarity with the content of the NIEM model.
Most of the NIEM types that you will commonly use, such as PersonType, OgranizationType, DocumentType or ActivityType, have numerous attributes, of which you will generally require only a few. This is where subsetting becomes useful.
If you are trying to model a person, using their name, address and birthdate, you would choose PersonType and AddressType from Niem-core. From those types, select only the properties that you require for your model.
Where the selected properties reference other types, those types will be automatically added to the Schema Composer.
When you 'generate' your subset, EA creates the target schema packages required by the subset, then copies the selected types with their reduced attribute sets into the target packages.
Further Refining Your Subset
Once you have created your subset, you can further refine it by making adjustments to the cardinalities of the properties within the types or by restricting the allowed values of the properties.
To adjust the cardinality or restrict the permissible values of a property, select that property in the center pane of the Schema Composer, then right-click and choose 'Restrict this property'. The 'Property Restrictions' dialog is displayed, where you can adjust the cardinality or apply restrictions to the property as required.
Click on 'Update' to save the changes to your model transform profile, then click on 'Generate' to regenerate the subset model with the restrictions applied.
NIEM subsetting is often an iterative process. Using the saved model transform profile, you can reload, update and regenerate your subset as you require, throughout the various stages of IEPD development.
Subsetting NIEM Using the Schema Composer
Step |
Action |
---|---|
1 |
Open the Schema Composer. (See Ribbon Access, above.) |
2 |
Create a new Schema Composer profile. Click on the and select 'Model Transform'. In the dialog that opens, specify a name for the profile and select 'NIEM' in the 'Schema Set' field. (The 'Namespace' field on this dialog is not used for NIEM, as NIEM uses Tagged Values on its Model Packages to specify namespaces.) Choose a location to save your new profile, then click on the . |
3 |
In the Project Browser, locate the required types PersonType and AddressType, in the Niem-core Package of the Reference Model. Drag and drop the required types from the Project Browser onto the 'Classes' pane of the Schema Composer. |
4 |
Now select one of the types, say PersonType, in the Schema Composer's 'Classes' pane. The full list of attributes for PersonType is shown in the 'Attributes' pane. |
5 |
Use the checkboxes in the 'Attributes' list to select the attributes of 'PersonType' to use in your exchange model. In this case, select the checkboxes for 'PersonBirthDate' and 'PersonName'. As you select these attributes, the Schema Composer automatically adds the types 'DateType' and 'PersonNameType' to the list of Classes, as these types are referenced by the attributes you just selected. |
6 |
Now select 'DateType' in the 'Classes' pane. 'DateType' has four attributes, DateAccuracyAbstract, DateAugmentationPoint, DateMarginOfErrorDuration and DateRepresentation. The first three of these attributes are date metadata - they do not hold a date value. The fourth, DateRepresentation, is an abstract attribute, so it does not directly hold date values either. It is used as a placeholder for the attribute that will ultimately hold the date value. The NIEM model commonly uses XML Schema abstract elements and substitution groups. The abstract elements add some complexity to the creation of a subset, because you are required to add the abstract element, as well as those elements that will be substituted in place of the abstract element. For example, most date-related types contain the abstract element nc:DateRepresentation that can be substituted by nc:Date, nc:DateTime, and so on. |
7 |
Select the attribute DateType.DateRepresentation. You will notice that another type, DateRepresentationPropertyHolder has been added to the 'Classes' list. |
8 |
Select DateRepresentationPropertyHolder in the 'Classes' list. The untyped attribute DateRepresentation is known as the 'head' of a substitution group. This attribute must be selected in the client of the substitution, DateType, as well as in the supplier of the substitution, DateRepresentationPropertyHolder. The attribute that is the head of the substitution group is pre-selected for you, so you only need to select the attribute that will eventually be substituted for DateRepresentation in DateType. Select the attribute Date:date - it will be used as the DateRepresentation that will actually hold a data value. Where substitution groups are involved, it is a common mistake to simply add the abstract element without also adding the substitutable element from the related PropertyHolder type. |
9 |
Repeat the process for the PersonName attribute, by selecting PersonGivenName, PersonMiddleName and PersonSurName from the PersonNameType class. |
10 |
To save your current selection of Classes and attributes to the profile you are creating, click on the . This updates the profile with your current selection, allowing it to be reloaded at a later date if you need to perform further work on it. This facilitates an iterative process of creating the subset Package. |
11 |
Now click on the 'Generate' option. Choose 'NIEM Model Subset' in the 'Schema Export' dialog and click on the . Navigate to the Package hierarchy containing the MPD that you are building. Select the parent Package that will contain the subset packages, then click on the . |
12 |
The Classes you have selected in the Schema Composer will be copied to the target Packages, with just the subset of attributes that you have selected. |
Notes
Learn More