Class EntitySchemaSnak

Class for the EntitySchemaSnak.

Most used property of this type ...

Hierarchy (View Summary)

  • Snak
    • EntitySchemaSnak

Constructors

Properties

datatype: string = dataType
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 value will be prefixed with E.

    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 snak from a property and an ID string.

    Parameters

    • property: `P${number}`

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

    • id: `E${number}`

      The entity schema ID.

    Returns EntitySchemaSnak

    A snak with the given properties.

    const snak = EntitySchemaSnak.fromID('P698', 'E12345678');