Avoid replicating data in a NIEM XML document

Webb Roberts edited this page Nov 3, 2014 · 1 revision

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:ItemOwner structures:ref="m82"/>
<nc:Entity structures:id="m82">
      <nc:PersonFullName>John Doe</nc:PersonFullName>

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.

Note that there is no difference in meaning between XML data that uses a reference and the same data that uses content.

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:

  1. 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 structures:metadata attribute.
  2. 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 structures:relationshipMetdata attribute.

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.