External Standards and Adapters Pattern

NIEM is designed to be able to reuse external standards that do not conform to NIEM rules. A couple of extra things are needed, however, to make the reuse work more smoothly.

First, it is necessary to distinguish and flag the external standard explicitly as non-conformant. This alerts users to the fact that there will be differences in content and structure. It also allows the NIEM conformance rules to ignore this content, so that rule violations are not triggered where they do not apply. This is handled as part of the import statement.

It is also useful to provide some basic top-level NIEM constructs for the external content. This is done by wrapping an external element or attribute in a NIEM-conformant adapter type, which inherits the necessary constructs from structures:ObjectType. While this does create an extra type on top of the external component, it provides things like metadata and referencing capabilities to the NIEM-conformant adapter element.

Variable Replacement Table

Variable Description Usage NDR Reference
{$ExternalSchemaLocation} Absolute or relative path to the external schema    
{$ExternalSchemaNamespace} URI of the external schema    
{$ExternalSchemaDefinition} The description of the external schema.
Since a non-NIEM schema may not have its own definition, a definition is required with the import.
  NDR Rule 10-7: Import of external namespace has data definition
{$Name} The name of the adapter element / type Required NDR Rule 7-5: Component naming
NDR Section 10.8: Naming Rules
{$Definition} The definition of the adapter element / type Required NDR Section 11.6.1: Human-readable documentation
{$ExternalElement} QName of the external element Required
{$ExternalElementDefinition} Definition of the external element Required NDR Rule 10-16: External element use has data definition

Import External Schema Adapaters Pattern

<xs:import schemaLocation="{$ExternalSchemaLocation}" namespace="{$ExternalSchemaNamespace}" appinfo:externalImportIndicator="true">
   <xs:annotation>
     <xs:documentation>{$ExternalSchemaDefinition}</xs:documentation>   
   </xs:annotation>
</xs:import>

<xs:complexType name="{$Name}AdapterType" appinfo:externalAdapterTypeIndicator="true">
    <xs:annotation>
        <xs:documentation>A data type for {$Definition}
		 </xs:documentation>
    </xs:annotation>
 <xs:complexContent>
  <xs:extension base="structures:ObjectType">
   <xs:sequence>
    <xs:element ref="{$ExternalElement}" minOccurs="0" maxOccurs="unbounded">
     <xs:annotation>
	  <xs:documentation>{$ExternalElementDefinition}</xs:documentation>
	 </xs:annotation>
	</xs:element>
   </xs:sequence>
  </xs:extension>
 </xs:complexContent>
</xs:complexType>

<xs:element name="{$Name}Adapter" type="{$Name}AdapterType" nillable="true">
   <xs:annotation>
      <xs:documentation>A(n) {$Definition}</xs:documentation>
   </xs:annotation>
</xs:element>

Example