Class WikibaseLexemeSnak

Class for the WikibaseLexemeSnak.

Most used property of this type...

Hierarchy (View Summary)

  • Snak
    • WikibaseLexemeSnak

Constructors

Properties

_numericID: undefined | number
datatype: string = 'wikibase-lexeme'
hash: undefined | string
property: `P${number}`
snaktype: SnakType

Accessors

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

    Returns boolean

    True if the snak has a value.

  • get id(): undefined | string
  • The lexeme ID will be prefixed with L.

    Returns undefined | string

    The value of the snak.

    id

  • set id(value: undefined | string): void
  • Parameters

    • value: undefined | string

      The value of the snak.

    Returns void

    id

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

    Returns string

    The ID.

  • get numericID(): undefined | number
  • Returns undefined | number

    The value of the snak.

    numericID

  • set numericID(value: undefined | number): void
  • Parameters

    • value: undefined | number

      The value of the snak.

    Returns void

    numericID

Methods

  • Create a new instance of the class from some basic data.

    Parameters

    • property: `P${number}`

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

    • id: `L${number}`

      The ID of the lexeme in 'L-form'.

    Returns WikibaseLexemeSnak

    A new instance of the class.

    const snak = WikibaseLexemeSnak.fromData('P1', 'L1');