@metreeca/blue - v0.12.0
    Preparing search index...

    Type Alias ResourceShape<P, M>

    ResourceShape: ResourceConstraints & {
        kind: "resource";
        classes: readonly Reference[];
        parents: P;
        members: M;
    }

    Describes a linked data resource.

    Admits the resources a store holds: a record carrying the members the shape declares, and nothing else, so that what a resource may state is fixed by the shape rather than left to whoever writes it. A shape extends the shapes it lists as parents, carrying their members and constraints on top of its own.

    Inheritance

    Where a shape extends the ones it lists as parents, they are merged according to the following rules. The child is the extending shape; the parent is the inherited one.

    Field Override Rule
    kind Cannot be overridden
    name Always from the child; not inherited
    description Always from the child; not inherited
    space Inherited; conflicting parents without a child override are reported as an error
    class Always from the child; not inherited
    classes Computed from the class of the shapes extended; never stated
    pattern Only a trailing /* admits narrowing; any other case requires equality
    in Child may only drop allowed identifiers
    hasValue Child may only add required identifiers
    members Declared members merged over inherited ones, each narrowing the one it overrides
    validators Union of the checks stated and the ones inherited; every check applies

    Cross-field validation

    • all merged hasValue entries must be members of the merged in set (if defined)
    • at most one id member and one type member, counted after inheritance
    • no two members may share a forward predicate, nor two a reverse predicate

    Type Parameters

    • P extends Parents = Parents

      The shapes extended, possibly deferred to break definition cycles

    • M extends Members = Members

      The members declared in the shape's own right

    Type Declaration

    • Readonlykind: "resource"

      Discriminator identifying this as a resource shape.

      Inheritance — cannot be overridden.

    • Readonlyclasses: readonly Reference[]

      The classes a resource belongs to beyond the one its shape states.

      Lists the class every extended shape states, transitively and deduplicated, so that a caller may test a resource against a supertype without walking the inheritance chain itself. Each extended shape contributes the class it states, followed by the ones it inherits in turn, in the order the shapes are extended. A shape extending nothing that states a class is empty.

      Together with the class the shape states in its own right, this is the lineage a shape is held to where it stands in for another as a member range.

      Inheritance — computed from the class of the shapes extended; never stated.

    • Readonlyparents: P

      The shapes extended, each possibly deferred to break definition cycles.

      Their members and constraints reach every resource this shape describes, so an extending shape states what it adds or tightens alone.

      Inheritance — states the shapes extended in the shape's own right, and is never itself inherited.

    • Readonlymembers: M

      The members a resource carries.

      Merged as the shape is built: the members declared in the shape's own right override the ones the extended shapes contribute, so a caller reads what a resource carries off the shape rather than by walking the inheritance chain. The shape is closed, so a resource carrying anything else is rejected.

      Inheritance — declared members merged over inherited ones, each narrowing the one it overrides.