iwf
    Preparing search index...

    Class ExternalIdentifierSnak

    Class for the ExternalIdentifierSnak.

    Most used property of this type is P698 (PubMed ID).

    Hierarchy (View Summary)

    • Snak
      • ExternalIdentifierSnak
    Index
    • Parameters

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

        The snak for this class in JSON format.

      Returns ExternalIdentifierSnak

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

      const snak = new ExternalIdentifierSnak(json);
      
    datatype: string = dataType
    hash: string | undefined
    id: string | null
    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.

    • Converts the snak to JSON format.

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

      The snak as JSON.

      const json = wikidataExtIDSnak.toJSON();
      
    • Creates a snak from a property and an ID string.

      Parameters

      • property: `P${number}`

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

      • id: string

        The external identifier.

      Returns ExternalIdentifierSnak

      A snak with the given properties.

      const snak = ExternalIdentifierSnak.fromID('P698', '12345678');