Skip to content

Enrichment script: Wikidata (people) #37

Description

@DutchJaFO

Context

Split from #19. Implements IEnrichmentProvider for Wikidata, covering person quotes. Depends on the shared enrichment scaffold (#19); does not depend on TMDB (#35), Open Library (#36), or TVDB (#46).

API details

Property Value
Base URL https://www.wikidata.org
Auth None required
Rate limit No hard limit for modest use; set a User-Agent header per Wikidata bot policy
Endpoints /w/api.php?action=wbsearchentities (search), /wiki/Special:EntityData/{id}.json (fetch)

What gets enriched

Field How
date Wikidata P569 (date of birth) → year; fallback only if no speech date is known
author Confirm or normalise spelling against the Wikidata canonical English label

Implementation checklist

  • Implement WikidataEnrichmentProvider : IEnrichmentProvider in Quotinator.Enrichment
  • SupportedTypes: person
  • Search wbsearchentities by author field value with type=item
  • Fetch the top candidate entity and extract P569 (date of birth) → year string
  • Use the entity's English label to confirm or normalise the author field spelling
  • Only fill fields that are currently null or empty — never overwrite manually curated data
  • Cache API responses in scripts/cache/wikidata/
  • Set a User-Agent request header (e.g. Quotinator-Enrichment/1.0)
  • Apply enrichment only on exactly one high-confidence match; flag ambiguous results
  • Respects the shared --dry-run, --no-fetch, and --provider flags from the scaffold

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions