The variants tuple; each variant eager or a Lazy factory for recursive self-reference
ReadonlykindDiscriminator identifying this as a union.
Inheritance — cannot be overridden.
ReadonlymodelPrototype value for runtime model assembly.
Variant-keyed record mapping each variant's position to its model type, matching the Union form expected by retrieval templates.
Inheritance — computed from variants, not user-defined.
ReadonlyvariantsOrdered value shape variants.
Inheritance — each child variant narrows exactly one parent variant (injective); unpaired parents are dropped (see UnionShape).
Discriminated type alternatives for polymorphic values.
Variants are mutually exclusive alternatives (
sh:xone). The union is not validated for exclusivity at construction: branches may overlap, and the design proves nothing about their distinguishability. Discrimination is instead data-driven against caller-supplied values: astatevalue (persistence) must single out exactly one variant (sh:xone), rejected when it fits several (ambiguous) or none (unsatisfiable); amodelplaceholder (retrieval) need only match at least one variant by kind (sh:or), requesting each it fits and rejected only when it fits none. Order is preserved for deterministic error reporting but does not imply priority. Each variant is a ValueShape (a literal, reference, or resource); a localised dictionary is a whole-property type and is not a ValueShape, so a dictionary variant is a compile-time type error. In a retrieval template a union-typed slot is addressed only through the indexed Union form ({"0": ..., "1": ...}); a plain placeholder over it is rejected.Variants are expected to be disjoint: a well-formed union declares branches that no single legal value can satisfy at once, so every admissible value singles out exactly one. Disjointness is a design contract, not checked at construction; overlapping branches are accepted, but a value that fits several is rejected as ambiguous at operation time.
Cardinality
The expected cardinality of the polymorphic value set constrains the form of the expected value; for example, given
union(string(), reference(PostalAddress)):string | Referencereadonly (string | Reference)[]Inheritance
When a ResourceShape extends a parent via extends, a union-typed property is merged according to the following rules; see the module overview for the single-variant-narrowing (Form 1) and union-subsetting (Form 2) forms and the full narrowing relation. The child is the extending shape; the parent is the inherited shape.
kindmodel0variantsSee
SHACL § 4.6.4 sh:xone