Using a SubtypeRestriction, it is possible to restrict the usage of subtypes on fields of a Structured DataType, by combining it with DataTypeRefinements (see 5.8.5). The Variable used to refine the field in a DataTypeRefinement can be the SourceNode of a UsesSubtypeRestriction, thereby limiting the subtypes that can be used in the field.
In Figure 24, an example is given. The X:SuperDataType contains field1 of a scalar Number. The Y:Refinement_3 of X:SuperDataType defines the field1 to either use a scalar UInt32 or Int32 by referencing the Z:Restriction1. No other subtypes of Number are allowed.
Figure 24 – Example of a SubtypeRestriction used by a DataTypeRefinement