wikivoyage: withhold the Wikitravel layer, add record links and citations (v2#110)
Withholds the Wikitravel layer of wikivoyage and adds the per-record links and source fields (v2#110, 1A, 3B). This PR carries the code for all seven wiki sources; the wikibooks (#142), wiktionary_examples (#143), plwiki_talk (#144) and plwiki_user_talk (#145) data are in their own PRs, wikinews and wikipedia later.
Withheld: the 6,328 pages whose shipped revision carries {{Atrybucja}} (6,326) or {{Import}} (2, a redirect to it). The template gives the Wikitravel text as CC BY-SA 1.0, which does not let adaptations move to a later version, and whether Wikitravel's own move to 3.0 covers the imported text is not checked page by page. build.json lists them by template (page id, title).
Labels per record (7,312 documents, 14,084,102 tokens; was 13,640 / 16,958,893)
| label | documents | tokens | share |
|---|---|---|---|
CC-BY-SA-3.0 |
5,399 | 4,228,272 | 30.0% |
CC-BY-SA-3.0 AND CC-BY-SA-4.0 |
1,179 | 8,897,895 | 63.2% |
CC-BY-SA-4.0 |
734 | 957,935 | 6.8% |
Sidecar: each line gains permalink, history_url, license_urls and conversion, plus citations (54 rows have any) and source_notes (empty: the pages with a source template are the withheld ones). The card gains the quotation paragraph (Art. 29) and its Not-checked entries are reworded to match. The created range now starts 2013-09-07 (sources.py).
Code:
wiki_history.py:LICENSE_URLS,CONVERSIONandrecord_links, which give the four link fields;apply_labelstakes the source.rights.py:WITHHELD_TEMPLATES(wikivoyageAtrybucja/Import, wikibooksGFDL-tekst),IMPORT_TEMPLATES(the Wikinews partners, wikibooksCc-by-3.0-tekst) and 4 wikibooksDROPPED_PAGES(GNU FDL text added after 2008-11-01).fetch_wikimedia.py:withheld_templatewithholds a page by template on its shipped revision;provenanceaddscitationsandsource_notes(page_sources) from the build's dump;with_importsadds an imported text's licence to the label; the datasheet writes the links, quotation and source paragraphs and the withheld line.clean_plwiki_talk.py: aprovenancestep reads the talk citations from the pages-meta-current dump, checks each row's revision time and wikitext length, redacts them withredact_piiand counts the redactions inqa.json;build_plwiki_talk_pl.pykeeps the revision id.fetch_wiktionary_examples.py: title, URL and the link fields per row, and a check that each row's credit matches its page title.
Tests: the wikivoyage and wiki_history tests pass. Until their data PRs are merged, these fail: the 3 data tests in test_wikibooks_contract, test_every_row_label_follows_its_contribution_basis and test_citations_are_redacted_and_counted for both talk sources, test_labels_by_contribution_date (wiktionary_examples), test_every_row_is_labelled_by_contribution (wikipedia) and test_wikinews_contract. With the sibling data in place they pass, except test_wikinews_contract, which waits for the wikinews data PR (its card and sidecar are rebuilt there); the full suite shows no new failures against the baseline (LFS-pointer shards in the worktree). README, CHANGELOG and totals are left to v2#80.
🤖 Generated with Claude Code
refs/pr/141 ref