iwf
    Preparing search index...

    Class MathSnak

    Class for the MathSnak.

    Most used property of this type is P2534 (defining formula).

    Hierarchy (View Summary)

    Index
    • Parameters

      • snak: {
            datatype?: "math";
            datavalue?: { type: "string"; value: string };
            hash?: string;
            property: string;
            snaktype: "value" | "somevalue" | "novalue";
        }

        The snak for this class in JSON format.

      Returns MathSnak

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

      const snak = new MathSnak(json);
      
    datatype: string = dataType
    hash: string | undefined
    property: `P${number}`
    snaktype: "value" | "somevalue" | "novalue"
    value: string | undefined

    A math expression

    • 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.

    • This function checks if two snaks are equal.

      Parameters

      Returns boolean

      True if the snaks are equal.

      if (snak.equals(other)) {
      // do something
      }
    • Returns {
          datatype?: "math";
          datavalue?: { type: "string"; value: string };
          hash?: string;
          property: string;
          snaktype: "value" | "somevalue" | "novalue";
      }

      The snak as JSON.

      const json = mathSnak.toJSON();