Subset schema documents are NIEM artifacts that allow specification of a subset of the schema components defined with a given namespace. They are used in place of larger or more verbose Reference Schema Documents (REFs).
- Use same conformance target as Reference Schema Documents.
- Provide a self-consistent subset of definitions from a namespace.
- Provide a smaller basis to define NIEM-conformant packages.
- Can serve as the basis for Extension Schema Documents.
Subset Schema Documents are identically Reference Schema Documents (REFs) that provide a limited set of components from a namespace. They satify all the same rules and requirements of REFs but are typically found only within the specification of a NIEM-conformant package (i.e. IEPD or IEP). Subset Schema Documents are almost always automatically generated by SSGT. In fact, NIEM recommends against creating Subset Schema Documents manually.
Subset Schema Documents are used to specify a limited set of the components defined within a given namespace. These documents are Reference Schema Documents (REFs) that replace the full REF defining a namespace. As such, Subset Schema Documents are generally used in NIEM-conformant packages that require a limited set of components from broader domains.
<?xml version="1.0" encoding="US-ASCII"?>
<xs:schema targetNamespace="http://release.niem.gov/niem/niem-core/4.0/" version="1" xsi:schemaLocation="http://release.niem.gov/niem/appinfo/4.0/ ../../appinfo/4.0/appinfo.xsd http://release.niem.gov/niem/conformanceTargets/3.0/ ../../conformanceTargets/3.0/conformanceTargets.xsd" ct:conformanceTargets="http://reference.niem.gov/niem/specification/naming-and-design-rules/3.0/#ReferenceSchemaDocument" xmlns:niem-xs="http://release.niem.gov/niem/proxy/xsd/3.0/" xmlns:structures="http://release.niem.gov/niem/structures/3.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:appinfo="http://release.niem.gov/niem/appinfo/3.0/" xmlns:ct="http://release.niem.gov/niem/conformanceTargets/3.0/" xmlns:nc="http://release.niem.gov/niem/niem-core/3.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:import schemaLocation="../../proxy/xsd/3.0/xs.xsd" namespace="http://release.niem.gov/niem/proxy/xsd/3.0/"/>
<xs:import schemaLocation="../../structures/3.0/structures.xsd" namespace="http://release.niem.gov/niem/structures/3.0/"/>
<xs:element name="DateRepresentation" abstract="true"/>
<xs:element name="DateTime" type="niem-xs:dateTime" substitutionGroup="nc:DateRepresentation"/>
</xs:schema>
In terms of the structure or usage of Subset Schema Documents, they are indistinguishable from Reference Schema Documents (REFs). Because NIEM adopts an optional and over-inclusive data representation strategy, most elements defined in a REF have 0 to unbounded cardinality, and thus elements with cardinality minOccurs="0"
are optional and may be omitted from a derived Subset Schema Document.
It is also valid to constrain an element’s cardinality within a Subset Schema Document as long as doing so does not break the subset’s relationship with the parent REF. For example, a REF element defined with cardinality minOccurs="1"
and maxOccurs="unbounded"
is then constrained to (0,1)
or (1,1)
in a derived Subset Schema Document. The change in cardinality shown here breaks the subset’s relationship with the REF because the new interval (0,1)
is not contained within the original interval (0, unbounded)
.
The following lists a non-normative, informative, set of operations to consider when constructing Subset Schema Documents. It is possible to apply them in combinations that will break the subset relationship, or even result in invalid schemas. Apply these operations carefully and thoughtfully.
xs:annotation
.xs:element/@minOccurs
as long as it remains less than or equal to its corresponding xs:element/@maxOccurs
defined in the parent REF.xs:element/@maxOccurs
as long as it remains greater than or equal to its corresponding xs:element/@minOccurs
defined in the parent REF.xs:element
if its minimum cardnality is 0 (xs:element/@minOccurs="0"
).xs:complexType
or xs:simpleType
if not supporting an xs:element
or xs:attribute
declaration, or another xs:complexType
or xs:simpleType
definition.xs:attribute
with @use="optional"
from an xs:complexType
.xs:attribute/@use="optional"
to xs:attribute/@use="prohibited"
.xs:attribute/@use="optional"
to xs:attribute/@use="required"
.xs:element
declaration if the element is not needed.xs:enumeration
from an xs:simpleType
as long as it is not the only remaining xs:enumeration
.xs:simpleType
.xs:import
if the imported schema document is not used within the subset.xs:element
declaration to xs:element/@abstract="true"
.xs:element/@nillable="true"
to xs:element/@nillable="false"
.xs:element/@substitutionGroup
member for its associated substitution group head.xs:element/@substitutionGroup
members for their associated substitution head.NIEM recommends developers use SSGT to automatically generate Subset Schema Documents. There are several pitfalls and opportunities for error in creating derived Subset Schema Documents from REFs manually.