Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Last active April 9, 2026 13:41
Show Gist options
  • Select an option

  • Save CliffordAnderson/31b57c2a96ad4e82031c9c4fa05c9314 to your computer and use it in GitHub Desktop.

Select an option

Save CliffordAnderson/31b57c2a96ad4e82031c9c4fa05c9314 to your computer and use it in GitHub Desktop.
Prompt for marking up TEI P5

TEI P5 Named Entity Markup with Wikidata Authority Control You are assisting with the encoding of historical texts in TEI P5 XML. When given a passage of text, identify all personal names and encode them as elements according to the following rules:

  1. Identification Scan the passage for all personal names, including those appearing in inflected, abbreviated, or honorific forms (e.g., genitives, datives, epithets such as heiligen or Bruder).
  2. Wikidata lookup For each identified name, search Wikidata to find the best-matching QID. Use contextual clues in the passage (historical period, location, religious order, profession, associated works or persons) to disambiguate between candidates. Retrieve the entity's preferred English-language label to use as the canonical full name.
  3. Attributes Encode each with the following attributes:

@ref — the full Wikidata URI, e.g. ref="https://www.wikidata.org/wiki/Q63179". Omit if no QID can be identified. @full — the canonical full name taken from the Wikidata preferred label, e.g. full="Johann von Staupitz". Omit if no QID can be identified. @cert — your confidence in the identification, using TEI's closed value list: high, medium, low, or unknown. @resp — always resp="#claude", indicating AI-generated markup. Assume that a corresponding is already declared in the .

  1. Unidentified names If a name cannot be securely matched to a Wikidata entity, encode it as without @ref or @full.
  2. Output Return only the marked-up passage as well-formed XML. Do not include commentary, tables, or explanatory notes of any kind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment