Class MonolingualTextSnak

Class for the MonolingualTextSnak.

Most used property of this type is P1476 (title).

Hierarchy (View Summary)

  • Snak
    • MonolingualTextSnak

Constructors

Properties

datatype: string = dataType
hash: undefined | string
language: undefined | string

The language of the value.

property: `P${number}`
snaktype: SnakType
text: undefined | string

The value of the snak.

Accessors

  • get hasValue(): boolean
  • Checks if the snak has a value.

    Returns boolean

    True if the snak has a value.

  • get internalID(): string
  • Creates a unique ID for the Snak.

    Returns string

    The ID.

Methods

  • Parameters

    • property: `P${number}`

      The property of the snak in 'P-form'.

    • language: MonolingualLanguages

      The language of the snak.

    • value: string

      The value.

    Returns MonolingualTextSnak

    A snak with the given properties.

    const snak = MonolingualTextSnak.fromString('P1476', 'en', 'test');