Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Avoid replicating data in a NIEM XML document
There are several NIEM-specific strategies to avoid replicating data within a NIEM XML document.
Use structures:id and structures:ref
An XML document may avoid replicating data by using references within the document. Instead of replicating the data for a vehicle, for example, the vehicle may be expressed once within an instance document, and other uses of the vehicle may be expressed by a reference to the vehicle. The use of references is described and specified by the NIEM Naming and Design Rules section on reference elements.
Take, for example, this example from the NDR:
<nc:Item> <nc:ItemOwner structures:ref="m82"/> </nc:Item> <nc:Entity structures:id="m82"> <nc:EntityPerson> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:EntityPerson> </nc:Entity>
By default, a NIEM subset, any element may either have immediate content, or may identify that it is a reference to the content. A reference must be to another element that has the same type as the referring type, or to a type derived from the referring type.
Use NIEM metadata
NIEM defines a mechanism for expressing data about data: NIEM metadata. NIEM metadata is defined by the NDR section “Instance metadata”. NIEM defines two kinds of metadata:
- Metadata on objects and associations: this enables a NIEM message to say information about where information about an object comes from: its source, validity, privacy, etc. Metadata on an object or an association is defined via the
- Metadata on relationships: this enables a NIEM message to provide information about relationships established by elements in the message. Metadata on a relationship is established via the
The NIEM section on instance metadata provides examples of metadata in use. These mechanisms may enable duplicated data (e.g., source of a statement) to be put into one place, and to be referenced from throughout the XML document.
Use NIEM augmentations
A NIEM augmentation is an element that defines additional relationships or characteristics of an object through a specific kind of extension. An augmentation definition enables a domain to define an extension to an object without having to define a new derived type. It can also be used within an IEPD to define new properties on an already-defined type.
A NIEM augmentation type acts as a bucket of relationships and characteristics that may be applied to a variety of objects. If an instance has a set of objects that share a set of characteristics, it may be briefer to express those characteristics via an augmentation type, and to reference a single instance of the augmentation type from all of the objects.