Metadata Pattern

Within NIEM, metadata is defined as data about data. This may include information such as the security or reliability of a piece of data, or the source from which it originated.

Each metadata element may define a list of types and/or elements that may reference it. Metadata that is defined for a given type will also be automatically allowable for any derived type as well. This allows users to define the granularity as needed, such as the root level of an IEPD, selected element(s), selected type(s), and/or high-level base types defined in structures.xsd (such as structures:ObjectType and structures:AssociationType) which enables easy reuse of metadata throughout NIEM without having to list specific elements and types.

Note that metadata is handled very differently in NIEM from other elements and types. Metadata elements cannot be included as sub-properties of a type and metadata types cannot serve as parent types. Special attributes are defined in structures.xsd and are inherited by all NIEM object types, association types, augmentation types, and complex types with simple content. These attributes allow metadata elements to be specially referenced by other NIEM elements.

Variable Replacement Table

Variable Description Usage NDR Reference
{$Name} Metadata element / type name Required NDR Rule 7-5: Component naming
NDR Section 10.8: Naming Rules
{$Definition} Metadata definition Required NDR Rule 9-25: Complex type has definition
NDR Rule 9-36: Element has definition
NDR Section 11.6.1: Human-readable documentation
{$ElementName} The QName of the element referenced Required
Repeat line for each sub element
 
{$Min} The minimum number of allowed element occurrences within the type    
{$Max} The maximum number of allowed element occurrences within the type    
{$AppliesToTypes} Space-delimited list of qualified types that the metadata element may be used with Use with or instead of appinfo:appliesToElements 
Use value "structures:ObjectType structures:AssociationType structures:SimpleObjectAttributeGroup" to use metadata element on almost any element in NIEM
NDR Section 10.9.1.2: appinfo:appliesToTypes annotation
NDR Rule 10-70: appinfo:appliesToTypes annotates metadata element
NDR Rule 10-71: appinfo:appliesToTypes references types
{$AppliesToElements} Space-delimited list of qualified elements that the metadata element may be used with Use with or instead of appinfo:appliesToTypes NDR Section 10.9.1.3: appinfo:appliesToElements annotation
NDR Rule 10-72: appinfo:appliesToElements annotates metadata element
NDR Rule 10-73: appinfo:appliesToElements references elements

Metadata Type and Element Declaration

<xs:complexType name="{$Name}MetadataType">
    <xs:annotation>
      <xs:documentation>A data type for metadata about {$Definition}</xs:documentation>  
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="structures:MetadataType">
        <xs:sequence>
          <xs:element ref="{$ElementName}" minOccurs="{$Min}" maxOccurs="{$Max}"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="{$Name}Metadata" type="{$Name}MetadataType" nillable="true" appinfo:appliesToTypes="{$AppliesToTypes}" appinfo:appliesToElements="{$AppliesToElements}">
    <xs:annotation>
      <xs:documentation>Metadata about {$Definition}</xs:documentation>
    </xs:annotation>
  </xs:element>

Example