iwf
    Preparing search index...

    Class GeoShapeSnak

    Class for the GeoShapeSnak.

    Most used property of this type is P3896 (geoshape).

    Hierarchy (View Summary)

    Index
    • Parameters

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

        The snak for this class in JSON format.

      Returns GeoShapeSnak

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

      const snak = new GeoShapeSnak(json);
      
    datatype: string = dataType
    fileName: string | null

    The Wikimedia Commons file name

    hash: string | undefined
    property: `P${number}`
    snaktype: "value" | "somevalue" | "novalue"
    • Gets the link to the Wikimedia Commons page.

      Returns string

      The link to the Wikimedia Commons page.

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

    • Converts the snak to JSON format.

      Returns {
          datatype?: "geo-shape";
          datavalue?: { type: "string"; value: string };
          hash?: string;
          property: string;
          snaktype: "value" | "somevalue" | "novalue";
      }

      The snak as JSON.

      const json = geoShapeSnak.toJSON();