Class WikibasePropertySnak

class for the wikibase property snak

most used property of this type P1659 (see also)

Hierarchy (view full)

  • Snak
    • WikibasePropertySnak

Constructors

Properties

_numericID: undefined | number

the numeric id of the property

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

Accessors

  • get hasValue(): boolean
  • 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): 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
  • create 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): 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

Generated using TypeDoc