Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not panic on missing .html #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

petrzjunior
Copy link

Fixes #49

This is an attempt to fix articles with missing article_body.html fields. I downloaded the Wikidata Enterprise export for several languages and I notices that some articles are indeed missing the HTML field.

For example this article only has wikitext, but no html:

{
  "name": "Linka B (metro v Praze)",
  "identifier": 92076,
  "date_modified": "2024-10-09T08:01:21Z",
  "url": "https://cs.wikipedia.org/wiki/Linka_B_(metro_v_Praze)",
  "in_language": {
    "identifier": "cs"
  },
  "main_entity": {
    "identifier": "Q1460442",
    "url": "https://www.wikidata.org/entity/Q1460442"
  },
  "is_part_of": {
    "identifier": "cswiki",
    "url": "https://cs.wikipedia.org"
  },
  "article_body": {
    "wikitext": "{{Různé významy|tento = lince pražského metra|stránka = B (linka)}}\n..."
  },
  ...
}

According to the Wikidata docs, this field is not required.

In the PR, I made the field optional and print a warning in case such article is parsed. Previously, it crashed the process.

cc @rtsisyk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing field html at line 1 column 3685
1 participant