Class WikibaseItemSnak

class for the WikibaseItemSnak

most used property of this type P2860 (cites work)

Hierarchy (view full)

  • Snak
    • WikibaseItemSnak

Constructors

Properties

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

Accessors

  • get hasValue(): boolean
  • Returns boolean

    true if the snak has a value

  • get internalID(): string
  • create a unique id for the Snak

    Returns string

    the id

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

    the value of the snak

    Alias

    numericID

  • set numericID(value): void
  • Parameters

    • value: undefined | number

      the value of the snak

    Returns void

    Alias

    numericID

Methods

  • create a snak from some basic data

    Parameters

    • property: `P${number}`

      the property of the snak in 'P-form'

    • id: `Q${number}`

      the Wikibase item id in the Q-form

    Returns WikibaseItemSnak

    a snak with the given properties

    Static

    Example

    const snak = WikibaseItemSnak.fromData('P2860', 'Q42');
    

Generated using TypeDoc