iwf
    Preparing search index...

    Class WikibasePropertySnak

    Class for the WikibasePropertySnak.

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

    Hierarchy (View Summary)

    • Snak
      • WikibasePropertySnak
    Index

    Constructors

    Properties

    datatype: string = 'wikibase-property'
    hash: string | undefined
    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(): `P${number}` | undefined

      Returns the ID of the property with the P.

      Returns `P${number}` | undefined

      The ID of the property with the P.

    • set id(value: `P${number}` | undefined): 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: `P${number}` | undefined

        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(): number | undefined

      Returns the numeric part of the property.

      Returns number | undefined

      The numeric ID of the property.

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

      If value is undefined, it also sets the snaktype to 'novalue'.

      Parameters

      • value: number | undefined

        The numeric ID to be set in the snak.

      Returns void

    Methods