Skip to content

feat(ingest): fill absent software and website fields from Wikidata - #106

Merged
Seungpyo1007 merged 4 commits into
mainfrom
feat/wikidata-fill
Sep 27, 2026
Merged

Seungpyo1007 merged 4 commits into
mainfrom
feat/wikidata-fill

Conversation

@Seungpyo1007

@Seungpyo1007 Seungpyo1007 commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Software and website records often lack fields already available on their cited Wikidata entities. Add a dry-run-first CLI that fills only absent values using the existing schema fields and compares proposed records with the current offline scorer.

Batch 50 entities per request with an identified User-Agent, maxlag=5, sequential requests spaced by at least one second, incremental JSON caching, and retries that leave failures uncached. Explicit response-size truncation retries only omitted entities in smaller batches. Resolve item properties to English labels, skip missing/redirect entities and deprecated statements, and prefer preferred rank. Dates require day precision and the Gregorian calendar because the current schemas require YYYY-MM-DD; month/year claims are skipped without inventing days. Apply preserves key order, two-space indentation, trailing newline, BOM and existing line endings.

Validation: 497 tests passed with an external data checkout and explicit basetemp; mypy passed across 108 app files; ruff passed across app/tests. Fifteen mocked tests cover mappings, rank, precision, no-overwrite, redirects/missing entities, rate spacing, cache reuse, error handling, response truncation and dry-run/apply serialization. Full-category dry runs did not apply any dataset records.

Category Records Changed records Field fills Green before Green after New green Lost green
software 42,493 9,655 10,068 216 366 150 0
website 40,084 202 221 7,623 7,642 49 30
Category Field Fills
software release_date 13
software developers 102
software publishers 10
software operating_systems 741
software licenses 37
software genres 8
software programming_languages 9,157
website homepage_url 25
website launch_date 119
website languages 34
website owners 43

The 30 website green losses come from pre-Web newspaper inception dates that trigger launch_date_plausible; the requested direct P571 mapping is preserved. For example, Aftenposten receives 1860-05-14 and moves from 78.8 to 73.3. Review this semantic ambiguity before applying. Offline green projections do not promote records or prove source liveness.

Refs #99
Refs GetTechAPI/TechAPI#295

P571 is the owner's inception (e.g. a newspaper founded in 1785), so dates
before 1991 are skipped for launch_date.

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

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants