Modeling Facets

Basics

Facets do not exist independently. They are defined as part of the simple type that they constrain.

  • Each facet will have a kind.
  • Each facet will have a value.
  • Enumeration facets must have a definition.

A simple type that defines month codes will declare 12 facets:

  • The facet kinds will each be enumeration.
  • The facet values will be JAN, FEB, MAR, etc.
  • The facet definitions will be January, February, March, etc.

Keep in mind that overly-restrictive facets limit reusability, particularly in NIEM release schemas. For example, facets that restrict a string to the number of characters allowed in a corresponding database field may limit other users with different systems.

Simple type names

A simple type declares a facet:

  • If the type contains enumerations, the name of the type must end with CodeSimpleType.
  • All other simple types must have names that end with with SimpleType.

References

Rule Applicability Title
NDR 9-14 REF, EXT Enumeration has data definition
NDR 9-13 REF No use of fixed on simple type facets
NDR 10-17 REF, EXT Name of code type ends in CodeType
NDR 10-18 REF, EXT Code type corresponds to a code list
NDR 11-7 REF, EXT Name of a code simple type ends in CodeSimpleType
NDR 11-8 REF, EXT Code simple type corresponds to a code list