iwf
    Preparing search index...

    Class WikibaseSenseSnak

    Class for the WikibaseSenseSnak.

    An example of a property of this type is P5972 (translation).

    Hierarchy (View Summary)

    • Snak
      • WikibaseSenseSnak
    Index
    • Parameters

      • snak: {
            datatype?: "wikibase-sense";
            datavalue?: {
                type: "wikibase-entityid";
                value: { "entity-type": "sense"; id: string };
            };
            hash?: string;
            property: string;
            snaktype: "value"
            | "somevalue"
            | "novalue";
        }

        The snak for this class in JSON format.

      Returns WikibaseSenseSnak

      If the input does not match this datatype's Wikidata schema.

      const snak = new WikibaseSenseSnak(json);
      
    datatype: string = 'wikibase-sense'
    hash: string | undefined
    property: `P${number}`
    snaktype: "value" | "somevalue" | "novalue"
    • get hasValue(): boolean

      Checks if the snak has a value.

      Returns boolean

      True if the snak has a value.

    • get id(): string | undefined

      The lexeme ID will take the form L{number}-S{number}.

      Returns string | undefined

      The value of the snak.

      id

    • set id(value: string | undefined): void

      Parameters

      • value: string | undefined

        The value of the snak.

      Returns void

      id

    • get internalID(): string

      Creates a unique ID for the Snak.

      Returns string

      The ID.

    • Returns {
          datatype?: "wikibase-sense";
          datavalue?: {
              type: "wikibase-entityid";
              value: { "entity-type": "sense"; id: string };
          };
          hash?: string;
          property: string;
          snaktype: "value"
          | "somevalue"
          | "novalue";
      }

      The snak as JSON.

      const json = WikibaseSenseSnak.toJson();
      
    • Create a new instance of the class from some basic data.

      Parameters

      • property: `P${number}`

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

      • id: `L${number}-S${number}`

        The sense ID in 'L{number}-S{number}' form.

      Returns WikibaseSenseSnak

      A new instance of the class.

      const snak = WikibaseSenseSnak.fromData('P5972', 'L123-S4');