iwf
    Preparing search index...

    Class WikibaseLexemeSnak

    Class for the WikibaseLexemeSnak.

    An example of a property of this type is P6553 (personal pronoun).

    Hierarchy (View Summary)

    • Snak
      • WikibaseLexemeSnak
    Index
    • Parameters

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

        The snak for this class in JSON format.

      Returns WikibaseLexemeSnak

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

      const snak = new WikibaseLexemeSnak(json);
      
    _numericID: number | undefined
    datatype: string = 'wikibase-lexeme'
    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 internalID(): string

      Creates a unique ID for the Snak.

      Returns string

      The ID.

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

      The snak as JSON.

      const json = WikibaseLexemeSnak.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}`

        The ID of the lexeme in 'L-form'.

      Returns WikibaseLexemeSnak

      A new instance of the class.

      const snak = WikibaseLexemeSnak.fromData('P1', 'L1');