Optional ReadonlyforeignMarks the reference as managed by the target resource.
Foreign references are read-only from the source resource perspective: included in retrieval templates but rejected during resource validation. The link is owned by the target resource, not by the source resource declaring the foreign reference.
During resource validation, entries backed by a foreign reference shape are rejected if present in the input. During template validation, foreign entries are accepted normally, since templates describe data retrieval rather than state updates.
Foreign references are independent from reverse mappings.
A reverse mapping on a property writes an actual inverse property
mapping; a foreign reference is a read-only view over mappings owned by another property and does not write
any mappings on insert.
Inheritance — cannot be overridden.
Optional ReadonlycaptiveMarks the referenced resource as unable to outlive the source resource.
Captive resources have independent identity and lifecycle: they can be created, updated, and deleted independently of the referencing resource. However, they are existentially dependent on the source resource: they cannot outlive it and are automatically cascade-removed when it is deleted.
Captive resources are independent from embedded resources. Embedded resources have no independent identity or lifecycle (id rejected during state validation) and are always managed as part of their parent; captive resources have both and can be managed independently, but are cascade-deleted with the source resource.
Inheritance — cannot be overridden.
Constraints for the reference shape factory.
The
foreignandcaptiveflags are independent and may be combined. Their interaction determines how insert and remove operations behave on entries backed by the reference shape:foreigncaptiveHere forward/reverse is shorthand for the forward and reverse predicates declared on the enclosing property; cascade means the referenced resource is removed with the same semantics.
The forward and reverse mappings on the enclosing property determine which property mappings are written and deleted by these operations.
The
foreign+captivecombination models the parent side of a parent/children composition: the child owns the link, while the parent's view writes nothing on insert (foreign) but cascade-removes the children on deletion (captive). Link direction is immaterial, as long as both definitions share the same predicate IRI; children keep independent identity and lifecycle otherwise.