@grafctory/blue - v0.17.0
    Preparing search index...

    Type Alias PropertyConstraints<M>

    Constraints accepted by the member factories.

    States how a member is stored, presented and owned, leaving its cardinality to the factory naming it and its bounds to the general-purpose one.

    type PropertyConstraints<
        M extends Reference
        | Namespace = Reference | Namespace,
    > = {
        name?: string | Dictionary;
        description?: string | Dictionary;
        hidden?: boolean;
        foreign?: boolean;
        captive?: boolean;
        forward?: M;
        reverse?: M;
    }

    Type Parameters

    Index
    name?: string | Dictionary

    Human-readable name for the property.

    Accepts a localised Dictionary or, as a shorthand for the English-only case, a plain text string, expanded to { en: <value> } on the resolved property.

    Inheritance — inherited; a child may replace it, as a label restricts no value the property admits. Parents stating conflicting labels require the child to state its own, or the extending shape is rejected.

    undefined (no label)

    description?: string | Dictionary

    Human-readable description of the property.

    Accepts a localised Dictionary or, as a shorthand for the English-only case, a Markdown string, expanded to { en: <value> } on the resolved property.

    Inheritance — inherited; a child may replace it, as a description restricts no value the property admits. Parents stating conflicting descriptions require the child to state its own, or the extending shape is rejected.

    undefined (no description)

    hidden?: boolean

    Excludes the member from default serialisation.

    Inheritance — inherited; conflicting parents without a child override are reported as an error.

    undefined (false)

    foreign?: boolean

    Marks the property as owned by the resources in its range.

    A foreign property is read-only for the resource declaring it: a retrieval template may ask for it, but a submitted value stating it is rejected, as the link is written by the resources it points at rather than by the one exposing it.

    Important

    A foreign property is independent from a reverse mapping. A reverse mapping writes an actual inverse mapping; foreign exposes a read-only view over mappings another property owns and writes nothing on insert.

    Inheritance — inherited; a child may state it where the parent leaves it unstated, never change it, so a subtype may give up writing a member its supertype writes but never take up writing one left to the range.

    undefined (false)

    captive?: boolean

    Marks the resources in the property range as unable to outlive the resource declaring it.

    A captive resource keeps an identity and a lifecycle of its own and may be created, updated and deleted on its own. It stays existentially dependent on the resource declaring the property, though, and is cascade-removed when that resource is deleted.

    Important

    Captivity is independent from embedding. An embedded resource has no identity or lifecycle of its own (an id is rejected as a value is validated) and is always managed as part of the resource containing it; a captive resource has both and may be managed on its own, but does not survive the resource declaring the property.

    Inheritance — inherited; a child may state it where the parent leaves it unstated, never change it, so a subtype may bind the lifecycle of a member its supertype leaves free but never free one its supertype binds.

    undefined (false)

    forward?: M

    Maps the property to an absolute IRI for direct mapping.

    Accepts an absolute IRI or, as a shorthand, a Namespace resolving the property name against it (for instance, { forward: schema } on property name yields http://schema.org/name), narrowed on a built property to the IRI it denotes.

    Important

    Both forward and reverse mappings write actual property values. This is independent from foreign, which exposes a read-only view over mappings another property owns.

    Inheritance — inherited where the child states no mapping. A child stating either mapping must match the parent on both forward and reverse, including one the parent leaves unstated.

    undefined (the property name resolved against the space of the shape declaring it, unless a reverse mapping is stated)

    reverse?: M

    Maps the property to an absolute IRI for inverse mapping.

    Accepts an absolute IRI or, as a shorthand, a Namespace resolving the property name against it (for instance, { reverse: schema } on property employee yields http://schema.org/employee), narrowed on a built property to the IRI it denotes.

    Important

    Both forward and reverse mappings write actual property values. This is independent from foreign, which exposes a read-only view over mappings another property owns.

    Important

    A reverse mapping makes each value the subject of the statement it writes, and a literal can't be a subject. The mapping is therefore admitted only on members ranging over references, embedded resources, or unions of them. The resource factory rejects a reverse mapping on a member admitting literals. A range deferred to break a definition cycle is exempt from this check.

    Inheritance — inherited where the child states no mapping. A child stating either mapping must match the parent on both forward and reverse, including one the parent leaves unstated.

    undefined (no inverse mapping)