Class RelationDefinitionSchema<E, R, RDef>

Wrapper around raw relation definition schemas from the Schema. You should never have to create this object yourself. Instead, retrieve these objects from the methods in the Schema class.

Type Parameters

Hierarchy

  • RelationDefinitionSchema

Constructors

  • Wrapper around raw relation definition schemas from the Schema. You should never have to create this object yourself. Instead, retrieve these objects from the methods in the Schema class.

    Type Parameters

    • E extends readonly EntityRawSchema[] = EntityRawSchemaArray

    • R extends readonly Readonly<{ cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & { constraints: Readonly<RQLVocabularyConstraint>[]; final: false; object: string; options: RelationOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<StringBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<PasswordBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<BytesBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<IntBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<BigIntBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<FloatBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<BooleanBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<DecimalBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<DateBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<TimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<DatetimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<TZTimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<TZDatetimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<IntervalBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions }>[] = RelationDefinitionRawSchemaArray<E>

    • RDef extends Readonly<{ cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & { constraints: Readonly<RQLVocabularyConstraint>[]; final: false; object: string; options: RelationOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<StringBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<PasswordBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<BytesBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<IntBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<BigIntBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<FloatBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<BooleanBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<DecimalBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<DateBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<TimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<DatetimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<TZTimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<TZDatetimeBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions } & { cardinality: "**" | "*1" | "*?" | "*+" | "1*" | "11" | "1?" | "1+" | "?*" | "?1" | "??" | "?+" | "+*" | "+1" | "+?" | "++"; description: string; subject: E[number]["type"]; type: string } & Readonly<IntervalBuildObj> & { constraints: AttributeConstraint[]; final: true; options: AttributeOptions }> = R[number]

    Parameters

    • schema: Schema<E, R>

      The Schema abstractin class used to create this object

    • relDef: RDef

      The raw relation definition schema

    Returns RelationDefinitionSchema<E, R, RDef>

Accessors

  • get cardinality(): RDef["cardinality"]
  • The cardinality of this relation definition schema.

    Returns RDef["cardinality"]

  • get constraints(): RDef["constraints"]
  • The list of constraints set for this relation definition schema. The returned type will change if this relationd definition schema describes an attribute or a relation.

    Returns RDef["constraints"]

  • get default(): RDef extends { default: V } ? V : undefined
  • The default value for this relation. It can be used when creating new relations if the user did not enter a value (even if required).

    Returns RDef extends { default: V } ? V : undefined

  • get description(): RDef["description"]
  • A short description which can be used as documentation for the relation definition schema.

    Returns RDef["description"]

  • get final(): RDef["final"]
  • True if the object of the relation definition schema is a primitive type. In this case the relation is called an "attribute".

    Returns RDef["final"]

  • get objectCardinality(): Cardinality
  • The cardinality of this relation definition schema's object.

    Returns Cardinality

  • get options(): RDef["options"]
  • The list of options set for this relation definition schema. The returned type will change if this relationd definition schema describes an attribute or a relation.

    Returns RDef["options"]

  • get subjectCardinality(): Cardinality
  • The cardinality of this relation definition schema's subject.

    Returns Cardinality

  • get type(): RDef["type"]
  • The type of the relation definition. This can also be referred to as the relation definition's name.

    Returns RDef["type"]

Methods

  • Checks if the relation is required when using the subject or object point of view.

    Returns

    Parameters

    • role: "object" | "subject"

      The point of view to use

    Returns boolean

Generated using TypeDoc