iwf
    Preparing search index...

    Class StringSnak

    Class for the StringSnak.

    Most used property of this type P1545 (series ordinal).

    Hierarchy (View Summary)

    Index
    • Parameters

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

        The snak for this class in JSON format.

      Returns StringSnak

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

      const snak = new StringSnak(json);
      
    datatype: string = 'string'
    hash: string | undefined
    property: `P${number}`
    snaktype: "value" | "somevalue" | "novalue"
    value: string | undefined
    • 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 (stringSnak.equals(other)) {
      // do something
      }
    • Returns {
          datatype?: "string";
          datavalue?: { type: "string"; value: string };
          hash?: string;
          property: string;
          snaktype: "value" | "somevalue" | "novalue";
      }

      The snak as JSON.

      const json = stringSnak.toJson();
      
    • Parameters

      • property: `P${number}`

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

      • string: string

        The string.

      Returns StringSnak

      A snak with the given properties.

      if (snak.equals(other)) {
      // do something
      }