Class WikibasePropertySnak

Class for the WikibasePropertySnak.

Most used property of this type P1659 (see also).

Hierarchy (View Summary)

  • Snak
    • WikibasePropertySnak

Constructors

Properties

datatype: string = 'wikibase-property'
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 | `P${number}`
  • Returns the ID of the property with the P.

    Returns undefined | `P${number}`

    The ID of the property with the P.

  • set id(value: undefined | `P${number}`): void
  • This function parses the string by slicing the first char and then Number.parseInt. If value is undefined, it also sets the snaktype to 'novalue'.

    Parameters

    • value: undefined | `P${number}`

      The value that you want to set.

    Returns void

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

    Returns string

    The ID.

  • get numericID(): undefined | number
  • Returns the numeric part of the property.

    Returns undefined | number

    The numeric ID of the property.

  • set numericID(value: undefined | number): void
  • If value is undefined, it also sets the snaktype to 'novalue'.

    Parameters

    • value: undefined | number

      The numeric ID to be set in the snak.

    Returns void

Methods