@coasys/ad4m / Exports / RelationMetadataEntry
Interface: RelationMetadataEntry
Metadata stored for each relation via
Has Many
/
Has One
/
Belongs To One
/
Belongs To Many
Table of contents
Properties
- datatype
- filter
- getter
- instantiateAs
- interpretationHint
- kind
- local
- maxCount
- ordering
- polymorphic
- predicate
- readOnly
- target
- where
Properties
datatype
• Optional datatype: string
SHACL sh:datatype for the relation's target values. Set when the
relation holds encoded literal values (e.g. "xsd:string" for a
HasMany<string> that stores plain strings). Emitted into SHACL
so the executor knows to decode literal:<type>:<value> wire form
on hydration. Omit for URI relations that point at other model
instances — those pass through byte-for-byte.
Defined in
core/src/model/decorators.ts:61 (opens in a new tab)
filter
• Optional filter: boolean
Whether to auto-generate a conformance filter when target is set.
Defaults to true — set to false to opt out of DB-level type filtering
while keeping hydration capability via include.
Defined in
core/src/model/decorators.ts:46 (opens in a new tab)
getter
• Optional getter: string
Custom getter to resolve the relation values. The expression can reference 'Base' which will be replaced with the instance's base expression.
Defined in
core/src/model/decorators.ts:38 (opens in a new tab)
instantiateAs
• Optional instantiateAs: () => Ad4mModelLike[]
Type declaration
▸ (): Ad4mModelLike[]
Model classes this relation's polymorphic results can be constructed as.
Returns
Defined in
core/src/model/decorators.ts:65 (opens in a new tab)
interpretationHint
• Optional interpretationHint: string
Natural-language hint describing what this relation MEANS semantically.
Emitted as an ad4m://interpretation_hint link on the SHACL property
node; read back by the Rust harness and rendered into the
_propose_link_child tool's predicate field description. Mirror of
the same field on RelationOptions (the decorator arg); this is the
memoized registry copy.
Defined in
core/src/model/decorators.ts:76 (opens in a new tab)
kind
• kind: "hasMany" | "hasOne" | "belongsToOne" | "belongsToMany"
Defined in
core/src/model/decorators.ts:27 (opens in a new tab)
local
• Optional local: boolean
Defined in
core/src/model/decorators.ts:33 (opens in a new tab)
maxCount
• Optional maxCount: number
Maximum number of related instances.
Set automatically: 1 for @HasOne/@BelongsToOne, undefined (unlimited) for *Many.
Defined in
core/src/model/decorators.ts:32 (opens in a new tab)
ordering
• Optional ordering: Object
CRDT ordering config — see RelationOptions.ordering.
Type declaration
| Name | Type |
|---|---|
strategy | "linkedList" |
Defined in
core/src/model/decorators.ts:67 (opens in a new tab)
polymorphic
• Optional polymorphic: boolean
Hydrate targets as the class each one actually is — see RelationOptions.polymorphic.
Defined in
core/src/model/decorators.ts:63 (opens in a new tab)
predicate
• predicate: string
Defined in
core/src/model/decorators.ts:24 (opens in a new tab)
readOnly
• Optional readOnly: boolean
No writer for this relation; see RelationOptions.readOnly.
Defined in
core/src/model/decorators.ts:40 (opens in a new tab)
target
• Optional target: () => Ad4mModelLike
Type declaration
▸ (): Ad4mModelLike
Target model class thunk. Optional for untyped string relations.
Returns
Defined in
core/src/model/decorators.ts:26 (opens in a new tab)
where
• Optional where: Where
Filter constraints on linked target nodes using the query DSL. Property names reference the target model's properties. Overrides auto-derived conformance when set.