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

    Interface ResourceConstraints

    Constraints for resource shape factories.

    interface ResourceConstraints {
        virtual?: boolean;
        name?: Dictionary;
        description?: Dictionary;
        namespace?: { "": string; readonly [term: string]: string };
        extends?: Lazy<ResourceShape> | readonly Lazy<ResourceShape>[];
        class?: string;
        classes?: readonly string[];
        pattern?: string;
        in?: readonly string[];
        hasValue?: readonly string[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    virtual?: boolean

    Marks the resource as dynamically generated.

    When true, indicates the resource is at least partially computed rather than stored.

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

    undefined (false)

    name?: Dictionary

    Human-readable name for the shape.

    Inheritance — always from child; not inherited.

    SHACL defines sh:name only for property shapes; extended here to node shapes.

    description?: Dictionary

    Human-readable description of the shape.

    Inheritance — always from child; not inherited.

    SHACL defines sh:description only for property shapes; extended here to node shapes.

    namespace?: { "": string; readonly [term: string]: string }

    Default namespace for converting property names to IRIs.

    Property names without explicit IRI mappings are resolved relative to this namespace.

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

    defaultNamespace

    extends?: Lazy<ResourceShape> | readonly Lazy<ResourceShape>[]

    Parent shape(s) this shape inherits from.

    Inherited entries and constraints are merged into the derived shape. When a child overrides an inherited property, constraints are enforced conjunctively: values must satisfy both the child's and all inherited constraints. This ensures overrides can only restrict, never relax, inherited definitions.

    Warning

    When inheriting from multiple shapes with different namespace values, an overriding namespace must be declared in this shape.

    Inheritance — structural; outside inheritance scope.

    class?: string

    Target class for resource instances.

    The absolute IRI identifying the primary class that resource instances must belong to. Shape-specific and not inherited. If defined, this value is exposed through the property mapped to @type using type.

    Inheritance — shape-specific target class; outside inheritance scope.

    classes?: readonly string[]

    Ancillary class constraints for resource instances.

    Additional class IRIs that resource instances must conform to. Empty arrays are ignored.

    Inheritance — union of parent class and child/parent classes.

    pattern?: string

    IRI path pattern that resource identifiers must match.

    Patterns are IRI-like templates using {name} placeholders for single path segments and /* for trailing wildcards. Patterns may be absolute or root-relative; root-relative patterns match absolute IRIs, ignoring the origin.

    Inheritance — only the trailing /* wildcard admits narrowing: a child may replace /* with more specific segments (for example, /products/* to /products/{id}/reviews/{rid}), provided the fixed prefix matches. All other cases require exact equality; a mismatch is reported as an error.

    undefined (no pattern constraint)

    https://example.org/products/{sku}  → https://example.org/products/ABC-456
    https://example.org/categories/* → https://example.org/categories/electronics/phones

    /employees/{id} → https://example.org/employees/123
    /departments/* → https://example.org/departments/sales/emea
    in?: readonly string[]

    Allowed resource identifiers (closed enumeration).

    When specified, resource identifiers must be members of this list. IRIs must be absolute. Empty arrays are ignored.

    Inheritance — intersection of parent and child sets; empty result is reported as an error.

    undefined (no enumeration constraint)

    hasValue?: readonly string[]

    Required resource identifiers that must be present.

    When specified, all listed resource identifiers must appear. IRIs must be absolute. Empty arrays are ignored.

    Inheritance — union of parent and child required values; child must require all parent values.

    undefined (no required values)