Datasets:
wolne_lektury: label each row with its own Wolne Lektury licence; drop 2 unlicensed rows (v2#57)
What and why
Implements slayerlabs/polish-dynaword-v2#57 for wolne_lektury. Through v0.2.5, all 6,078 rows carried one label, CC-BY-SA-4.0 / Wolna Sztuka 1.3, but Wolne Lektury (WL) states a licence per book. Each row now carries the licence that its own WL book states in dc:rights / dc:rights.license, never its parent collection's. The registry entry becomes license_spdx: MIXED.
| label | rows |
|---|---|
public-domain |
4,559 |
LAL-1.3 |
1,467 |
CC-BY-SA-3.0-PL |
34 |
CC-BY-SA-4.0 |
11 |
CC-BY-SA-3.0 |
5 |
2 rows are dropped (approved in chat on 2026-10-07): two Horace odes translated by Paweł Kozioł that WL gives no usable licence. A new stats key, drop_rights, records them.
| before (this PR's base) | after | change | |
|---|---|---|---|
| documents | 6,078 | 6,076 | −2 |
| chars | 230,764,171 | 230,761,977 | −2,194 |
| tokens | 90,654,820 | 90,653,913 | −907 |
How a row is matched to its book
src/wolne_lektury_licences.py (new; unit tests in src/test_wolne_lektury_licences.py) does the following:
Fetch. It reads the WL API catalogue, each book's API entry (for its media URLs; some files are not named after the slug), the RDF header of each book's XML, and the head and tail of its txt export, using HTTP Range requests. Everything is cached.
--offlinereruns from the cache.Exact match, 5,727 rows. After whitespace normalisation, the row starts with the book's head and ends with its tail (footer cut).
Fuzzy match, 332 rows. These are texts WL has edited since the scrape: modernised spelling,
(→[, ISBN lines added, reworded openings. The row needs a 5-word-shingle share of ≥ 0.6 at both ends. On this shard those rows score ≥ 0.66 against their own book, and no other book scores above 0.04.Parent rule. A collection is dropped from the candidates when one of its parts (
dc:relation.hasPart) also matches. That way the part's licence is the one used. A longer collection cannot match on the fuzzy tier anyway, because its tail differs.Manual, 17 rows, each checked by hand against the current WL text:
- the prologue and the ten days of the Decameron, which WL has merged into one book (Boyé's translation);
- Leśmian's W malinowym chruśniaku cycle, which has no txt export;
- 4 texts with modernised spelling (Dumas, 3 × Antoniewicz);
- one Baczyński text whose dedication is now a footnote.
The licence still comes from the named book's own header. A MANUAL entry that starts matching on its own fails the run.
Classification fails closed. A label is set only when the rights text is unambiguous:
- Public domain: a public-domain statement with no 4-digit year after 1955 anywhere in it. This catches WL's own death years, and also its typo "Pawlikowska-Jasnorzewska zm. 2015".
- A licence: exactly one licence with its version. A Creative Commons licence without a version → no label. Public domain combined with a licence → no label.
- Identical texts: if a text matches several identical books, they must agree on the licence.
Any other row stops the build.
data/wolne_lektury/wolne_lektury.licences.tsv lists each row with these columns: id, slug, match, license, wl_rights, wl_license_url. src/clean_wolne_lektury.py applies it after the eltec_pol dedup (#72). The build fails unless the TSV labels exactly the kept rows with known labels. src/test_wolne_lektury_contract.py checks the parquet, the TSV, the stats, the registry and the card against each other.
Dropped (2)
| id | WL book | WL dc:rights |
|---|---|---|
| wolne_lektury_2373187 | do-manliusa-torkwata (Horace IV,7; 1,316 chars) | "Domena publiczna - Marceli Motty zm. 1898; CC BY-SA - Paweł Kozioł" |
| wolne_lektury_2373208 | do-taliarcha (Horace I,9; 878 chars) | "CC BY-SA" (no version, no URL); WL's own txt footer for it says public domain |
Their collection, horacy-wybrane-utwory, is LAL 1.3. Its licence was not taken, per the #57 rule. Both ids are pinned in UNLICENSED. The cleaner fails if one of them is missing from its input, and the labeller fails if one of them starts to label cleanly.
For review / open questions
Lawyer question: WL's critical-edition reservation. 7,331 of the 7,344 WL txt exports fetched end with a footer in which Fundacja Wolne Lektury reserves the rights to the critical edition under art. 99(2) of the Polish copyright act. The released text has no footer, footnotes or motifs, but it is WL's edited text. Does art. 99(2) reach the public-domain rows?
Public-domain rows without a year. 42 PD rows have no year in
dc:rights. Most give a century (e.g. "XVIII w.") or "akt prawny". 17 rest on WL's statement alone. Among them:- translations labelled only "Domena publiczna": Verne's W 80 dni, Dickens' Opowieść wigilijna, Schopenhauer tr. Jan Błeszyński;
- "Czesław Halicz (wł. Czesława Endelmanowa-Rosenblattowa)", with no death year.
The whole list can be found with
grepin the TSV. They are labelled as WL states.Decameron. The 11 rows take the licence of WL's merged
boccaccio-dekameron(public domain, Boyé). The text of these rows is the older per-day version.authoris still empty. It could be filled fromdc:creatorand the translator. Not done here.Paper. The paper table still shows the old single label. That is to be updated after the v0.2.6 freeze.
README. The README is not touched, per the source-PR rule. Its row is regenerated at release.
Tests
pytest from the repo root: 812 passed. Each new rule (parent rule, both-ends condition, unversioned CC, stale MANUAL, stale UNLICENSED, the drop's presence check, the API media URL) makes a test fail when it is broken.
Sample
python3 src/render_sample.py data/wolne_lektury/wolne_lektury.parquet -n 3 --max-chars 500
id: wolne_lektury_2375067
source: wolne_lektury
added: 2026-06-15
created: 1500-01-01, 2024-12-31
token_count: 1536
license: public-domain
author:
Artur Oppman
Legendy warszawskie
Biała dama
I
Stanisław August siadł na tronie,
Głośne mu „Wiwat” lud wykrzyka,
I miecz Batorych ujął w dłonie,
Lecz to nie dłonie wojownika.
Nie do pancerza pierś królewska,
Ani do hełmu białe czoło, —
A tu się chmurzy toń niebieska
I groźne wichry szumią wkoło.
Czyha na Polską cudzoziemiec,
Słabnie potęga ojców stara,
W Rzeczpospolitej Moskal, Niemiec
Rządzi się właśnie, jak gęś szara.
Wprowadza wojska swoje wraże,
Wolność narodu pcha w mogiłę, — […]
id: wolne_lektury_2371920
source: wolne_lektury
added: 2026-06-15
created: 1500-01-01, 2024-12-31
token_count: 219
license: LAL-1.3
author:
Agnieszka Wolny-Hamkało
Nikon i Leica
norwesko-polskie spotkania w ogrodach BUW-u
Kobietą leżącą w fontannie
była Rita Marhaug —
norweska artystka z Bergen,
która nie bała się deszczowej pogody.
W spotkaniach wziął udział
także Jan Mioduszewski: człowiek-drzewo,
artysta otrzaskany w kabale.
Tym razem działał przy pomocy szminki
i symbolicznej symbiozy mocznika
z klejami przemysłowymi. Od początku
był wielki. Jako dziecko bawił się na uboczu
i podobnie jak Francis Bacon — nigdy nie mógł […]
id: wolne_lektury_2373733
source: wolne_lektury
added: 2026-06-15
created: 1500-01-01, 2024-12-31
token_count: 164
license: public-domain
author:
Jan Kochanowski
Fraszki, Księgi wtóre
Do fraszek
Fraszki moje (coście mi dotąd zachowały),
Nie chcę, żebyście kogo źle wspominać miały.
Lecz jeśli wam nie g'myśli cudze obyczaje,
Niechaj karta występom, nie personom łaje!
Chcecie li chwalić kogo, chwalcież, ale skromnie,
By pochlebstwa jakiego nie uznano po mnie.
To też wiedzcie, że drudzy swej się chwały wstydzą
Podobno, że chwalnego w sobie nic nie widzą.
🤖 Generated with Claude Code
refs/pr/99 ref