Add permissively licensed OPEN ICM Polish publications pilot

#34
artifacts/open_icm_pl_ontology_manifest.json ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "actors": [
3
+ {
4
+ "id": "actor:piotrsty",
5
+ "type": "Contributor"
6
+ },
7
+ {
8
+ "id": "actor:icm-uw",
9
+ "type": "Organization"
10
+ },
11
+ {
12
+ "id": "actor:codex",
13
+ "type": "Agent"
14
+ }
15
+ ],
16
+ "claims": [
17
+ {
18
+ "falsification_condition": "The pinned Parquet, decisions or overlap report do not reproduce these counts.",
19
+ "id": "claim:open-icm-target-retention",
20
+ "statement": "The proposed DynaWord slice contains 85 records after excluding 10 exact title/DOI overlaps.",
21
+ "supported_by": [
22
+ "evidence:open-icm-target-stats:49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c",
23
+ "evidence:open-icm-target-overlap:c05fccedde6965de8dcaf62fd1233fe3fa77cdd105c426f9f6d5474684303a61"
24
+ ]
25
+ },
26
+ {
27
+ "falsification_condition": "Target-wide text deduplication and controlled ablations establish those properties.",
28
+ "id": "claim:open-icm-training-value-untested",
29
+ "statement": "Net text novelty and training benefit remain untested hypotheses.",
30
+ "supported_by": [
31
+ "evidence:open-icm-target-overlap:c05fccedde6965de8dcaf62fd1233fe3fa77cdd105c426f9f6d5474684303a61"
32
+ ]
33
+ }
34
+ ],
35
+ "evidence": [
36
+ {
37
+ "artifact": "data/open_icm_pl/open_icm_pl.stats.json",
38
+ "content_address": "49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c",
39
+ "id": "evidence:open-icm-target-stats:49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c",
40
+ "observation_type": "target_slice_counts",
41
+ "produced_by": "run:open-icm-dynaword-integration:49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c"
42
+ },
43
+ {
44
+ "artifact": "data/open_icm_pl/open_icm_pl.overlap_audit.json",
45
+ "content_address": "c05fccedde6965de8dcaf62fd1233fe3fa77cdd105c426f9f6d5474684303a61",
46
+ "id": "evidence:open-icm-target-overlap:c05fccedde6965de8dcaf62fd1233fe3fa77cdd105c426f9f6d5474684303a61",
47
+ "observation_type": "metadata_overlap_audit",
48
+ "produced_by": "run:open-icm-dynaword-integration:49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c"
49
+ }
50
+ ],
51
+ "objects": [
52
+ {
53
+ "id": "object:dataset:open-icm-pl-pilot",
54
+ "type": "Dataset"
55
+ },
56
+ {
57
+ "id": "object:dataset:open-icm-pl-dynaword-slice",
58
+ "type": "Dataset"
59
+ }
60
+ ],
61
+ "pending": [
62
+ "cross-source text deduplication",
63
+ "benchmark contamination check",
64
+ "review of quoted third-party text",
65
+ "controlled training ablation"
66
+ ],
67
+ "protocols": [
68
+ {
69
+ "id": "protocol:open-icm-dynaword-integration-v1",
70
+ "procedure": "exclude source-QA failures and exact normalized-title or DOI overlaps with pinned biblioteka_nauki; preserve attribution and pending text-level gates"
71
+ }
72
+ ],
73
+ "relations": [
74
+ {
75
+ "predicate": "DERIVED_FROM",
76
+ "source": "version:dataset:open-icm-pl-dynaword:11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31",
77
+ "target": "hf:dataset:PiotrSty/open-icm-pl-publications@c4a20022e6947f55f82c3354bb5c86609ba681b8"
78
+ },
79
+ {
80
+ "predicate": "GENERATED_BY",
81
+ "source": "version:dataset:open-icm-pl-dynaword:11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31",
82
+ "target": "run:open-icm-dynaword-integration:49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c"
83
+ },
84
+ {
85
+ "predicate": "VALIDATED_AGAINST",
86
+ "source": "version:dataset:open-icm-pl-dynaword:11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31",
87
+ "target": "hf:dataset:SlayerLab/polish-dynaword@fe44303ea2db290c7a195264226477f724973357"
88
+ }
89
+ ],
90
+ "runs": [
91
+ {
92
+ "actor": "actor:codex",
93
+ "finished_at": "2026-09-10T16:47:55.647670+00:00",
94
+ "id": "run:open-icm-dynaword-integration:49bfaa6003187e9089ef804aa5ca1bd196bf75925443fab1f352fe0cef19ea0c",
95
+ "protocol": "protocol:open-icm-dynaword-integration-v1",
96
+ "started_at": "2026-09-10T16:47:55.647670+00:00",
97
+ "stats": {
98
+ "added": "2026-09-10",
99
+ "author_coverage": 1.0,
100
+ "characters": 6219019,
101
+ "kept": 85,
102
+ "license_counts": {
103
+ "CC-BY-3.0-PL": 32,
104
+ "CC-BY-4.0": 7,
105
+ "CC-BY-SA-3.0": 1,
106
+ "CC-BY-SA-3.0-PL": 38,
107
+ "CC-BY-SA-4.0": 7
108
+ },
109
+ "sample_count": 12,
110
+ "source_pilot_acquired": 100,
111
+ "source_pilot_kept": 95,
112
+ "target_overlap_excluded": 10,
113
+ "target_revision": "fe44303ea2db290c7a195264226477f724973357",
114
+ "tokens": 2358174
115
+ },
116
+ "success": true
117
+ }
118
+ ],
119
+ "schema": "slayer-research-ontology-profile-v1",
120
+ "versions": [
121
+ {
122
+ "content_address": "c4a20022e6947f55f82c3354bb5c86609ba681b8",
123
+ "id": "hf:dataset:PiotrSty/open-icm-pl-publications@c4a20022e6947f55f82c3354bb5c86609ba681b8",
124
+ "object": "object:dataset:open-icm-pl-pilot"
125
+ },
126
+ {
127
+ "content_address": "11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31",
128
+ "id": "version:dataset:open-icm-pl-dynaword:11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31",
129
+ "object": "object:dataset:open-icm-pl-dynaword-slice"
130
+ }
131
+ ]
132
+ }
artifacts/source_findings.md CHANGED
@@ -971,3 +971,40 @@ Quarterly peer-reviewed journal published by the **Biuro Analiz Sejmowych (BAS)*
971
  `biblioteka_nauki` still needs cross-source dedup because its current upstream
972
  catalogue exposes 105 of these articles even though the released local shard
973
  does not contain them.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
971
  `biblioteka_nauki` still needs cross-source dedup because its current upstream
972
  catalogue exposes 105 of these articles even though the released local shard
973
  does not contain them.
974
+
975
+ ---
976
+
977
+ ## open_icm_pl — OPEN ICM open-access publications (pilot)
978
+
979
+ **Investigated** — 2026-09-10 (review round 2026-09-28).
980
+
981
+ **Verdict** — `added` (proposed with `release: None`). 85 publications / 2.36M
982
+ `cl100k_base` tokens — a deterministic 100-record pilot of the OPEN ICM
983
+ repository (ICM UW). Small on purpose: yields must not be extrapolated to the
984
+ 6,183 eligible items.
985
+
986
+ **Enumeration** — official DSpace API (`/server/api/core/items`), fail-closed
987
+ license/language gate; repository-generated TEXT bitstreams (MD5-verified)
988
+ fetched after the origin's interactive CAPTCHA. 100 acquired -> 95 after QA ->
989
+ 85 after removing 10 exact title/DOI matches against `biblioteka_nauki`.
990
+
991
+ **License evidence** — verified AT THE ORIGIN: per-item `dc.rights` +
992
+ `dc.rights.uri` in the portal's item metadata (example: "Uznanie autorstwa 3.0
993
+ Polska" -> creativecommons.org/licenses/by/3.0/pl/ on
994
+ <https://open.icm.edu.pl/items/0078ca93-45a5-4bef-912d-297c069ee6ab>, also
995
+ machine-readable at `/server/api/core/items/0078ca93-...`); 77 of 85 items
996
+ additionally ship a per-item `license.txt` bitstream (checksum-pinned).
997
+ Allowlist: CC BY / CC BY-SA only (3.0-PL / 3.0 / 4.0); NC and "dozwolony
998
+ użytek" rejected.
999
+
1000
+ **Blockers** — none to merge with `release: None`. Before release: NERGAL pass -
1001
+ the residual spot check FOUND one glyph-garbled contact the patterns missed
1002
+ (`JKolbusz @wsiz.rzeszow.pl` in `open_icm_pl_6ec903ca-...`); extraction noise
1003
+ defeats pattern matching, so the model-based scrubber is the real gate. Also
1004
+ cross-source text dedup (the 10 exclusions were metadata-level) and review of
1005
+ quoted third-party passages.
1006
+
1007
+ **Lesson** — (1) pattern scrubbers fail on PDF-extraction glyph noise - always
1008
+ spot-check noisy sources, a "0 residual" pattern count is not evidence; (2)
1009
+ CAPTCHA-gated origins are reproducible only via pinned checksums, not re-fetch -
1010
+ say so in the datasheet instead of pretending a before/after can be regenerated.
data/open_icm_pl/NOTICE.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Attribution and license notice
2
+
3
+ Source: OPEN ICM, https://open.icm.edu.pl/home
4
+
5
+ Each record retains its item URL, authorship, repository license label, normalized license identifier, bitstream metadata and license evidence where exposed by OPEN ICM. The applicable CC BY or CC BY-SA terms and attribution obligations apply per record; consult `artifacts/attribution.jsonl`.
6
+
7
+ Preparation: Piotr Styla with OpenAI Codex. Changes: repository TEXT selection, Unicode and whitespace normalization, page-number-only removal, line-wrap repair, limited email and labelled-phone redaction, language/quality filtering and within-source deduplication. No endorsement by OPEN ICM or credited authors is implied.
data/open_icm_pl/open_icm_pl.attribution.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3019903082ad4b4eed4955a19b44e81dddf247341be0cae9467380d6532c7590
3
+ size 172553
data/open_icm_pl/open_icm_pl.checksums.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "NOTICE.md": "e8b706e3aeddc659c8a20b3354ed78c75f5ff5d3801dfed13f100b5253097927",
3
+ "open_icm_pl.attribution.jsonl": "3019903082ad4b4eed4955a19b44e81dddf247341be0cae9467380d6532c7590",
4
+ "open_icm_pl.decisions.jsonl": "8f1d90bb052398bcd18eae457218f8b5b9d68ce8dd114168b1fff305570a4eda",
5
+ "open_icm_pl.md": "1f94660f48755dc3350c7bb467d23d1baebfb0fb36ebdbf925e0d0cb9b205ff0",
6
+ "open_icm_pl.overlap_audit.json": "95d29efa6a0038913bcb91a4bdc6ba25aa85d081eff5f85fedc9c63e2f50e967",
7
+ "open_icm_pl.parquet": "11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31",
8
+ "open_icm_pl.qa.json": "0f9bf4531e33d0ec141b50ad08756ac90c663eac0786691ac80bb0f6f265dcce",
9
+ "open_icm_pl.sample.jsonl": "90559234a0e0debca6671470bb434a37fe5f7e6962dd12f1ecdb232a234844df",
10
+ "open_icm_pl.stats.json": "4c62ecf5979a1936bff91657d14ef60c27de5e3d71afd77419b2f855b7f57520"
11
+ }
data/open_icm_pl/open_icm_pl.decisions.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f1d90bb052398bcd18eae457218f8b5b9d68ce8dd114168b1fff305570a4eda
3
+ size 34473
data/open_icm_pl/open_icm_pl.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OPEN ICM Polish publications pilot
2
+
3
+ This target-specific slice is derived from the deterministic 100-record OPEN ICM pilot.
4
+
5
+ - Acquired: 100; retained after source QA: 95
6
+ - Exact title/DOI overlaps with `biblioteka_nauki` excluded: 10
7
+ - Proposed records: 85
8
+ - Proposed tokens: 2,358,174 (`cl100k_base` proxy)
9
+ - Characters: 6,219,019; author coverage: 100.0%
10
+ - License: per-record allowlisted CC BY or CC BY-SA variant
11
+ - Immutable source snapshot: https://huggingface.co/datasets/PiotrSty/open-icm-pl-publications/tree/c4a20022e6947f55f82c3354bb5c86609ba681b8
12
+
13
+ Per-record attribution, item URLs, license labels, normalized identifiers,
14
+ bitstream metadata and checksums are preserved. The DynaWord proposal excludes
15
+ all exact normalized-title or DOI matches found against 42,071 pinned
16
+ `biblioteka_nauki` rows. Cross-source text deduplication and benchmark checks
17
+ remain integration gates. Repository-generated TEXT can retain PDF extraction
18
+ errors, omit figures and flatten tables. Item-level licensing does not establish
19
+ the status of every quoted third-party passage.
20
+
21
+ ## Origin and license at the origin
22
+
23
+ - Origin portal: **OPEN ICM** (Interdisciplinary Centre for Modelling, University
24
+ of Warsaw) - <https://open.icm.edu.pl/home>. Items are discovered through the
25
+ official DSpace API (`/server/api/core/items`), each record pins its
26
+ `landing_url`, e.g.
27
+ <https://open.icm.edu.pl/items/0078ca93-45a5-4bef-912d-297c069ee6ab>.
28
+ - License statement **on the portal** (not the mirror): every item carries
29
+ `dc.rights` + `dc.rights.uri` in its origin metadata - e.g. the item above
30
+ declares `dc.rights: "Uznanie autorstwa 3.0 Polska"` with
31
+ `dc.rights.uri: http://creativecommons.org/licenses/by/3.0/pl/`, readable
32
+ without JavaScript at
33
+ <https://open.icm.edu.pl/server/api/core/items/0078ca93-45a5-4bef-912d-297c069ee6ab>
34
+ and rendered on the landing page. 77 of 85 records additionally ship a
35
+ per-item `license.txt` bitstream, pinned by checksum in
36
+ `open_icm_pl.attribution.jsonl` (`license_evidence`).
37
+ - Allowlisted labels only (fail-closed gate in the fetch script):
38
+ CC-BY-3.0-PL (32), CC-BY-SA-3.0-PL (38), CC-BY-SA-3.0 (1), CC-BY-4.0 (7),
39
+ CC-BY-SA-4.0 (7). `Dozwolony użytek` and NC variants are rejected.
40
+
41
+ ## What the texts are
42
+
43
+ - **Genre**: Polish open-access academic publications - journal articles
44
+ (economics, psychology, pedagogy, law), monographs and edited volumes,
45
+ conference texts. One record per publication.
46
+ - **Register**: formal academic written Polish with abstracts, bibliographies
47
+ and byline blocks (authors, affiliations, ORCID, contact e-mails). Text is
48
+ repository-generated from PDFs (`is_ocr`-like extraction): math/font glyph
49
+ noise ("❬❜❡♥✐❛✳❛❧..."), hex-encoded UTF-16 fragments and flattened tables
50
+ survive in places.
51
+ - **Time span**: `issued` 1998 - 2024-09 (the deterministic 100-record pilot;
52
+ 6,183 items are eligible in total - yields must not be extrapolated).
53
+
54
+ ## Scrubber and residual-PII spot check
55
+
56
+ Scrubber that ran: **pattern redaction in `src/fetch_open_icm_pl.py`** (e-mail ->
57
+ `[REDACTED:EMAIL]`, labelled phone -> `[REDACTED:PHONE]`, ID/IBAN patterns;
58
+ pipeline counts over the shard: 112 e-mail and 4 labelled-phone redactions).
59
+ This is **not** [SlayerLab/NERGAL](https://huggingface.co/SlayerLab/NERGAL); the
60
+ shard must be re-run through NERGAL before it is admitted to a release. Merge
61
+ with `release: None` is fine meanwhile.
62
+
63
+ Residual-PII spot check (60 of 85 records, seed 20260928): 85 `[REDACTED:EMAIL]`
64
+ placeholders confirm the redaction works on clean contacts; **one real residual
65
+ contact was found** - a glyph-garbled work e-mail in
66
+ `open_icm_pl_6ec903ca-db89-4a17-acc8-850420c468ac` ("JKolbusz @wsiz.rzeszow.pl",
67
+ stray space before `@` in a line mangled by broken font encoding) that the
68
+ pattern missed. Benign non-hits: 161 digit runs (DOIs, URL slugs), 5 26-digit
69
+ runs (hex-encoded UTF-16 extraction garbage), 1 IPv4-like hit (a CiteSeerX DOI
70
+ URL fragment), 28 ORCIDs and 25 institutional byline addresses. Residual risk is
71
+ MODERATE - extraction noise breaks pattern matching (the missed contact is
72
+ proof), which is precisely why NERGAL (model-based) is the release gate.
73
+
74
+ ## Normalization and reproducibility note
75
+
76
+ `src/fetch_open_icm_pl.py` downloads the repository-generated TEXT bitstreams
77
+ (MD5-verified against declared checksums) and applies Unicode/whitespace
78
+ normalization, PII pattern redaction, language/quality filtering and exact/near
79
+ deduplication. Raw->shipped before/after excerpts cannot be regenerated
80
+ anonymously at review time: the OPEN ICM bitstream endpoints serve an
81
+ interactive CAPTCHA page to anonymous clients (the acquisition recorded in
82
+ `attribution.jsonl` went through it). The raw bitstreams are pinned by
83
+ checksum per record; the extraction-artifact residue is visible in the corpus
84
+ samples.
data/open_icm_pl/open_icm_pl.overlap_audit.json ADDED
@@ -0,0 +1,819 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "candidate_records": 100,
3
+ "method": "DOI or normalized title substring; fallback SequenceMatcher >= 0.90 over attribution titles",
4
+ "observed_at": "2026-09-10T08:08:03.451328+00:00",
5
+ "records_with_exact_match": 10,
6
+ "records_with_fuzzy_match": 0,
7
+ "results": [
8
+ {
9
+ "doi": [],
10
+ "exact_title_or_doi_matches": [],
11
+ "fuzzy_title_matches": [],
12
+ "item_id": "0078ca93-45a5-4bef-912d-297c069ee6ab",
13
+ "title": "Przedstawienia rodziny w komiksie – uwikłania ideologiczne"
14
+ },
15
+ {
16
+ "doi": [
17
+ "10.34616/wwr.2019.2.373.383"
18
+ ],
19
+ "exact_title_or_doi_matches": [
20
+ {
21
+ "attribution": "Grażyna Lubowicka | 2019 | Żądanie Antygony. Normy i nienormatywny model rodziny Judith Butler",
22
+ "id": "biblioteka_nauki_articles_2127396"
23
+ }
24
+ ],
25
+ "fuzzy_title_matches": [],
26
+ "item_id": "02ed3b1f-9b49-4d37-aef3-0fb5ea3644a7",
27
+ "title": "Żądanie Antygony. Normy i nienormatywny model rodziny Judith Butler"
28
+ },
29
+ {
30
+ "doi": [],
31
+ "exact_title_or_doi_matches": [],
32
+ "fuzzy_title_matches": [],
33
+ "item_id": "033e43b6-ce8f-471d-a9e9-ddae41889117",
34
+ "title": "Wybrane modele doskonałości jako przykład kształtowania jakości w placówkach medycznych"
35
+ },
36
+ {
37
+ "doi": [
38
+ "10.6084/m9.figshare.980699"
39
+ ],
40
+ "exact_title_or_doi_matches": [],
41
+ "fuzzy_title_matches": [],
42
+ "item_id": "047046a5-1eda-4f87-86a8-6322a0b1c060",
43
+ "title": "Przestrzeń i tożsamość. Refleksje z antropologii przestrzeni"
44
+ },
45
+ {
46
+ "doi": [],
47
+ "exact_title_or_doi_matches": [],
48
+ "fuzzy_title_matches": [],
49
+ "item_id": "08486a8e-0ea6-4334-a018-32f33f4055ec",
50
+ "title": "Wywiad z Andrzejem Klimczukiem: Razem kreatywniej"
51
+ },
52
+ {
53
+ "doi": [
54
+ "10.23734/wwr20152.083.102"
55
+ ],
56
+ "exact_title_or_doi_matches": [],
57
+ "fuzzy_title_matches": [],
58
+ "item_id": "0afdc44e-d37d-4180-a084-3f05bdcd7925",
59
+ "title": "Aktualność Jana Pawła II koncepcji wychowania w rodzinie"
60
+ },
61
+ {
62
+ "doi": [],
63
+ "exact_title_or_doi_matches": [],
64
+ "fuzzy_title_matches": [],
65
+ "item_id": "0dccc307-5583-4ea7-9261-9300edab5fc6",
66
+ "title": "Dzień dobry! Ale co to znaczy dobry dzień?"
67
+ },
68
+ {
69
+ "doi": [],
70
+ "exact_title_or_doi_matches": [],
71
+ "fuzzy_title_matches": [],
72
+ "item_id": "0e96ee0c-a323-443f-8a97-9ba0c7a097ce",
73
+ "title": "Współczesne koncepcje filozofii i etyki"
74
+ },
75
+ {
76
+ "doi": [
77
+ "10.5604/01.3001.0015.7110"
78
+ ],
79
+ "exact_title_or_doi_matches": [],
80
+ "fuzzy_title_matches": [],
81
+ "item_id": "114d4650-7aab-4262-b142-97c5a4db09b8",
82
+ "title": "Moment poniesienia kosztów inwestycji w Polskiej Strefie Inwestycji"
83
+ },
84
+ {
85
+ "doi": [],
86
+ "exact_title_or_doi_matches": [],
87
+ "fuzzy_title_matches": [],
88
+ "item_id": "14f37950-1cda-420c-82e3-bba1c95c913a",
89
+ "title": "Nietrwałość wzorców osobowych"
90
+ },
91
+ {
92
+ "doi": [],
93
+ "exact_title_or_doi_matches": [],
94
+ "fuzzy_title_matches": [],
95
+ "item_id": "168531fb-d5ad-4946-b065-e039614c095c",
96
+ "title": "Przezwyciężanie kryzysu w procesie integracji europejskiej poprzez zmiany regulacji dotyczących udziału obywateli UE w podejmowaniu i realizacji decyzji"
97
+ },
98
+ {
99
+ "doi": [],
100
+ "exact_title_or_doi_matches": [],
101
+ "fuzzy_title_matches": [],
102
+ "item_id": "1a7a6fd5-de21-4bce-a186-a6c896ab7a1e",
103
+ "title": "Znaczenie wartości moralnych w działalności gospodarczej przedsiębiorcy"
104
+ },
105
+ {
106
+ "doi": [],
107
+ "exact_title_or_doi_matches": [],
108
+ "fuzzy_title_matches": [],
109
+ "item_id": "1f4656fd-bcb6-4577-b8b4-82aff31e3873",
110
+ "title": "Procesy poznawcze a uzależnienie od grania hazardowego – błędy myślenia nałogowych hazardzistów"
111
+ },
112
+ {
113
+ "doi": [],
114
+ "exact_title_or_doi_matches": [],
115
+ "fuzzy_title_matches": [],
116
+ "item_id": "232f5743-6863-48e3-a87a-12a2b6a5137c",
117
+ "title": "Efektywność i sposoby jej pomiaru oraz rola państwa w jej kreowaniu"
118
+ },
119
+ {
120
+ "doi": [],
121
+ "exact_title_or_doi_matches": [],
122
+ "fuzzy_title_matches": [],
123
+ "item_id": "23f7e569-c7e0-4e49-a38e-d7896bacf996",
124
+ "title": "Zbieranie fragmentów, czyli literackie egzystencje Europy Środkowej"
125
+ },
126
+ {
127
+ "doi": [],
128
+ "exact_title_or_doi_matches": [],
129
+ "fuzzy_title_matches": [],
130
+ "item_id": "241e63dc-f2b5-4e65-a425-c0a142ae2f12",
131
+ "title": "Nowoczesny/ponowoczesny – Grotowski w poszukiwaniu esencji tożsamości Performera"
132
+ },
133
+ {
134
+ "doi": [],
135
+ "exact_title_or_doi_matches": [],
136
+ "fuzzy_title_matches": [],
137
+ "item_id": "28253160-f06b-45cf-84b0-22d9bf73773c",
138
+ "title": "Pielgrzymowanie i turystyka religijna na przykładzie ośrodków pielgrzymkowych w diecezji krakowskiej"
139
+ },
140
+ {
141
+ "doi": [],
142
+ "exact_title_or_doi_matches": [],
143
+ "fuzzy_title_matches": [],
144
+ "item_id": "29a47f77-0b5c-4a0a-9949-c50b789e8d5b",
145
+ "title": "Wyzwania dla jakości w kontekście wymagań normy spalinowej Euro6d – studium przypadku projektu badawczo-rozwojowego realizowanego przy wsparciu NCBR"
146
+ },
147
+ {
148
+ "doi": [
149
+ "10.23734/wwr20171.361.380"
150
+ ],
151
+ "exact_title_or_doi_matches": [
152
+ {
153
+ "attribution": "Beata Gromadzka | 2017 | Kryzys w rodzinie czy kryzys pisania o rodzinie? Na podstawie literatury dla młodzieży na przełomie XX i XXI wieku",
154
+ "id": "biblioteka_nauki_articles_2105687"
155
+ }
156
+ ],
157
+ "fuzzy_title_matches": [],
158
+ "item_id": "2a574e9b-718c-4231-8078-5df5920fc4f3",
159
+ "title": "Kryzys w rodzinie czy kryzys pisania o rodzinie? Na podstawie literatury dla młodzieży na przełomie XX i XXI wieku"
160
+ },
161
+ {
162
+ "doi": [],
163
+ "exact_title_or_doi_matches": [],
164
+ "fuzzy_title_matches": [],
165
+ "item_id": "3cc80540-3717-4da7-b93b-dafe5713d3bf",
166
+ "title": "Człowiek zalogowany 2. Wirtualne społeczności"
167
+ },
168
+ {
169
+ "doi": [],
170
+ "exact_title_or_doi_matches": [],
171
+ "fuzzy_title_matches": [],
172
+ "item_id": "3e1de4ed-5bab-43b9-a0e4-50bb9984ce3e",
173
+ "title": "Coaching jako kluczowy instrument wspierający pracę menedżera"
174
+ },
175
+ {
176
+ "doi": [],
177
+ "exact_title_or_doi_matches": [],
178
+ "fuzzy_title_matches": [],
179
+ "item_id": "410c4772-f264-4874-9ab3-e9cca1d04f20",
180
+ "title": "Retoryka w służbie homiletyki"
181
+ },
182
+ {
183
+ "doi": [],
184
+ "exact_title_or_doi_matches": [],
185
+ "fuzzy_title_matches": [],
186
+ "item_id": "42111533-761c-4afd-b565-170ef8943c2c",
187
+ "title": "„Witajcie w nowej(?) bajce...” O promocji współczesnych bibliotek szkolnych"
188
+ },
189
+ {
190
+ "doi": [],
191
+ "exact_title_or_doi_matches": [],
192
+ "fuzzy_title_matches": [],
193
+ "item_id": "43b4bf1c-ced7-4bbc-befd-87458955a228",
194
+ "title": "Kompetencja społeczna i inteligencja emocjonalna a zaangażowanie w Internet"
195
+ },
196
+ {
197
+ "doi": [],
198
+ "exact_title_or_doi_matches": [],
199
+ "fuzzy_title_matches": [],
200
+ "item_id": "44e7e9f0-254a-4f6d-bc36-4abcc23b8d1d",
201
+ "title": "Uwarunkowania rozwoju połączeń intermodalnych w obsłudze Terminalu Promowego Świnoujście"
202
+ },
203
+ {
204
+ "doi": [],
205
+ "exact_title_or_doi_matches": [],
206
+ "fuzzy_title_matches": [],
207
+ "item_id": "48a62029-a25d-4f60-bdd9-d3be82ab5cff",
208
+ "title": "Być w Górce Klasztornej i pamiętać Kalwarię"
209
+ },
210
+ {
211
+ "doi": [
212
+ "10.12657/czageo-"
213
+ ],
214
+ "exact_title_or_doi_matches": [],
215
+ "fuzzy_title_matches": [],
216
+ "item_id": "49250798-98c0-432f-bcdb-b78eebde7f43",
217
+ "title": "Samoocena poziomu stresu mieszkańców Trójmiasta, Kielc i Lwowa podczas pandemii COVID-19"
218
+ },
219
+ {
220
+ "doi": [],
221
+ "exact_title_or_doi_matches": [],
222
+ "fuzzy_title_matches": [],
223
+ "item_id": "4a657320-9b3f-4281-abee-1b3b7f0ce452",
224
+ "title": "Świadkowie cyberbullyingu – między obojętnością a reakcją"
225
+ },
226
+ {
227
+ "doi": [
228
+ "10.61905/wwr/175101"
229
+ ],
230
+ "exact_title_or_doi_matches": [],
231
+ "fuzzy_title_matches": [],
232
+ "item_id": "53a41688-3bd3-49f9-bb41-0b8cacfc24f8",
233
+ "title": "Macierzyństwo podczas studiów w opinii studentek pedagogiki – komunikat z badań"
234
+ },
235
+ {
236
+ "doi": [],
237
+ "exact_title_or_doi_matches": [],
238
+ "fuzzy_title_matches": [],
239
+ "item_id": "5841c253-2189-4702-898d-602318542ec1",
240
+ "title": "Koncepcja pomiaru efektywności nauczycieli szkół średnich w Polsce"
241
+ },
242
+ {
243
+ "doi": [],
244
+ "exact_title_or_doi_matches": [],
245
+ "fuzzy_title_matches": [],
246
+ "item_id": "596d6e52-f282-4235-adf3-d48fcbae050d",
247
+ "title": "Referat powinien być niczym pocałunek… Metodyczne przesłanie Profesora Floriana Plita wygłoszone do koleżanek i kolegów Wydziału Geografii i Studiów Regionalnych Uniwersytetu Warszawskiego na jednym z pożegnań"
248
+ },
249
+ {
250
+ "doi": [
251
+ "10.24131/3724.24ns01"
252
+ ],
253
+ "exact_title_or_doi_matches": [],
254
+ "fuzzy_title_matches": [],
255
+ "item_id": "5a22a282-110d-4110-a11c-f837adf530a1",
256
+ "title": "Naturalne kręgi życia i wychowania człowieka"
257
+ },
258
+ {
259
+ "doi": [
260
+ "10.12797/9788383680491"
261
+ ],
262
+ "exact_title_or_doi_matches": [],
263
+ "fuzzy_title_matches": [],
264
+ "item_id": "5fc6e6dd-112b-4c8f-9ced-f1ede5525338",
265
+ "title": "Polskie studia wywiadowcze. Stan i perspektywy badań"
266
+ },
267
+ {
268
+ "doi": [],
269
+ "exact_title_or_doi_matches": [],
270
+ "fuzzy_title_matches": [],
271
+ "item_id": "627960f5-2ef2-44a6-83cd-6784d1f8b601",
272
+ "title": "Fotocodzienność. Próba analizy fenomenu aplikacji Instagram"
273
+ },
274
+ {
275
+ "doi": [
276
+ "10.31261/ppk.2021.05.08"
277
+ ],
278
+ "exact_title_or_doi_matches": [],
279
+ "fuzzy_title_matches": [],
280
+ "item_id": "635e0996-cfbe-4d40-863b-3055e3c35ace",
281
+ "title": "Przyjęcie do wykonania kary orzeczonej przez sądy państwa obcego a prawo łaski"
282
+ },
283
+ {
284
+ "doi": [],
285
+ "exact_title_or_doi_matches": [],
286
+ "fuzzy_title_matches": [],
287
+ "item_id": "65145d4d-d75d-4423-afec-7883814858ab",
288
+ "title": "Zastosowanie polimorfizmu mikrosatelitarnego DNA w kontroli rodowodów koni"
289
+ },
290
+ {
291
+ "doi": [],
292
+ "exact_title_or_doi_matches": [
293
+ {
294
+ "attribution": "Anna Kacperczyk | 2014 | Autoetnografia – technika, metoda, nowy paradygmat? O metodologicznym statusie autoetnografii",
295
+ "id": "biblioteka_nauki_articles_623235"
296
+ }
297
+ ],
298
+ "fuzzy_title_matches": [],
299
+ "item_id": "65bb87ae-682b-4b89-a57b-38f2a770a237",
300
+ "title": "Autoetnografia – technika, metoda, nowy paradygmat? O metodologicznym statusie autoetnografii"
301
+ },
302
+ {
303
+ "doi": [],
304
+ "exact_title_or_doi_matches": [],
305
+ "fuzzy_title_matches": [],
306
+ "item_id": "6922536c-8233-468b-8a4a-f82bc1a4a1ec",
307
+ "title": "Przyrodnicze uwarunkowania rozwoju ekoturystyki w krajach Azji Centralnej powstałych po rozpadzie Związku Radzieckiego"
308
+ },
309
+ {
310
+ "doi": [],
311
+ "exact_title_or_doi_matches": [],
312
+ "fuzzy_title_matches": [],
313
+ "item_id": "6983bc0a-2b5d-4df6-9ccf-2313d845a7da",
314
+ "title": "Ewolucja programu w zakresie konkurencji pływackich oraz udział polskich pływaków w nowożytnych igrzyskach olimpijskich"
315
+ },
316
+ {
317
+ "doi": [],
318
+ "exact_title_or_doi_matches": [
319
+ {
320
+ "attribution": "Marceli Kosman | 2018 | Stanisław Sławomir Nicieja, Kresowa Atlantyda. Historia i mitologia miast kresowych, t. X: Złoczów, Zadwórze, Kozaki, Gańczary, Łanowce, Zasmyki",
321
+ "id": "biblioteka_nauki_articles_616075"
322
+ }
323
+ ],
324
+ "fuzzy_title_matches": [],
325
+ "item_id": "6d1010ff-08f8-4e4d-b529-347de48f82fc",
326
+ "title": "Złoczów"
327
+ },
328
+ {
329
+ "doi": [],
330
+ "exact_title_or_doi_matches": [],
331
+ "fuzzy_title_matches": [],
332
+ "item_id": "6ec903ca-db89-4a17-acc8-850420c468ac",
333
+ "title": "Innowacyjna Gmina. Informatyka w jednostkach samorządu terytorialnego"
334
+ },
335
+ {
336
+ "doi": [],
337
+ "exact_title_or_doi_matches": [],
338
+ "fuzzy_title_matches": [],
339
+ "item_id": "6efbf73b-1271-4dff-825d-af549937c63c",
340
+ "title": "Ograniczenia rozwoju socjologii krytycznej. Próba alternatywnego wyjaśnienia"
341
+ },
342
+ {
343
+ "doi": [],
344
+ "exact_title_or_doi_matches": [],
345
+ "fuzzy_title_matches": [],
346
+ "item_id": "6f1b2524-2c2e-43bb-b980-4dc0176a7483",
347
+ "title": "Kategoria zadowolenia jako kryterium oceny konferencji (KSOW, PO Ryby 2007-2013)"
348
+ },
349
+ {
350
+ "doi": [],
351
+ "exact_title_or_doi_matches": [],
352
+ "fuzzy_title_matches": [],
353
+ "item_id": "6fe4e956-84a4-43f5-b865-7515a92700e8",
354
+ "title": "Polityka zagraniczna Hiszpanii w latach 1833-1914"
355
+ },
356
+ {
357
+ "doi": [],
358
+ "exact_title_or_doi_matches": [],
359
+ "fuzzy_title_matches": [],
360
+ "item_id": "70b6406d-d826-4c12-a210-71389f224e14",
361
+ "title": "Archiwalia pruskich izb handlowych oraz izb gospodarczych III Rzeszy"
362
+ },
363
+ {
364
+ "doi": [],
365
+ "exact_title_or_doi_matches": [],
366
+ "fuzzy_title_matches": [],
367
+ "item_id": "72135cf8-5c7c-40e4-ae0f-d6f09653d808",
368
+ "title": "Koncepcja pomiaru efektywności pracy nauczycieli szkół średnich w Polsce"
369
+ },
370
+ {
371
+ "doi": [],
372
+ "exact_title_or_doi_matches": [],
373
+ "fuzzy_title_matches": [],
374
+ "item_id": "727d10bb-6b67-4995-9abe-152679f6dadc",
375
+ "title": "Orzecznictwo organów dyscyplinarnych w wybranych zawodach zaufania publicznego"
376
+ },
377
+ {
378
+ "doi": [],
379
+ "exact_title_or_doi_matches": [],
380
+ "fuzzy_title_matches": [],
381
+ "item_id": "77cdac24-9c59-4b05-ac1f-11d5db87d0af",
382
+ "title": "Bez obrazu – nieistnienie: o traumatyzującej obawie przed byciem pominiętym przez obraz"
383
+ },
384
+ {
385
+ "doi": [],
386
+ "exact_title_or_doi_matches": [],
387
+ "fuzzy_title_matches": [],
388
+ "item_id": "7b9ddf4a-dca9-47e0-91c6-3fe5951494d9",
389
+ "title": "Geobotaniczne wskaźniki środowiska wysokogórskiego"
390
+ },
391
+ {
392
+ "doi": [],
393
+ "exact_title_or_doi_matches": [],
394
+ "fuzzy_title_matches": [],
395
+ "item_id": "7be89182-597e-4cdc-ad6c-684c1947c7f3",
396
+ "title": "Szczegółowe poziome osnowy geodezyjne - przeszłość, stan aktualny i przyszłość w zakresie ich zakładania i funkcjonowania"
397
+ },
398
+ {
399
+ "doi": [],
400
+ "exact_title_or_doi_matches": [],
401
+ "fuzzy_title_matches": [],
402
+ "item_id": "7d5c4210-d8c7-4f61-8c0e-d1ea4cbbc8f7",
403
+ "title": "Pacynka kontra Faceopera. Zjawisko kont alternatywnych w mediach społecznościowych"
404
+ },
405
+ {
406
+ "doi": [],
407
+ "exact_title_or_doi_matches": [],
408
+ "fuzzy_title_matches": [],
409
+ "item_id": "85a251c7-d59f-4de2-9ba7-d7e68ed396bf",
410
+ "title": "Temat śmierci w twórczości teatralnej i literackiej dla dzieci w początkach XXI wieku"
411
+ },
412
+ {
413
+ "doi": [],
414
+ "exact_title_or_doi_matches": [],
415
+ "fuzzy_title_matches": [],
416
+ "item_id": "8a1cca15-e1b9-4d23-b67c-6f48f649c616",
417
+ "title": "Wykaz publikacji w języku polskim poświęconych zarządzaniu i organizacji bibliotek (w wyborze)"
418
+ },
419
+ {
420
+ "doi": [
421
+ "10.26348/znwwsi.30.27"
422
+ ],
423
+ "exact_title_or_doi_matches": [],
424
+ "fuzzy_title_matches": [],
425
+ "item_id": "8c8e1344-c7b4-4247-962a-8fcd7c635f14",
426
+ "title": "Nauka programowania z ChatGPT: skrót do sukcesu czy droga na manowce?"
427
+ },
428
+ {
429
+ "doi": [
430
+ "10.61905/wwr/176527"
431
+ ],
432
+ "exact_title_or_doi_matches": [],
433
+ "fuzzy_title_matches": [],
434
+ "item_id": "8d289c40-5a70-4d24-8a4f-9c0453065268",
435
+ "title": "Komponenty resilience rodzin z defaworyzowanych sąsiedztw w obiektywie badań longitudinalnych"
436
+ },
437
+ {
438
+ "doi": [],
439
+ "exact_title_or_doi_matches": [],
440
+ "fuzzy_title_matches": [],
441
+ "item_id": "8da1dee3-e9be-437b-8916-e9a8d3ac92b2",
442
+ "title": "Uzasadnienia konieczności postępowania zgodnie z zasadami moralnymi w działaniach marketingowych"
443
+ },
444
+ {
445
+ "doi": [],
446
+ "exact_title_or_doi_matches": [
447
+ {
448
+ "attribution": "Robert T. Tomczak | 2015 | Wychowanie i wykształcenie króla Michała Korybuta Wiśniowieckiego (1640–1660)",
449
+ "id": "biblioteka_nauki_articles_631708"
450
+ },
451
+ {
452
+ "attribution": "Ilona Czamańska | 2015 | Suplement do suplementu. Odpowiedź na recenzję Zbigniewa Anusika recenzję książki Wiśniowieccy. Monografia rodu",
453
+ "id": "biblioteka_nauki_articles_632035"
454
+ },
455
+ {
456
+ "attribution": "Robert T. Tomczak | 2015 | Wychowanie i wykształcenie króla Michała Korybuta Wiśniowieckiego (1640–1660)",
457
+ "id": "biblioteka_nauki_articles_632236"
458
+ },
459
+ {
460
+ "attribution": "Ilona Czamańska | 2015 | Suplement do suplementu. Odpowiedź na recenzję Zbigniewa Anusika recenzję książki Wiśniowieccy. Monografia rodu",
461
+ "id": "biblioteka_nauki_articles_632241"
462
+ },
463
+ {
464
+ "attribution": "Anna Penkała-Jastrzębska | 2021 | Janusz Antoni Wiśniowiecki, Ilias Polski, wyd. Przemysław P. Romaniuk, Jacek Burdowicz- -Nowicki, (Warszawa: Wydawnictwo Neriton, 2018), ISBN 978-83-660118-01-3",
465
+ "id": "biblioteka_nauki_articles_1834618"
466
+ }
467
+ ],
468
+ "fuzzy_title_matches": [],
469
+ "item_id": "91a67fe4-4510-44dd-9a55-75bfb5f79392",
470
+ "title": "Wiśniowiec"
471
+ },
472
+ {
473
+ "doi": [],
474
+ "exact_title_or_doi_matches": [],
475
+ "fuzzy_title_matches": [],
476
+ "item_id": "92596827-a7ac-4757-839a-cb6d5671ab67",
477
+ "title": "Polityka handlowa Unii Europejskiej na podstawie implementacji założeń ruchu Sprawiedliwego handlu"
478
+ },
479
+ {
480
+ "doi": [],
481
+ "exact_title_or_doi_matches": [],
482
+ "fuzzy_title_matches": [],
483
+ "item_id": "93db5006-5cd3-4829-bc88-9b89650c5f1a",
484
+ "title": "Embrion ludzki - pytanie o status"
485
+ },
486
+ {
487
+ "doi": [],
488
+ "exact_title_or_doi_matches": [],
489
+ "fuzzy_title_matches": [],
490
+ "item_id": "95f04437-6495-4fb9-80c7-83a6bec4b6fe",
491
+ "title": "Postawy prokreacyjne młodych Polaków"
492
+ },
493
+ {
494
+ "doi": [],
495
+ "exact_title_or_doi_matches": [],
496
+ "fuzzy_title_matches": [],
497
+ "item_id": "9787af4b-b748-4921-9dd1-a5a7213bd6c9",
498
+ "title": "Wspólnota Izraela domem Boga w Starym Testamencie"
499
+ },
500
+ {
501
+ "doi": [],
502
+ "exact_title_or_doi_matches": [],
503
+ "fuzzy_title_matches": [],
504
+ "item_id": "99759031-988b-49d3-95f0-2f063d41102e",
505
+ "title": "Podstawowe zadanie filozofii w kulturze"
506
+ },
507
+ {
508
+ "doi": [],
509
+ "exact_title_or_doi_matches": [],
510
+ "fuzzy_title_matches": [],
511
+ "item_id": "9bca9fcc-6780-4f36-b684-0c87cf04dbee",
512
+ "title": "Kalila i Dimna. Edycje i rękopisy dzieła (Opowieść o sowach i krukach)"
513
+ },
514
+ {
515
+ "doi": [
516
+ "10.11649/sfps.2017.004"
517
+ ],
518
+ "exact_title_or_doi_matches": [
519
+ {
520
+ "attribution": "Radosław Kaleta | 2017 | O potrzebie ujednolicenia sposobów transliteracji imion i nazwisk białoruskich w Polsce",
521
+ "id": "biblioteka_nauki_articles_678651"
522
+ }
523
+ ],
524
+ "fuzzy_title_matches": [],
525
+ "item_id": "9c3e3246-4dc7-4d48-b541-aaf800d18aa7",
526
+ "title": "O potrzebie ujednolicenia sposobów transliteracji imion i nazwisk białoruskich w Polsce"
527
+ },
528
+ {
529
+ "doi": [],
530
+ "exact_title_or_doi_matches": [],
531
+ "fuzzy_title_matches": [],
532
+ "item_id": "9c64aa62-1714-48ed-84d4-6533d3fa1ef0",
533
+ "title": "Turystyka zrównoważona - przegląd literatury i charakterystyka"
534
+ },
535
+ {
536
+ "doi": [
537
+ "10.6084/m9.figshare.1335808"
538
+ ],
539
+ "exact_title_or_doi_matches": [],
540
+ "fuzzy_title_matches": [],
541
+ "item_id": "a00da632-20b2-433d-9da3-4e56e807a01b",
542
+ "title": "Hentai – erotyka z mangi i anime"
543
+ },
544
+ {
545
+ "doi": [],
546
+ "exact_title_or_doi_matches": [
547
+ {
548
+ "attribution": "Maciej Szeląg | 2017 | Wpływ składu kompozytów cementowych na geometrię ich spękań termicznych | Politechnika Lubelska. Instytut Informatyki",
549
+ "id": "biblioteka_nauki_books_2028483"
550
+ }
551
+ ],
552
+ "fuzzy_title_matches": [],
553
+ "item_id": "a0221582-b4ab-4a7f-9c7a-80a4b71eb625",
554
+ "title": "Wpływ składu kompozytów cementowych na geometrię ich spękań termicznych"
555
+ },
556
+ {
557
+ "doi": [],
558
+ "exact_title_or_doi_matches": [],
559
+ "fuzzy_title_matches": [],
560
+ "item_id": "a06303dc-010c-4e93-8784-f733781fdb6e",
561
+ "title": "Miasta restytuowane w obliczu przemian demograficznych w XXI wieku"
562
+ },
563
+ {
564
+ "doi": [],
565
+ "exact_title_or_doi_matches": [],
566
+ "fuzzy_title_matches": [],
567
+ "item_id": "a874709f-88e5-435d-9135-c4f538d26813",
568
+ "title": "Człowiek pogryzł psa. Uwagi o „wolności twórczej” jako konsekwencji Kantowskiej figury geniusza"
569
+ },
570
+ {
571
+ "doi": [],
572
+ "exact_title_or_doi_matches": [],
573
+ "fuzzy_title_matches": [],
574
+ "item_id": "a89ebb40-9207-42a5-b0b9-3d6a7d05761c",
575
+ "title": "Atlas Wyszehradzki, P. Śleszyński, K. Czapiewski (red.), Instytut Współpracy Polsko-Węgierskiej im. Wacława Felczaka, Polskie Towarzystwo Geograficzne, Warszawa, 2021, 303 ss."
576
+ },
577
+ {
578
+ "doi": [
579
+ "10.24131/3724.24ns06"
580
+ ],
581
+ "exact_title_or_doi_matches": [],
582
+ "fuzzy_title_matches": [],
583
+ "item_id": "a95ccc2b-4156-45c7-9a4d-ec154b9c1c2b",
584
+ "title": "Retoryka w szkole wobec edukacji klasycznej"
585
+ },
586
+ {
587
+ "doi": [],
588
+ "exact_title_or_doi_matches": [],
589
+ "fuzzy_title_matches": [],
590
+ "item_id": "aaec30a0-28cf-4d11-b913-d2d969f15660",
591
+ "title": "Kształtowanie strategii przedsiebiorstwa rodzinnego w korelacji do oczekiwań interesariuszy wewnetrznych i zewnetrznych"
592
+ },
593
+ {
594
+ "doi": [],
595
+ "exact_title_or_doi_matches": [],
596
+ "fuzzy_title_matches": [],
597
+ "item_id": "acd678a4-5a30-4e7d-a142-7a0458f7c509",
598
+ "title": "Duchowość i religijność a wybór zawodu przez młodych ludzi"
599
+ },
600
+ {
601
+ "doi": [],
602
+ "exact_title_or_doi_matches": [],
603
+ "fuzzy_title_matches": [],
604
+ "item_id": "ad7ccc8e-1623-4bef-84ab-58e8b3984beb",
605
+ "title": "Dziedzictwo kulturalne i jego ochrona w kontekście infrastruktury krytycznej"
606
+ },
607
+ {
608
+ "doi": [],
609
+ "exact_title_or_doi_matches": [],
610
+ "fuzzy_title_matches": [],
611
+ "item_id": "ade27972-dc75-4646-88c8-34d39186efda",
612
+ "title": "Nie tylko praca socjalna: komunikacyjne aspekty funkcjonowania instytucji pomocy społecznej w przestrzeni publicznej; pomiędzy stereotypami i barierami a public relations i aktywną promocją"
613
+ },
614
+ {
615
+ "doi": [],
616
+ "exact_title_or_doi_matches": [],
617
+ "fuzzy_title_matches": [],
618
+ "item_id": "af211736-e429-466e-8722-ab11ee0438da",
619
+ "title": "Powoływanie, struktura i zadania Parafialnej Rady do spraw Ekonomicznych"
620
+ },
621
+ {
622
+ "doi": [],
623
+ "exact_title_or_doi_matches": [],
624
+ "fuzzy_title_matches": [],
625
+ "item_id": "b013047b-1b9a-4a3c-8540-a5a91972bd3b",
626
+ "title": "Sztuka w przestrzeni publicznej. Artystyczne wymiary wytwarzania kapitału społecznego i kulturowego"
627
+ },
628
+ {
629
+ "doi": [],
630
+ "exact_title_or_doi_matches": [],
631
+ "fuzzy_title_matches": [],
632
+ "item_id": "b264af0a-92b3-4251-ae3a-5e8a31a739ea",
633
+ "title": "Walka byków oczami Sienkiewicza"
634
+ },
635
+ {
636
+ "doi": [],
637
+ "exact_title_or_doi_matches": [],
638
+ "fuzzy_title_matches": [],
639
+ "item_id": "bb7441c2-1107-4d52-865d-72f2201c3988",
640
+ "title": "Aktywizacja seniorów w procesie poradnictwa"
641
+ },
642
+ {
643
+ "doi": [],
644
+ "exact_title_or_doi_matches": [],
645
+ "fuzzy_title_matches": [],
646
+ "item_id": "bd474ffb-e622-49eb-a1c0-06c86d849884",
647
+ "title": "Naród wobec rewolucji"
648
+ },
649
+ {
650
+ "doi": [],
651
+ "exact_title_or_doi_matches": [],
652
+ "fuzzy_title_matches": [],
653
+ "item_id": "bd595f0f-4fcf-49cc-81a8-a4a0d967233c",
654
+ "title": "Szanse patriotyzmu w „globalnej wiosce”"
655
+ },
656
+ {
657
+ "doi": [],
658
+ "exact_title_or_doi_matches": [],
659
+ "fuzzy_title_matches": [],
660
+ "item_id": "bdb254e8-ab6d-466e-b1de-7c52157a9c35",
661
+ "title": "Rola kwasów tłuszczowych w żywieniu i zdrowiu człowieka"
662
+ },
663
+ {
664
+ "doi": [],
665
+ "exact_title_or_doi_matches": [],
666
+ "fuzzy_title_matches": [],
667
+ "item_id": "c47bc2d8-0214-4715-87e2-720492ee3da6",
668
+ "title": "Masaż Shantala – charakterystyka i sposób wykonania"
669
+ },
670
+ {
671
+ "doi": [],
672
+ "exact_title_or_doi_matches": [],
673
+ "fuzzy_title_matches": [],
674
+ "item_id": "c6fbda2c-6329-46d5-b7bb-d87277e3a108",
675
+ "title": "Retoryka rzeczy a proces zadomowienia w przestrzeniach pojałtańskiego okcydentu"
676
+ },
677
+ {
678
+ "doi": [],
679
+ "exact_title_or_doi_matches": [],
680
+ "fuzzy_title_matches": [],
681
+ "item_id": "c9f8df0c-d745-469c-a73d-574d875216fc",
682
+ "title": "Procesy logistyczne portowego terminalu kontenerowego"
683
+ },
684
+ {
685
+ "doi": [],
686
+ "exact_title_or_doi_matches": [],
687
+ "fuzzy_title_matches": [],
688
+ "item_id": "cafebfde-e64a-4504-a76e-f388b552138d",
689
+ "title": "Projektowanie technologiczne oraz dobór deskowań stosowanych w budownictwie inżynieryjnym na przykładzie budownictwa mostowego"
690
+ },
691
+ {
692
+ "doi": [],
693
+ "exact_title_or_doi_matches": [],
694
+ "fuzzy_title_matches": [],
695
+ "item_id": "cc630b22-1ef1-4cb2-8e9a-ec5e12dd2d3e",
696
+ "title": "Dlaczego uchodźcy „nie chcą” integrować się w Polsce? Ocena skuteczności programów integracyjnych z punktu widzenia uchodźców"
697
+ },
698
+ {
699
+ "doi": [],
700
+ "exact_title_or_doi_matches": [],
701
+ "fuzzy_title_matches": [],
702
+ "item_id": "d00d2c6c-d2c5-4735-bd56-1448427ca86c",
703
+ "title": "Ocena potencjału przedsiębiorczości i atrakcyjności gospodarczej obszarów wiejskich województwa świętokrzyskiego"
704
+ },
705
+ {
706
+ "doi": [],
707
+ "exact_title_or_doi_matches": [],
708
+ "fuzzy_title_matches": [],
709
+ "item_id": "d9e454b5-1fb8-4aaf-9b14-76162ecd37e6",
710
+ "title": "Przemoc instytucjonalna w Jednostkach Organizacyjnych Pomocy Społecznej"
711
+ },
712
+ {
713
+ "doi": [],
714
+ "exact_title_or_doi_matches": [],
715
+ "fuzzy_title_matches": [],
716
+ "item_id": "de08c2f1-518b-4114-b7d3-b6c357e28852",
717
+ "title": "Kobieta w roli matki. Propozycje Anastazji z Jełowickich Dzieduszyckiej (1842–1890)"
718
+ },
719
+ {
720
+ "doi": [
721
+ "10.12657/czageo-94-30"
722
+ ],
723
+ "exact_title_or_doi_matches": [],
724
+ "fuzzy_title_matches": [],
725
+ "item_id": "e21f9705-9966-4828-8605-42a54e591aa9",
726
+ "title": "Blockchain i kryptowaluty – „nowa” odsłona w geograficznym podejściu do badania Internetu"
727
+ },
728
+ {
729
+ "doi": [
730
+ "10.61905/wwr/192723"
731
+ ],
732
+ "exact_title_or_doi_matches": [],
733
+ "fuzzy_title_matches": [],
734
+ "item_id": "e346c430-9e67-4fae-97fa-463433a508c5",
735
+ "title": "Prawne i etyczne aspekty opieki nad niesamodzielnymi rodzicami"
736
+ },
737
+ {
738
+ "doi": [],
739
+ "exact_title_or_doi_matches": [],
740
+ "fuzzy_title_matches": [],
741
+ "item_id": "e38b08ae-4054-4a16-bacc-c5501579799a",
742
+ "title": "Systemy produkcyjne nowej generacji. Modele interdyscyplinarne"
743
+ },
744
+ {
745
+ "doi": [],
746
+ "exact_title_or_doi_matches": [],
747
+ "fuzzy_title_matches": [],
748
+ "item_id": "e3a11a86-7260-4b61-a043-56e418b05b7b",
749
+ "title": "Badanie efektywności ataków socjotechnicznych w jednostkach samorządu terytorialnego"
750
+ },
751
+ {
752
+ "doi": [],
753
+ "exact_title_or_doi_matches": [],
754
+ "fuzzy_title_matches": [],
755
+ "item_id": "ebd3c5a6-e7ac-4ac9-80f6-57cc9c6eea2e",
756
+ "title": "Wizualna konsumpcja a komunikacja wizualna. Perswazyjność obrazu w ramach współczesnej komunikacji marketingowej"
757
+ },
758
+ {
759
+ "doi": [],
760
+ "exact_title_or_doi_matches": [],
761
+ "fuzzy_title_matches": [],
762
+ "item_id": "ec993a0f-e213-49e2-8bf5-8aaa4009688b",
763
+ "title": "Imitacja w tworzeniu polskiej polityki integracji cudzoziemców"
764
+ },
765
+ {
766
+ "doi": [
767
+ "10.23734/wwr20172.075.088"
768
+ ],
769
+ "exact_title_or_doi_matches": [
770
+ {
771
+ "attribution": "Danuta Kowalczyk | 2017 | Pedagogiczny wymiar sądowego rozstrzygania konfliktów rodzinnych",
772
+ "id": "biblioteka_nauki_articles_2105383"
773
+ }
774
+ ],
775
+ "fuzzy_title_matches": [],
776
+ "item_id": "ecbbe7bc-f0e8-465e-ab0b-f6cecd48980c",
777
+ "title": "Pedagogiczny wymiar sądowego rozstrzygania konfliktów rodzinnych"
778
+ },
779
+ {
780
+ "doi": [
781
+ "10.34616/wwr.2019.2.357.372"
782
+ ],
783
+ "exact_title_or_doi_matches": [
784
+ {
785
+ "attribution": "Dorota Rybczyńska Abdel-Kawy; Łukasz Rybczyński | 2019 | Podstawowe cechy osobowości a kompetencje społeczne uczestników programu terapii substytucyjnej i ich rola w procesie zmian",
786
+ "id": "biblioteka_nauki_articles_2127349"
787
+ }
788
+ ],
789
+ "fuzzy_title_matches": [],
790
+ "item_id": "f8cc967a-0de5-41a4-9184-d10dcbc88e28",
791
+ "title": "Podstawowe cechy osobowości a kompetencje społeczne uczestników programu terapii substytucyjnej i ich rola w procesie zmian"
792
+ },
793
+ {
794
+ "doi": [],
795
+ "exact_title_or_doi_matches": [],
796
+ "fuzzy_title_matches": [],
797
+ "item_id": "fc0390e6-5fdb-4857-bcd9-225bdf41bd47",
798
+ "title": "Pseudo-Ksenofont"
799
+ },
800
+ {
801
+ "doi": [
802
+ "10.34616/wwr20182.053.068"
803
+ ],
804
+ "exact_title_or_doi_matches": [
805
+ {
806
+ "attribution": "Aneta Bołdyrew | 2018 | Przemoc fizyczna i seksualna wobec dzieci w środowisku rodzinnym jako problem społeczno-pedagogiczny w publicystyce Królestwa Polskiego na przełomie XIX i XX wieku",
807
+ "id": "biblioteka_nauki_articles_2123449"
808
+ }
809
+ ],
810
+ "fuzzy_title_matches": [],
811
+ "item_id": "fcb6b503-49bb-4e2d-b997-19d22904c6cd",
812
+ "title": "Przemoc fizyczna i seksualna wobec dzieci w środowisku rodzinnym jako problem społeczno-pedagogiczny w publicystyce Królestwa Polskiego na przełomie XIX i XX wieku"
813
+ }
814
+ ],
815
+ "target": "SlayerLab/polish-dynaword:data/biblioteka_nauki",
816
+ "target_revision": "863b8fa854fc9741e4791f1ad90ecaf6f2c0e29a",
817
+ "target_rows": 42071,
818
+ "text_overlap": "not tested; target-wide text dedup remains an integration gate"
819
+ }
data/open_icm_pl/open_icm_pl.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11deaba8bd43159bc7d07fc022f84e1555809cb04f5f5ce4e0f3bde953dd5c31
3
+ size 2584960
data/open_icm_pl/open_icm_pl.qa.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "benchmark_overlap": "pending",
3
+ "cross_source_text_dedup": "pending target integration",
4
+ "fuzzy_title_matches": 0,
5
+ "known_target_title_or_doi_overlap_excluded": 10,
6
+ "limitations": [
7
+ "repository-generated TEXT may inherit PDF extraction errors",
8
+ "figures are omitted and tables may be flattened",
9
+ "item-level license metadata does not prove every quoted third-party passage is reusable",
10
+ "pattern checks are not comprehensive de-identification",
11
+ "pilot yield and token counts must not be extrapolated to all 6183 eligible records"
12
+ ],
13
+ "scope": "DynaWord proposal derived from the deterministic OPEN ICM 100-record pilot",
14
+ "source_text_qa_rejected": 5,
15
+ "within_source_exact_and_near_dedup": true
16
+ }
data/open_icm_pl/open_icm_pl.sample.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/open_icm_pl/open_icm_pl.stats.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added": "2026-09-10",
3
+ "author_coverage": 1.0,
4
+ "characters": 6219019,
5
+ "kept": 85,
6
+ "license_counts": {
7
+ "CC-BY-3.0-PL": 32,
8
+ "CC-BY-4.0": 7,
9
+ "CC-BY-SA-3.0": 1,
10
+ "CC-BY-SA-3.0-PL": 38,
11
+ "CC-BY-SA-4.0": 7
12
+ },
13
+ "sample_count": 12,
14
+ "source_pilot_acquired": 100,
15
+ "source_pilot_kept": 95,
16
+ "target_overlap_excluded": 10,
17
+ "target_revision": "fe44303ea2db290c7a195264226477f724973357",
18
+ "tokens": 2358174
19
+ }
src/fetch_open_icm_pl.py ADDED
@@ -0,0 +1,909 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build an auditable pilot of permissively licensed Polish OPEN ICM texts."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ from collections import Counter
7
+ from concurrent.futures import ThreadPoolExecutor, as_completed
8
+ from datetime import datetime, timezone
9
+ from difflib import SequenceMatcher, get_close_matches
10
+ import gzip
11
+ import hashlib
12
+ import json
13
+ import os
14
+ from pathlib import Path
15
+ import re
16
+ import time
17
+ import unicodedata
18
+
19
+ import requests
20
+
21
+
22
+ SOURCE = "open_icm_pl"
23
+ OWN_REPO = "PiotrSty/open-icm-pl-publications"
24
+ TARGET = "SlayerLab/polish-dynaword"
25
+ API = "https://open.icm.edu.pl/server/api"
26
+ SOURCE_URL = "https://open.icm.edu.pl/home"
27
+ FIELDS = ["id", "text", "source", "added", "created", "token_count", "license", "author"]
28
+ UA = "OpenICMPolishCorpusResearch/0.1 (PiotrSty; open research pilot)"
29
+ MAX_TEXT_BYTES = 20 * 1024 * 1024
30
+ MIN_TEXT_CHARS = 3_000
31
+ POOL_MULTIPLIER = 2
32
+ EMAIL_RE = re.compile(r"(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b")
33
+ PHONE_RE = re.compile(r"(?i)(?:\btelefon|\btel\.|\bphone)\s*:?[ \t]*(?:\+48[ \t]*)?\d(?:[ .-]?\d){8}\b")
34
+
35
+ LICENSES = {
36
+ "Uznanie autorstwa-Na tych samych warunkach 3.0 Polska": "CC-BY-SA-3.0-PL",
37
+ "Uznanie autorstwa 3.0 Polska": "CC-BY-3.0-PL",
38
+ "Uznanie autorstwa 4.0 Międzynarodowe": "CC-BY-4.0",
39
+ "Uznanie autorstwa-Na tych samych warunkach 4.0 Międzynarodowe": "CC-BY-SA-4.0",
40
+ "Uznanie autorstwa 3.0 Unported": "CC-BY-3.0",
41
+ "Uznanie autorstwa-Na tych samych warunkach 3.0 Unported": "CC-BY-SA-3.0",
42
+ "Uznanie autorstwa 2.0 Polska": "CC-BY-2.0-PL",
43
+ "Uznanie autorstwa-Na tych samych warunkach 3.0": "CC-BY-SA-3.0",
44
+ }
45
+
46
+
47
+ class AcquisitionBarrier(RuntimeError):
48
+ """Raised when OPEN ICM returns an interactive download barrier."""
49
+
50
+
51
+ def now():
52
+ return datetime.now(timezone.utc).isoformat()
53
+
54
+
55
+ def digest(value):
56
+ if not isinstance(value, bytes):
57
+ value = json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode("utf-8")
58
+ return hashlib.sha256(value).hexdigest()
59
+
60
+
61
+ def save(path, value):
62
+ path.parent.mkdir(parents=True, exist_ok=True)
63
+ path.write_text(json.dumps(value, ensure_ascii=False, sort_keys=True, indent=2) + "\n", encoding="utf-8")
64
+
65
+
66
+ def write_lines(path, rows):
67
+ path.parent.mkdir(parents=True, exist_ok=True)
68
+ path.write_text("".join(json.dumps(row, ensure_ascii=False, sort_keys=True) + "\n" for row in rows), encoding="utf-8")
69
+
70
+
71
+ def read_lines(path):
72
+ # JSONL records may contain Unicode line-separator characters inside strings.
73
+ return [json.loads(line) for line in path.read_text(encoding="utf-8").split("\n") if line]
74
+
75
+
76
+ def load(path):
77
+ return json.loads(path.read_text(encoding="utf-8"))
78
+
79
+
80
+ def values(metadata, key):
81
+ return [str(item.get("value", "")).strip() for item in metadata.get(key, []) if str(item.get("value", "")).strip()]
82
+
83
+
84
+ def request(url, params=None, attempts=5, timeout=(15, 60)):
85
+ response = None
86
+ for attempt in range(attempts):
87
+ response = requests.get(url, params=params, headers={"User-Agent": UA}, timeout=timeout)
88
+ if response.status_code not in (429, 500, 502, 503, 504):
89
+ response.raise_for_status()
90
+ return response
91
+ time.sleep(2 ** attempt)
92
+ response.raise_for_status()
93
+
94
+
95
+ def request_json(url, params=None):
96
+ return request(url, params=params).json()
97
+
98
+
99
+ def embedded(payload, name):
100
+ return payload.get("_embedded", {}).get(name, [])
101
+
102
+
103
+ def item_objects(payload):
104
+ result = payload.get("_embedded", {}).get("searchResult", {})
105
+ objects = result.get("_embedded", {}).get("objects", [])
106
+ return [row.get("_embedded", {}).get("indexableObject", {}) for row in objects]
107
+
108
+
109
+ def compact_item(item):
110
+ metadata = item.get("metadata", {})
111
+ keys = [
112
+ "dc.contributor.author", "dc.contributor.editor", "dc.date.issued", "dc.description.abstract",
113
+ "dc.identifier.doi", "dc.identifier.uri", "dc.language.iso", "dc.publisher", "dc.rights",
114
+ "dc.subject", "dc.title", "dc.type",
115
+ ]
116
+ return {
117
+ "item_id": item.get("uuid") or item.get("id"),
118
+ "title": item.get("name", ""),
119
+ "handle": item.get("handle"),
120
+ "last_modified": item.get("lastModified"),
121
+ "metadata": {key: metadata.get(key, []) for key in keys if metadata.get(key)},
122
+ }
123
+
124
+
125
+ def is_polish_open_item(item):
126
+ metadata = item.get("metadata", {})
127
+ languages = {value.casefold() for value in values(metadata, "dc.language.iso")}
128
+ rights = set(values(metadata, "dc.rights"))
129
+ return any(language == "pl" or language.startswith("pl_") for language in languages) and bool(rights & LICENSES.keys())
130
+
131
+
132
+ def deterministic_pool(items, target):
133
+ unique = {}
134
+ for item in items:
135
+ item_id = item["item_id"]
136
+ if item_id not in unique:
137
+ unique[item_id] = item
138
+ else:
139
+ old_rights = set(values(unique[item_id]["metadata"], "dc.rights"))
140
+ new_rights = set(values(item["metadata"], "dc.rights"))
141
+ unique[item_id]["metadata"]["dc.rights"] = [{"value": value} for value in sorted(old_rights | new_rights)]
142
+ ordered = sorted(unique.values(), key=lambda item: digest(("open-icm-pilot:" + item["item_id"]).encode("utf-8")))
143
+ chosen = []
144
+ for license_label in LICENSES:
145
+ match = next((item for item in ordered if license_label in values(item["metadata"], "dc.rights")), None)
146
+ if match and match["item_id"] not in {row["item_id"] for row in chosen}:
147
+ chosen.append(match)
148
+ wanted = min(len(ordered), target * POOL_MULTIPLIER)
149
+ chosen_ids = {row["item_id"] for row in chosen}
150
+ chosen.extend(item for item in ordered if item["item_id"] not in chosen_ids and len(chosen) < wanted)
151
+ return chosen[:wanted]
152
+
153
+
154
+ def discover(out, target):
155
+ if (out / "source_manifest.jsonl").exists():
156
+ raise ValueError("source manifest exists; use a fresh directory for an immutable discovery run")
157
+ out.mkdir(parents=True, exist_ok=True)
158
+ raw_pages = out / "raw_api"
159
+ all_items, pages, counts = [], [], {}
160
+ for license_index, license_label in enumerate(LICENSES):
161
+ page = 0
162
+ while True:
163
+ params = [
164
+ ("size", 100), ("page", page), ("sort", "dc.date.issued,DESC"),
165
+ ("query", "dc.language.iso:pl"), ("f.license", f"{license_label},equals"),
166
+ ]
167
+ response = request(f"{API}/discover/search/objects", params=params)
168
+ raw = response.content
169
+ payload = response.json()
170
+ result = payload.get("_embedded", {}).get("searchResult", {})
171
+ page_info = result.get("page", {})
172
+ items = [compact_item(item) for item in item_objects(payload) if is_polish_open_item(item)]
173
+ compressed_path = raw_pages / f"license-{license_index:02d}" / f"page-{page:04d}.json.gz"
174
+ compressed_path.parent.mkdir(parents=True, exist_ok=True)
175
+ compressed_path.write_bytes(gzip.compress(raw, mtime=0))
176
+ pages.append({
177
+ "license": license_label, "page": page, "response_sha256": digest(raw),
178
+ "compressed_path": compressed_path.relative_to(out).as_posix(), "items": len(items),
179
+ "reported_total": int(page_info.get("totalElements", 0)),
180
+ })
181
+ all_items.extend(items)
182
+ counts[license_label] = int(page_info.get("totalElements", 0))
183
+ if page + 1 >= int(page_info.get("totalPages", 0)):
184
+ break
185
+ page += 1
186
+ unique = {item["item_id"]: item for item in all_items}
187
+ manifest = sorted(unique.values(), key=lambda item: item["item_id"])
188
+ pool = deterministic_pool(manifest, target)
189
+ write_lines(out / "source_manifest.jsonl", manifest)
190
+ write_lines(out / "selection_pool.jsonl", pool)
191
+ save(out / "api_pages.json", pages)
192
+ selection = {
193
+ "source": SOURCE, "source_url": SOURCE_URL, "observed_at": now(), "target": target,
194
+ "pool_size": len(pool), "eligible_records": len(manifest), "reported_counts_by_license": counts,
195
+ "accepted_licenses": LICENSES, "language_query": "dc.language.iso:pl",
196
+ "selection_method": "one deterministic representative per license, then lowest SHA-256 ranks",
197
+ "source_manifest_sha256": digest((out / "source_manifest.jsonl").read_bytes()),
198
+ "api_pages_sha256": digest(pages),
199
+ }
200
+ save(out / "selection.json", selection)
201
+ print(json.dumps({"eligible": len(manifest), "pool": len(pool), "target": target, "counts": counts}, ensure_ascii=False, indent=2))
202
+
203
+
204
+ def bundle_map(item_id):
205
+ payload = request_json(f"{API}/core/items/{item_id}/bundles", {"size": 20})
206
+ return {bundle.get("name"): bundle for bundle in embedded(payload, "bundles")}
207
+
208
+
209
+ def bundle_bitstreams(bundle):
210
+ if not bundle:
211
+ return []
212
+ return embedded(request_json(f"{API}/core/bundles/{bundle['uuid']}/bitstreams", {"size": 100}), "bitstreams")
213
+
214
+
215
+ def bitstream_summary(bitstream):
216
+ return {
217
+ "id": bitstream.get("uuid") or bitstream.get("id"), "name": bitstream.get("name"),
218
+ "bytes": int(bitstream.get("sizeBytes", 0)), "checksum": bitstream.get("checkSum"),
219
+ "content_url": bitstream.get("_links", {}).get("content", {}).get("href"),
220
+ "metadata_rights": values(bitstream.get("metadata", {}), "dc.rights"),
221
+ }
222
+
223
+
224
+ def choose_text(bitstreams):
225
+ candidates = [item for item in bitstreams if item.get("_links", {}).get("content", {}).get("href")]
226
+ if not candidates:
227
+ raise ValueError("missing downloadable TEXT bitstream")
228
+ return max(candidates, key=lambda item: (int(item.get("sizeBytes", 0)), item.get("name", "")))
229
+
230
+
231
+ def verify_checksum(payload, metadata):
232
+ checksum = metadata.get("checkSum") or {}
233
+ algorithm = str(checksum.get("checkSumAlgorithm", "")).upper()
234
+ expected = checksum.get("value")
235
+ if algorithm == "MD5" and expected and hashlib.md5(payload).hexdigest() != expected:
236
+ raise ValueError("downloaded bitstream MD5 differs from repository metadata")
237
+
238
+
239
+ def detect_download_barrier(response):
240
+ final_url = str(getattr(response, "url", ""))
241
+ content_type = str(getattr(response, "headers", {}).get("Content-Type", "")).casefold()
242
+ prefix = bytes(getattr(response, "content", b""))[:512].lower()
243
+ if "/captcha.html" in final_url or ("text/html" in content_type and b"<html" in prefix):
244
+ raise AcquisitionBarrier(
245
+ "OPEN ICM returned an interactive CAPTCHA page instead of the bitstream; "
246
+ "request an official bulk-download route before acquisition"
247
+ )
248
+
249
+
250
+ def probe_download_access(item):
251
+ bundles = bundle_map(item["item_id"])
252
+ text_stream = choose_text(bundle_bitstreams(bundles.get("TEXT")))
253
+ response = request(text_stream["_links"]["content"]["href"], timeout=(15, 120))
254
+ detect_download_barrier(response)
255
+
256
+
257
+ def text_stream_metadata(item):
258
+ bundles = bundle_map(item["item_id"])
259
+ return {
260
+ "text_stream": choose_text(bundle_bitstreams(bundles.get("TEXT"))),
261
+ "license_streams": bundle_bitstreams(bundles.get("LICENSE")),
262
+ "original_streams": bundle_bitstreams(bundles.get("ORIGINAL")),
263
+ }
264
+
265
+
266
+ def acquire_one(out, item):
267
+ item_id = item["item_id"]
268
+ streams = text_stream_metadata(item)
269
+ text_stream = streams["text_stream"]
270
+ licenses = streams["license_streams"]
271
+ originals = streams["original_streams"]
272
+ text_bytes = int(text_stream.get("sizeBytes", 0))
273
+ if text_bytes <= 0 or text_bytes > MAX_TEXT_BYTES:
274
+ raise ValueError(f"TEXT bitstream outside 1..{MAX_TEXT_BYTES} byte pilot bound")
275
+ response = request(text_stream["_links"]["content"]["href"], timeout=(15, 120))
276
+ detect_download_barrier(response)
277
+ payload = response.content
278
+ if len(payload) != text_bytes:
279
+ raise ValueError("downloaded TEXT byte count differs from repository metadata")
280
+ verify_checksum(payload, text_stream)
281
+ raw_path = out / "raw_text" / f"{item_id}.txt"
282
+ raw_path.parent.mkdir(parents=True, exist_ok=True)
283
+ raw_path.write_bytes(payload)
284
+ license_evidence = []
285
+ for index, stream in enumerate(licenses):
286
+ content_url = stream.get("_links", {}).get("content", {}).get("href")
287
+ if not content_url or int(stream.get("sizeBytes", 0)) > 1_000_000:
288
+ continue
289
+ license_payload = request(content_url).content
290
+ verify_checksum(license_payload, stream)
291
+ license_path = out / "license_evidence" / f"{item_id}-{index:02d}.txt"
292
+ license_path.parent.mkdir(parents=True, exist_ok=True)
293
+ license_path.write_bytes(license_payload)
294
+ license_evidence.append({**bitstream_summary(stream), "sha256": digest(license_payload),
295
+ "path": license_path.relative_to(out).as_posix()})
296
+ return {
297
+ **item, "landing_url": f"https://open.icm.edu.pl/items/{item_id}",
298
+ "accepted_license_labels": sorted(set(values(item["metadata"], "dc.rights")) & LICENSES.keys()),
299
+ "text_bitstream": {**bitstream_summary(text_stream), "sha256": digest(payload),
300
+ "path": raw_path.relative_to(out).as_posix()},
301
+ "license_evidence": license_evidence,
302
+ "original_bitstreams": [bitstream_summary(stream) for stream in originals],
303
+ "observed_at": now(),
304
+ }
305
+
306
+
307
+ def manual_acquisition(out):
308
+ path = out / "manual_acquisition.json"
309
+ if path.exists():
310
+ return load(path)
311
+ selection = load(out / "selection.json")
312
+ return {
313
+ "source": SOURCE, "observed_at": now(), "target": int(selection["target"]),
314
+ "pool_size": int(selection["pool_size"]), "mode": "manual_browser_download",
315
+ "selected": [], "rejected": [],
316
+ }
317
+
318
+
319
+ def sync_manual_acquisition(out, state):
320
+ state["observed_at"] = now()
321
+ state["attempted"] = len(state["selected"]) + len(state["rejected"])
322
+ state["target_reached"] = len(state["selected"]) >= int(state["target"])
323
+ state["manual_confirmation_required"] = not state["target_reached"]
324
+ save(out / "manual_acquisition.json", state)
325
+ save(out / "acquisition.json", state)
326
+
327
+
328
+ def prepare_manual(out):
329
+ pool = read_lines(out / "selection_pool.jsonl")
330
+ state = manual_acquisition(out)
331
+ completed = {record["item_id"] for record in state["selected"]}
332
+ completed.update(record["item_id"] for record in state["rejected"])
333
+ for item in pool:
334
+ if item["item_id"] in completed:
335
+ continue
336
+ try:
337
+ streams = text_stream_metadata(item)
338
+ text_stream = streams["text_stream"]
339
+ text_bytes = int(text_stream.get("sizeBytes", 0))
340
+ if text_bytes <= 0 or text_bytes > MAX_TEXT_BYTES:
341
+ raise ValueError(f"TEXT bitstream outside 1..{MAX_TEXT_BYTES} byte pilot bound")
342
+ if text_bytes < MIN_TEXT_CHARS:
343
+ raise ValueError(f"TEXT bitstream has {text_bytes} bytes and cannot pass the {MIN_TEXT_CHARS}-character QA gate")
344
+ except Exception as error:
345
+ state["rejected"].append({"item_id": item["item_id"], "title": item["title"],
346
+ "reason": str(error), "observed_at": now()})
347
+ sync_manual_acquisition(out, state)
348
+ continue
349
+ pending = {
350
+ "source": SOURCE, "prepared_at": now(), "item": item,
351
+ "landing_url": f"https://open.icm.edu.pl/items/{item['item_id']}",
352
+ "accepted_license_labels": sorted(set(values(item["metadata"], "dc.rights")) & LICENSES.keys()),
353
+ "text_bitstream": bitstream_summary(text_stream),
354
+ "license_evidence": [{**bitstream_summary(stream), "downloaded": False}
355
+ for stream in streams["license_streams"]],
356
+ "original_bitstreams": [bitstream_summary(stream) for stream in streams["original_streams"]],
357
+ "progress": {"acquired": len(state["selected"]), "target": state["target"]},
358
+ }
359
+ save(out / "manual_pending.json", pending)
360
+ print(json.dumps({
361
+ "item_id": item["item_id"], "title": item["title"],
362
+ "content_url": pending["text_bitstream"]["content_url"],
363
+ "bytes": pending["text_bitstream"]["bytes"],
364
+ "acquired": len(state["selected"]), "target": state["target"],
365
+ }, ensure_ascii=False, indent=2))
366
+ return
367
+ raise RuntimeError("manual acquisition pool exhausted")
368
+
369
+
370
+ def ingest_manual(out, download_file):
371
+ if not download_file:
372
+ raise ValueError("--download-file is required for ingest_manual")
373
+ pending = load(out / "manual_pending.json")
374
+ stream = pending["text_bitstream"]
375
+ payload = download_file.read_bytes()
376
+ prefix = payload[:512].lower()
377
+ if b"<html" in prefix or b"<!doctype html" in prefix:
378
+ raise AcquisitionBarrier("downloaded file is HTML rather than the declared TEXT bitstream")
379
+ if len(payload) != int(stream["bytes"]):
380
+ raise ValueError(f"downloaded file has {len(payload)} bytes; expected {stream['bytes']}")
381
+ checksum = stream.get("checksum") or {}
382
+ if str(checksum.get("checkSumAlgorithm", "")).upper() == "MD5":
383
+ actual_md5 = hashlib.md5(payload).hexdigest()
384
+ if actual_md5 != checksum.get("value"):
385
+ raise ValueError(f"downloaded file MD5 {actual_md5} differs from repository metadata")
386
+ state = manual_acquisition(out)
387
+ item = pending["item"]
388
+ if any(record["item_id"] == item["item_id"] for record in state["selected"]):
389
+ raise ValueError("pending item is already present in manual acquisition")
390
+ raw_path = out / "raw_text" / f"{item['item_id']}.txt"
391
+ raw_path.parent.mkdir(parents=True, exist_ok=True)
392
+ raw_path.write_bytes(payload)
393
+ record = {
394
+ **item, "landing_url": pending["landing_url"],
395
+ "accepted_license_labels": pending["accepted_license_labels"],
396
+ "text_bitstream": {**stream, "sha256": digest(payload),
397
+ "path": raw_path.relative_to(out).as_posix()},
398
+ "license_evidence": pending["license_evidence"],
399
+ "original_bitstreams": pending["original_bitstreams"],
400
+ "observed_at": now(), "acquisition_mode": "manual_browser_download",
401
+ "download_filename": download_file.name,
402
+ }
403
+ state["selected"].append(record)
404
+ state["selected"].sort(key=lambda row: row["item_id"])
405
+ sync_manual_acquisition(out, state)
406
+ pending["ingested_at"] = now()
407
+ pending["download_sha256"] = digest(payload)
408
+ save(out / "manual_pending.json", pending)
409
+ print(json.dumps({"ingested": item["item_id"], "acquired": len(state["selected"]),
410
+ "target": state["target"], "target_reached": state["target_reached"]},
411
+ ensure_ascii=False, indent=2))
412
+
413
+
414
+ def acquire(out, workers):
415
+ selection = load(out / "selection.json")
416
+ pool = read_lines(out / "selection_pool.jsonl")
417
+ target = int(selection["target"])
418
+ selected, rejected = [], []
419
+ try:
420
+ probe_download_access(pool[0])
421
+ except AcquisitionBarrier as error:
422
+ acquisition = {
423
+ "source": SOURCE, "observed_at": now(), "target": target, "pool_size": len(pool),
424
+ "attempted": 1, "selected": [],
425
+ "rejected": [{"item_id": pool[0]["item_id"], "title": pool[0]["title"], "reason": str(error)}],
426
+ "target_reached": False, "blocked": True,
427
+ "blocker": {
428
+ "type": "interactive_captcha",
429
+ "scope": "bitstream_content",
430
+ "resolution": "Obtain an official bulk-download route or written API access from OPEN ICM.",
431
+ },
432
+ }
433
+ save(out / "acquisition.json", acquisition)
434
+ print(json.dumps({"selected": 0, "rejected": 1, "target_reached": False,
435
+ "blocked": True, "reason": str(error)}, ensure_ascii=False, indent=2))
436
+ return
437
+ next_index = 0
438
+ while len(selected) < target and next_index < len(pool):
439
+ batch = pool[next_index:min(len(pool), next_index + max(workers * 2, target - len(selected)))]
440
+ next_index += len(batch)
441
+ with ThreadPoolExecutor(max_workers=workers) as executor:
442
+ futures = {executor.submit(acquire_one, out, item): item for item in batch}
443
+ for future in as_completed(futures):
444
+ item = futures[future]
445
+ try:
446
+ record = future.result()
447
+ if len(selected) < target:
448
+ selected.append(record)
449
+ print(f"Acquired {len(selected)}/{target}: {record['title']}", flush=True)
450
+ else:
451
+ Path(out / record["text_bitstream"]["path"]).unlink(missing_ok=True)
452
+ for evidence in record["license_evidence"]:
453
+ Path(out / evidence["path"]).unlink(missing_ok=True)
454
+ except Exception as error:
455
+ rejected.append({"item_id": item["item_id"], "title": item["title"], "reason": str(error)})
456
+ if len(selected) >= target:
457
+ break
458
+ selected.sort(key=lambda item: item["item_id"])
459
+ acquisition = {
460
+ "source": SOURCE, "observed_at": now(), "target": target, "pool_size": len(pool),
461
+ "attempted": len(selected) + len(rejected), "selected": selected, "rejected": rejected,
462
+ "target_reached": len(selected) == target,
463
+ }
464
+ save(out / "acquisition.json", acquisition)
465
+ print(json.dumps({"selected": len(selected), "rejected": len(rejected), "target_reached": acquisition["target_reached"]}, ensure_ascii=False, indent=2))
466
+
467
+
468
+ def normalize(text):
469
+ text = unicodedata.normalize("NFKC", text or "").replace("\u00ad", "").replace("\u200b", "")
470
+ text = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]", "", text)
471
+ lines = [re.sub(r"[ \t\xa0]+", " ", line).strip() for line in text.splitlines()]
472
+ lines = [line for line in lines if not re.fullmatch(r"\d{1,4}", line)]
473
+ text = "\n".join(lines)
474
+ text = re.sub(r"(?<=\w)-\n(?=[a-ząćęłńóśźż])", "", text)
475
+ text = re.sub(r"(?<![.!?:;\n])\n(?!\n)(?=[a-ząćęłńóśźż])", " ", text)
476
+ return re.sub(r"\n{3,}", "\n\n", text).strip()
477
+
478
+
479
+ def normalize_title(text):
480
+ text = unicodedata.normalize("NFKD", text or "").casefold()
481
+ text = "".join(character for character in text if not unicodedata.combining(character))
482
+ return " ".join(re.findall(r"\w+", text))
483
+
484
+
485
+ def shingle_sketch(text, limit=5_000):
486
+ words = re.findall(r"\w+", text.casefold())
487
+ hashes = set()
488
+ for index in range(max(0, len(words) - 4)):
489
+ value = " ".join(words[index:index + 5]).encode("utf-8")
490
+ hashes.add(int.from_bytes(hashlib.blake2b(value, digest_size=8).digest(), "big"))
491
+ if len(hashes) > limit:
492
+ return set(sorted(hashes)[:limit])
493
+ return hashes
494
+
495
+
496
+ def language_vote(identifier, text):
497
+ chunks = [text[:30_000], text[max(0, len(text) // 2 - 15_000):len(text) // 2 + 15_000], text[-30_000:]]
498
+ votes = [identifier.classify(chunk) for chunk in chunks if chunk.strip()]
499
+ languages = Counter(language for language, _ in votes)
500
+ return (languages.most_common(1)[0][0] if languages else "unknown", votes)
501
+
502
+
503
+ def build(out):
504
+ import pyarrow as pa
505
+ import pyarrow.parquet as pq
506
+ import tiktoken
507
+ from langid.langid import LanguageIdentifier, model
508
+
509
+ acquisition = load(out / "acquisition.json")
510
+ selection = load(out / "selection.json")
511
+ encoder = tiktoken.get_encoding("cl100k_base")
512
+ identifier = LanguageIdentifier.from_modelstring(model, norm_probs=True)
513
+ identifier.set_languages(["pl", "en", "de", "uk", "ru"])
514
+ rows, attribution, decisions, exact_seen, sketches = [], [], [], {}, {}
515
+ pii = Counter()
516
+ added = acquisition["observed_at"][:10]
517
+ for record in acquisition["selected"]:
518
+ raw_path = out / record["text_bitstream"]["path"]
519
+ raw = raw_path.read_bytes()
520
+ if digest(raw) != record["text_bitstream"]["sha256"]:
521
+ raise ValueError("TEXT checksum mismatch: " + record["item_id"])
522
+ text = normalize(raw.decode("utf-8-sig", errors="replace"))
523
+ replacement_count = text.count("\ufffd")
524
+ letters = len(re.findall(r"[A-Za-zĄĆĘŁŃÓŚŹŻąćęłńóśźż]", text))
525
+ language, votes = language_vote(identifier, text)
526
+ reason = ""
527
+ if len(text) < MIN_TEXT_CHARS:
528
+ reason = "too_little_extractable_text"
529
+ elif letters / max(len(text), 1) < 0.55:
530
+ reason = "low_letter_ratio"
531
+ elif replacement_count > 20 or replacement_count / max(len(text), 1) > 0.0001:
532
+ reason = "excessive_replacement_characters"
533
+ elif language != "pl":
534
+ reason = "non_polish_text"
535
+ text = text.replace("\ufffd", "[UNREADABLE_GLYPH]")
536
+ text, emails = EMAIL_RE.subn("[REDACTED:EMAIL]", text)
537
+ text, phones = PHONE_RE.subn("[REDACTED:PHONE]", text)
538
+ pii.update(email=emails, labelled_phone=phones)
539
+ exact_key = digest(" ".join(text.casefold().split()).encode("utf-8"))
540
+ duplicate_of, duplicate_score = None, 0.0
541
+ if not reason and exact_key in exact_seen:
542
+ reason, duplicate_of, duplicate_score = "normalized_duplicate", exact_seen[exact_key], 1.0
543
+ sketch = shingle_sketch(text)
544
+ if not reason:
545
+ for other_id, other_sketch in sketches.items():
546
+ score = len(sketch & other_sketch) / max(len(sketch | other_sketch), 1)
547
+ if score >= 0.90:
548
+ reason, duplicate_of, duplicate_score = "near_duplicate", other_id, score
549
+ break
550
+ row_id = f"{SOURCE}_{record['item_id']}"
551
+ decision = {
552
+ "id": row_id, "selected": not bool(reason), "reason": reason or "include",
553
+ "characters": len(text), "letter_ratio": letters / max(len(text), 1),
554
+ "replacement_characters": replacement_count, "language": language,
555
+ "language_votes": [{"language": lang, "confidence": float(score)} for lang, score in votes],
556
+ }
557
+ if duplicate_of:
558
+ decision.update({"duplicate_of": duplicate_of, "jaccard": duplicate_score})
559
+ decisions.append(decision)
560
+ if reason:
561
+ continue
562
+ exact_seen[exact_key] = row_id
563
+ sketches[row_id] = sketch
564
+ metadata = record["metadata"]
565
+ authors = values(metadata, "dc.contributor.author") or values(metadata, "dc.contributor.editor")
566
+ author = "; ".join(authors or ["Unknown"])
567
+ issued = values(metadata, "dc.date.issued")
568
+ accepted_labels = record["accepted_license_labels"]
569
+ spdx = LICENSES[accepted_labels[0]]
570
+ row = {
571
+ "id": row_id, "text": text, "source": SOURCE, "added": added,
572
+ "created": issued[0] if issued else "unknown", "token_count": len(encoder.encode_ordinary(text)),
573
+ "license": spdx, "author": author,
574
+ }
575
+ rows.append(row)
576
+ attribution.append({
577
+ "id": row_id, "item_id": record["item_id"], "title": record["title"], "authors": authors,
578
+ "publisher": values(metadata, "dc.publisher"), "issued": issued,
579
+ "doi": values(metadata, "dc.identifier.doi"), "handle": record["handle"],
580
+ "landing_url": record["landing_url"], "repository_license_labels": accepted_labels,
581
+ "license": spdx, "text_bitstream": record["text_bitstream"],
582
+ "license_evidence": record["license_evidence"], "original_bitstreams": record["original_bitstreams"],
583
+ "text_sha256": digest(text.encode("utf-8")),
584
+ "transformations": ["repository TEXT bundle", "Unicode/whitespace normalization", "page-number-only removal",
585
+ "line-wrap repair", "email and labelled-phone pattern redaction"],
586
+ })
587
+ root = out / "hf_repo"
588
+ (root / "data").mkdir(parents=True, exist_ok=True)
589
+ (root / "artifacts" / "source_pages").mkdir(parents=True, exist_ok=True)
590
+ schema = pa.schema([(field, pa.int64() if field == "token_count" else pa.string()) for field in FIELDS])
591
+ pq.write_table(pa.Table.from_pylist(rows, schema=schema), root / "data/train-00000-of-00001.parquet", compression="zstd")
592
+ write_lines(root / "artifacts/attribution.jsonl", attribution)
593
+ write_lines(root / "artifacts/decisions.jsonl", decisions)
594
+ write_lines(root / "artifacts/source_manifest.jsonl", read_lines(out / "source_manifest.jsonl"))
595
+ sample = sorted(rows, key=lambda row: digest(("sample:" + row["id"]).encode("utf-8")))[:12]
596
+ write_lines(root / "artifacts/sample.jsonl", sample)
597
+ save(root / "artifacts/selection.json", selection)
598
+ save(root / "artifacts/acquisition.json", acquisition)
599
+ save(root / "artifacts/api_pages.json", load(out / "api_pages.json"))
600
+ for source_page in sorted((out / "raw_api").rglob("*.json.gz")):
601
+ destination = root / "artifacts" / "source_pages" / source_page.relative_to(out / "raw_api")
602
+ destination.parent.mkdir(parents=True, exist_ok=True)
603
+ destination.write_bytes(source_page.read_bytes())
604
+ overlap = load(out / "overlap_audit.json") if (out / "overlap_audit.json").exists() else None
605
+ target_audit = load(out / "target_audit.json") if (out / "target_audit.json").exists() else None
606
+ if overlap:
607
+ save(root / "artifacts/overlap_audit.json", overlap)
608
+ if target_audit:
609
+ save(root / "artifacts/target_audit.json", target_audit)
610
+ stats = {
611
+ "eligible_source_records": selection["eligible_records"], "selection_pool": selection["pool_size"],
612
+ "pilot_target": acquisition["target"], "acquired": len(acquisition["selected"]),
613
+ "kept": len(rows), "rejected_by_text_qa": len(decisions) - len(rows),
614
+ "tokens": sum(row["token_count"] for row in rows), "characters": sum(len(row["text"]) for row in rows),
615
+ "author_coverage": sum(row["author"] != "Unknown" for row in rows) / len(rows) if rows else 0,
616
+ "license_counts": dict(Counter(row["license"] for row in rows)), "sample_count": len(sample), "added": added,
617
+ }
618
+ qa = {
619
+ "scope": "deterministic 100-record pilot, not a complete-corpus claim",
620
+ "license_gate": "repository item metadata is an allowlisted CC BY or CC BY-SA label",
621
+ "language_gate": "dc.language.iso:pl plus independent three-window langid vote",
622
+ "pii_pattern_matches": dict(pii), "exact_dedup": True,
623
+ "near_dedup": "deterministic capped 5-word-shingle hash Jaccard >= 0.90 within pilot",
624
+ "biblioteka_nauki_overlap": overlap or "pending", "cross_source_text_dedup": "pending target integration",
625
+ "benchmark_overlap": "pending", "limitations": [
626
+ "repository-generated TEXT may inherit PDF extraction errors",
627
+ "figures are omitted and tables may be flattened",
628
+ "item-level license metadata does not prove every quoted third-party passage is reusable",
629
+ "pattern checks are not comprehensive de-identification",
630
+ "pilot yield and token counts must not be extrapolated to all 6183 eligible records",
631
+ ],
632
+ }
633
+ save(root / "artifacts/stats.json", stats)
634
+ save(root / "artifacts/qa.json", qa)
635
+ protocol_id = "protocol:open-icm-pilot-v1"
636
+ run = {
637
+ "id": "run:" + digest({"script": digest(Path(__file__).read_bytes()), "selection": selection,
638
+ "acquisition": digest(acquisition)}),
639
+ "protocol": protocol_id, "started_at": selection["observed_at"], "finished_at": now(),
640
+ "success": True, "actor": "actor:codex", "stats": stats,
641
+ }
642
+ save(root / "artifacts/run.json", run)
643
+ excluded = {"README.md", "NOTICE.md", "artifacts/checksums.json", "artifacts/ontology.json"}
644
+ checks = {path.relative_to(root).as_posix(): digest(path.read_bytes()) for path in sorted(root.rglob("*"))
645
+ if path.is_file()
646
+ and path.relative_to(root).as_posix() not in excluded
647
+ and not path.relative_to(root).as_posix().startswith("src/")}
648
+ save(root / "artifacts/checksums.json", checks)
649
+ source_version = "version:source:" + digest({"manifest": selection["source_manifest_sha256"],
650
+ "api_pages": selection["api_pages_sha256"]})
651
+ dataset_version = "version:dataset:" + digest(checks)
652
+ selection_evidence = "evidence:selection:" + digest(selection)
653
+ acquisition_evidence = "evidence:acquisition:" + digest(acquisition)
654
+ qa_evidence = "evidence:qa:" + digest(qa)
655
+ evidence = [
656
+ {"id": selection_evidence, "observation_type": "source_inventory_and_selection",
657
+ "artifact": "artifacts/selection.json", "content_address": digest(selection), "produced_by": run["id"]},
658
+ {"id": acquisition_evidence, "observation_type": "bitstream_acquisition",
659
+ "artifact": "artifacts/acquisition.json", "content_address": digest(acquisition), "produced_by": run["id"]},
660
+ {"id": qa_evidence, "observation_type": "pilot_qa", "artifact": "artifacts/qa.json",
661
+ "content_address": digest(qa), "produced_by": run["id"]},
662
+ ]
663
+ overlap_evidence = None
664
+ if overlap:
665
+ overlap_evidence = "evidence:overlap:" + digest(overlap)
666
+ evidence.append({"id": overlap_evidence, "observation_type": "metadata_overlap_audit",
667
+ "artifact": "artifacts/overlap_audit.json", "content_address": digest(overlap),
668
+ "produced_by": run["id"]})
669
+ target_evidence = None
670
+ if target_audit:
671
+ target_evidence = "evidence:target:" + digest(target_audit)
672
+ evidence.append({"id": target_evidence, "observation_type": "target_registry_audit",
673
+ "artifact": "artifacts/target_audit.json", "content_address": digest(target_audit),
674
+ "produced_by": run["id"]})
675
+ ontology = {
676
+ "schema": "slayer-research-ontology-profile-v1",
677
+ "objects": [{"id": "object:source:open-icm", "type": "Source"},
678
+ {"id": "object:dataset:open-icm-pl-pilot", "type": "Dataset"}],
679
+ "versions": [{"id": source_version, "object": "object:source:open-icm",
680
+ "content_address": source_version.rsplit(":", 1)[-1]},
681
+ {"id": dataset_version, "object": "object:dataset:open-icm-pl-pilot",
682
+ "content_address": dataset_version.rsplit(":", 1)[-1]}],
683
+ "protocols": [{"id": protocol_id, "procedure": "pinned discovery; allowlisted item license; Polish metadata and language vote; TEXT checksum; normalization; PII patterns; exact and near dedup"}],
684
+ "runs": [run], "evidence": evidence,
685
+ "claims": [
686
+ {"id": "claim:eligible-count-observed", "statement": f"The pinned discovery run observed {selection['eligible_records']} unique Polish records carrying an allowlisted CC BY or CC BY-SA label.",
687
+ "supported_by": [selection_evidence], "falsification_condition": "The preserved API pages and manifest do not reproduce the count and filters."},
688
+ {"id": "claim:pilot-retention", "statement": f"The pilot retained {stats['kept']} records after text QA and within-pilot deduplication.",
689
+ "supported_by": [acquisition_evidence, qa_evidence], "falsification_condition": "The decisions, Parquet rows, or checksums do not reproduce the retention count."},
690
+ {"id": "claim:source-absence-at-audit", "statement": "OPEN ICM was not registered as a source in the pinned DynaWord data tree or open pull-request list at audit time.",
691
+ "supported_by": [target_evidence] if target_evidence else [qa_evidence], "falsification_condition": "The pinned target evidence contains an OPEN ICM source or matching proposal."},
692
+ {"id": "claim:training-value-untested", "statement": "Net corpus novelty and training benefit remain untested hypotheses.",
693
+ "supported_by": [qa_evidence] + ([overlap_evidence] if overlap_evidence else []),
694
+ "falsification_condition": "Target-wide text deduplication and controlled ablations establish those properties."},
695
+ ],
696
+ "actors": [{"id": "actor:piotrsty", "type": "Contributor"},
697
+ {"id": "actor:icm-uw", "type": "Organization"}, {"id": "actor:codex", "type": "Agent"}],
698
+ "relations": [{"source": dataset_version, "predicate": "DERIVED_FROM", "target": source_version},
699
+ {"source": dataset_version, "predicate": "GENERATED_BY", "target": run["id"]}] +
700
+ ([{"source": dataset_version, "predicate": "VALIDATED_AGAINST",
701
+ "target": f"hf:dataset:{TARGET}@{target_audit['revision']}"}] if target_audit else []),
702
+ "pending": ["complete-corpus acquisition", "cross-source text deduplication", "benchmark contamination check",
703
+ "review of third-party quoted text", "controlled training ablation"],
704
+ }
705
+ save(root / "artifacts/ontology.json", ontology)
706
+ card = f"""---
707
+ license: other
708
+ license_name: per-record-cc-by-or-cc-by-sa
709
+ language:
710
+ - pl
711
+ task_categories:
712
+ - text-generation
713
+ configs:
714
+ - config_name: default
715
+ data_files:
716
+ - split: train
717
+ path: data/train-00000-of-00001.parquet
718
+ ---
719
+
720
+ # OPEN ICM Polish publications pilot
721
+
722
+ A deterministic 100-record research pilot of Polish full-text publications
723
+ whose OPEN ICM item metadata declares an allowlisted CC BY or CC BY-SA license.
724
+ This is not a complete-corpus release.
725
+
726
+ - Acquired records: {stats['acquired']}
727
+ - Retained after text QA and within-source deduplication: {stats['kept']}
728
+ - Characters: {stats['characters']:,}
729
+ - Tokens: {stats['tokens']:,} (`cl100k_base` proxy)
730
+ - Author coverage: {stats['author_coverage']:.1%}
731
+ - License field: preserved per record
732
+
733
+ ## Provenance and rights
734
+
735
+ Every row is linked to its OPEN ICM item, authors, repository license label,
736
+ normalized license identifier, selected TEXT bitstream metadata and checksums.
737
+ The accepted source labels are limited to CC BY and CC BY-SA variants. License
738
+ and attribution obligations remain applicable per record. Item-level licensing
739
+ does not establish the status of every quoted third-party passage.
740
+
741
+ ## Processing and limitations
742
+
743
+ The repository-generated TEXT bundle is normalized for Unicode, whitespace,
744
+ page-number-only lines and wrapped lines. Email and labelled-phone patterns are
745
+ redacted. Language is checked independently across three text windows. Exact
746
+ and deterministic near deduplication are performed within the pilot.
747
+
748
+ PDF-derived text may contain extraction errors; figures are omitted and tables
749
+ may be flattened. Pattern checks are not comprehensive de-identification.
750
+ Cross-source text deduplication, benchmark contamination checks, quoted-text
751
+ review and controlled training ablations remain downstream gates.
752
+
753
+ ## Review artifacts
754
+
755
+ See `artifacts/sample.jsonl`, `attribution.jsonl`, `decisions.jsonl`,
756
+ `overlap_audit.json`, `stats.json`, `qa.json`, `checksums.json`, `run.json` and
757
+ `ontology.json`. The ontology separates content-addressed Objects and Versions,
758
+ Protocols, actual Runs, Evidence, falsifiable Claims, Actors and typed lineage.
759
+ """
760
+ (root / "README.md").write_text(card, encoding="utf-8")
761
+ (root / "NOTICE.md").write_text(
762
+ "# Attribution and license notice\n\n"
763
+ "Source: OPEN ICM, https://open.icm.edu.pl/home\n\n"
764
+ "Each record retains its item URL, authorship, repository license label, normalized license identifier, "
765
+ "bitstream metadata and license evidence where exposed by OPEN ICM. The applicable CC BY or CC BY-SA "
766
+ "terms and attribution obligations apply per record; consult `artifacts/attribution.jsonl`.\n\n"
767
+ "Preparation: Piotr Styla with OpenAI Codex. Changes: repository TEXT selection, Unicode and whitespace "
768
+ "normalization, page-number-only removal, line-wrap repair, limited email and labelled-phone redaction, "
769
+ "language/quality filtering and within-source deduplication. No endorsement by OPEN ICM or credited "
770
+ "authors is implied.\n",
771
+ encoding="utf-8",
772
+ )
773
+ print(json.dumps(stats, ensure_ascii=False, indent=2))
774
+
775
+
776
+ def audit_target(out):
777
+ info = request_json(f"https://huggingface.co/api/datasets/{TARGET}")
778
+ revision = info["sha"]
779
+ tree = request_json(f"https://huggingface.co/api/datasets/{TARGET}/tree/{revision}",
780
+ {"recursive": "true", "expand": "false"})
781
+ discussions = request_json(f"https://huggingface.co/api/datasets/{TARGET}/discussions",
782
+ {"status": "open", "p": 0})
783
+ paths = sorted(item.get("path", "") for item in tree)
784
+ open_rows = [{"num": item.get("num"), "title": item.get("title"), "status": item.get("status"),
785
+ "author": item.get("author", {}).get("name")} for item in discussions.get("discussions", [])]
786
+ matches = [path for path in paths if any(term in path.casefold() for term in ("open_icm", "ceon"))]
787
+ discussion_matches = [row for row in open_rows if any(term in (row.get("title") or "").casefold()
788
+ for term in ("open icm", "ceon"))]
789
+ report = {
790
+ "target": TARGET, "revision": revision, "last_modified": info.get("lastModified"),
791
+ "tree_paths": len(paths), "source_path_matches": matches, "open_discussions": open_rows,
792
+ "matching_open_discussions": discussion_matches, "source_absent": not matches and not discussion_matches,
793
+ "observed_at": now(),
794
+ }
795
+ save(out / "target_audit.json", report)
796
+ print(json.dumps({"revision": revision, "source_absent": report["source_absent"],
797
+ "tree_matches": matches, "discussion_matches": discussion_matches}, ensure_ascii=False, indent=2))
798
+
799
+
800
+ def audit_overlap(out):
801
+ import pyarrow.parquet as pq
802
+ from huggingface_hub import HfApi, HfFileSystem
803
+
804
+ acquisition = load(out / "acquisition.json")
805
+ revision = HfApi().dataset_info(TARGET).sha
806
+ remote = f"datasets/{TARGET}@{revision}/data/biblioteka_nauki/biblioteka_nauki.parquet"
807
+ with HfFileSystem().open(remote, "rb") as handle:
808
+ table = pq.read_table(handle, columns=["id", "attribution"])
809
+ target = []
810
+ for row in table.to_pylist():
811
+ attribution = row.get("attribution") or ""
812
+ parts = attribution.split(" | ")
813
+ title = parts[2] if len(parts) >= 4 else attribution
814
+ target.append((row["id"], attribution, normalize_title(title)))
815
+ target_by_title = {}
816
+ for row_id, attribution, normalized in target:
817
+ if normalized:
818
+ target_by_title.setdefault(normalized, []).append((row_id, attribution))
819
+ target_titles = list(target_by_title)
820
+ results = []
821
+ for record in acquisition["selected"]:
822
+ title = normalize_title(record["title"])
823
+ dois = [value.casefold() for value in values(record["metadata"], "dc.identifier.doi")]
824
+ exact = [{"id": row_id, "attribution": attribution} for row_id, attribution, normalized in target
825
+ if (title and title in normalized) or any(doi in attribution.casefold() for doi in dois)]
826
+ fuzzy = []
827
+ if not exact and title:
828
+ matches = get_close_matches(title, target_titles, n=3, cutoff=0.90)
829
+ for normalized in matches:
830
+ score = SequenceMatcher(None, title, normalized).ratio()
831
+ fuzzy.extend({"score": score, "id": row_id, "attribution": attribution}
832
+ for row_id, attribution in target_by_title[normalized])
833
+ fuzzy = fuzzy[:3]
834
+ results.append({"item_id": record["item_id"], "title": record["title"], "doi": dois,
835
+ "exact_title_or_doi_matches": exact, "fuzzy_title_matches": fuzzy})
836
+ report = {
837
+ "target": f"{TARGET}:data/biblioteka_nauki", "target_revision": revision,
838
+ "method": "DOI or normalized title substring; fallback SequenceMatcher >= 0.90 over attribution titles",
839
+ "target_rows": table.num_rows, "candidate_records": len(results),
840
+ "records_with_exact_match": sum(bool(row["exact_title_or_doi_matches"]) for row in results),
841
+ "records_with_fuzzy_match": sum(bool(row["fuzzy_title_matches"]) for row in results),
842
+ "text_overlap": "not tested; target-wide text dedup remains an integration gate",
843
+ "observed_at": now(), "results": results,
844
+ }
845
+ save(out / "overlap_audit.json", report)
846
+ print(json.dumps({key: report[key] for key in ("target_revision", "target_rows", "candidate_records",
847
+ "records_with_exact_match", "records_with_fuzzy_match")},
848
+ ensure_ascii=False, indent=2))
849
+
850
+
851
+ def verify(out):
852
+ import pyarrow.parquet as pq
853
+
854
+ root = out / "hf_repo"
855
+ table = pq.read_table(root / "data/train-00000-of-00001.parquet")
856
+ rows = table.to_pylist()
857
+ stats = load(root / "artifacts/stats.json")
858
+ decisions = read_lines(root / "artifacts/decisions.jsonl")
859
+ attribution = read_lines(root / "artifacts/attribution.jsonl")
860
+ sample = read_lines(root / "artifacts/sample.jsonl")
861
+ assert table.column_names == FIELDS
862
+ assert len(rows) == stats["kept"] == len(attribution)
863
+ assert len(decisions) == stats["acquired"]
864
+ assert sum(item["selected"] for item in decisions) == len(rows)
865
+ assert sum(row["token_count"] for row in rows) == stats["tokens"]
866
+ assert all(row["source"] == SOURCE and row["license"] in LICENSES.values() for row in rows)
867
+ assert all(EMAIL_RE.search(row["text"]) is None for row in rows)
868
+ by_id = {row["id"]: row for row in rows}
869
+ assert len(sample) == stats["sample_count"] and all(by_id[row["id"]] == row for row in sample)
870
+ ontology = load(root / "artifacts/ontology.json")
871
+ evidence = {item["id"] for item in ontology["evidence"]}
872
+ assert all(item["falsification_condition"] and set(item["supported_by"]) <= evidence for item in ontology["claims"])
873
+ checks = load(root / "artifacts/checksums.json")
874
+ assert all((root / path).is_file() and digest((root / path).read_bytes()) == checksum for path, checksum in checks.items())
875
+ for item in ontology["evidence"]:
876
+ artifact = root / item["artifact"]
877
+ assert artifact.is_file() and digest(load(artifact)) == item["content_address"]
878
+ print(json.dumps({"verified": True, **stats}, ensure_ascii=False, indent=2))
879
+
880
+
881
+ def main():
882
+ parser = argparse.ArgumentParser()
883
+ parser.add_argument("--output", type=Path, required=True)
884
+ parser.add_argument("--limit", type=int, default=100)
885
+ parser.add_argument("--workers", type=int, default=8)
886
+ parser.add_argument("--download-file", type=Path)
887
+ parser.add_argument("command", choices=["discover", "acquire", "prepare_manual", "ingest_manual",
888
+ "audit_target", "audit_overlap", "build", "verify"])
889
+ args = parser.parse_args()
890
+ if args.command == "discover":
891
+ discover(args.output, args.limit)
892
+ elif args.command == "acquire":
893
+ acquire(args.output, args.workers)
894
+ elif args.command == "prepare_manual":
895
+ prepare_manual(args.output)
896
+ elif args.command == "ingest_manual":
897
+ ingest_manual(args.output, args.download_file)
898
+ elif args.command == "audit_target":
899
+ audit_target(args.output)
900
+ elif args.command == "audit_overlap":
901
+ audit_overlap(args.output)
902
+ elif args.command == "build":
903
+ build(args.output)
904
+ else:
905
+ verify(args.output)
906
+
907
+
908
+ if __name__ == "__main__":
909
+ main()
src/open_icm_requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ requests==2.32.5
2
+ pyarrow==23.0.1
3
+ tiktoken==0.12.0
4
+ langid==1.1.6
5
+ huggingface_hub>=1.0,<2
6
+ pytest>=8,<10
src/sources.py CHANGED
@@ -601,6 +601,21 @@ SOURCES = {
601
  "records should remain separately labeled or held until "
602
  "legal review confirms their US status.",
603
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
  "nkjp1m": {
605
  "added": "2026-06-15",
606
  "custom_datasheet": True,
 
601
  "records should remain separately labeled or held until "
602
  "legal review confirms their US status.",
603
  },
604
+ "open_icm_pl": {
605
+ "added": "2026-09-10",
606
+ "release": None,
607
+ "file_key": "open_icm_pl",
608
+ "pretty": "OPEN ICM Polish open-access publications pilot",
609
+ "license": "per-record CC BY or CC BY-SA",
610
+ "license_spdx": "MIXED",
611
+ "traceable": "Every retained record carries an allowlisted item-level CC BY or CC BY-SA label; original item URLs, authors, normalized license identifiers, TEXT bitstream checksums and available license evidence are preserved per record.",
612
+ "upstream": "https://open.icm.edu.pl/home",
613
+ "provenance": "Discovered directly through the official OPEN ICM DSpace API. Official repository-generated TEXT bitstreams were downloaded after the repository's interactive CAPTCHA and verified against declared sizes/checksums. Unicode/whitespace normalization, limited pattern redaction, language/quality filtering and within-source deduplication are documented in the committed artifacts.",
614
+ "domain": "academic/mixed",
615
+ "created": "1998-2024",
616
+ "is_ocr": True,
617
+ "custom_datasheet": True,
618
+ },
619
  "nkjp1m": {
620
  "added": "2026-06-15",
621
  "custom_datasheet": True,
src/test_open_icm_pl_contract.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import importlib.util
2
+ from pathlib import Path
3
+
4
+
5
+ SCRIPT = Path(__file__).with_name("fetch_open_icm_pl.py")
6
+ SPEC = importlib.util.spec_from_file_location("fetch_open_icm_pl", SCRIPT)
7
+ MODULE = importlib.util.module_from_spec(SPEC)
8
+ SPEC.loader.exec_module(MODULE)
9
+
10
+
11
+ def metadata(**entries):
12
+ return {key: [{"value": value}] for key, value in entries.items()}
13
+
14
+
15
+ def test_license_gate_is_fail_closed():
16
+ valid = {"metadata": metadata(**{"dc.language.iso": "pl", "dc.rights": "Uznanie autorstwa 4.0 Międzynarodowe"})}
17
+ assert MODULE.is_polish_open_item(valid)
18
+ assert not MODULE.is_polish_open_item({"metadata": metadata(**{"dc.language.iso": "en", "dc.rights": "Uznanie autorstwa 4.0 Międzynarodowe"})})
19
+ assert not MODULE.is_polish_open_item({"metadata": metadata(**{"dc.language.iso": "pl", "dc.rights": "Dozwolony użytek"})})
20
+ assert not MODULE.is_polish_open_item({"metadata": metadata(**{"dc.language.iso": "pl", "dc.rights": "Uznanie autorstwa-Użycie niekomercyjne 4.0 Międzynarodowe"})})
21
+
22
+
23
+ def test_deterministic_pool_covers_each_available_license():
24
+ rows = []
25
+ for index, label in enumerate(MODULE.LICENSES):
26
+ rows.append({"item_id": str(index), "title": str(index), "metadata": metadata(**{"dc.rights": label})})
27
+ rows.extend({"item_id": f"extra-{index}", "title": str(index),
28
+ "metadata": metadata(**{"dc.rights": next(iter(MODULE.LICENSES))})} for index in range(20))
29
+ first = MODULE.deterministic_pool(rows, 10)
30
+ second = MODULE.deterministic_pool(list(reversed(rows)), 10)
31
+ assert [row["item_id"] for row in first] == [row["item_id"] for row in second]
32
+ covered = {label for row in first for label in MODULE.values(row["metadata"], "dc.rights")}
33
+ assert covered == set(MODULE.LICENSES)
34
+
35
+
36
+ def test_normalize_repairs_hyphenation_and_page_numbers():
37
+ assert MODULE.normalize("Pierw-\nszy akapit.\n12\n\ndrugi wiersz") == "Pierwszy akapit.\n\ndrugi wiersz"
38
+
39
+
40
+ def test_title_normalization_is_case_and_diacritic_insensitive():
41
+ assert MODULE.normalize_title("Ćwiczenia: Łódź") == "cwiczenia łodz"
42
+
43
+
44
+ def test_text_bound_is_small_enough_for_pilot():
45
+ assert MODULE.MAX_TEXT_BYTES == 20 * 1024 * 1024
46
+ assert MODULE.MIN_TEXT_CHARS == 3_000
47
+
48
+
49
+ def test_captcha_response_is_an_acquisition_barrier():
50
+ class Response:
51
+ url = "https://open.icm.edu.pl/captcha.html?protected=/bitstreams/example/download"
52
+ headers = {"Content-Type": "text/html; charset=UTF-8"}
53
+ content = b"<!doctype html><html><body>I'm not a robot</body></html>"
54
+
55
+ try:
56
+ MODULE.detect_download_barrier(Response())
57
+ except MODULE.AcquisitionBarrier as error:
58
+ assert "interactive CAPTCHA" in str(error)
59
+ else:
60
+ raise AssertionError("CAPTCHA response was not rejected")
61
+
62
+
63
+ def test_plain_text_response_is_not_a_barrier():
64
+ class Response:
65
+ url = "https://open.icm.edu.pl/server/api/core/bitstreams/example/content"
66
+ headers = {"Content-Type": "text/plain"}
67
+ content = b"Tekst publikacji"
68
+
69
+ MODULE.detect_download_barrier(Response())
70
+
71
+
72
+ def test_manual_ingest_verifies_and_records_download(tmp_path):
73
+ payload = "To jest poprawny tekst pilota.".encode("utf-8")
74
+ item = {
75
+ "item_id": "item-1", "title": "Tytul", "handle": "123/1",
76
+ "metadata": metadata(**{"dc.language.iso": "pl", "dc.rights": "Uznanie autorstwa 4.0 Międzynarodowe"}),
77
+ }
78
+ MODULE.save(tmp_path / "selection.json", {"target": 1, "pool_size": 2})
79
+ MODULE.save(tmp_path / "manual_pending.json", {
80
+ "item": item, "landing_url": "https://open.icm.edu.pl/items/item-1",
81
+ "accepted_license_labels": ["Uznanie autorstwa 4.0 Międzynarodowe"],
82
+ "text_bitstream": {
83
+ "id": "stream-1", "name": "text.txt", "bytes": len(payload),
84
+ "checksum": {"checkSumAlgorithm": "MD5", "value": MODULE.hashlib.md5(payload).hexdigest()},
85
+ "content_url": "https://open.icm.edu.pl/bitstreams/stream-1/download",
86
+ },
87
+ "license_evidence": [], "original_bitstreams": [],
88
+ })
89
+ download = tmp_path / "download.txt"
90
+ download.write_bytes(payload)
91
+
92
+ MODULE.ingest_manual(tmp_path, download)
93
+
94
+ acquisition = MODULE.load(tmp_path / "acquisition.json")
95
+ assert acquisition["target_reached"] is True
96
+ assert acquisition["selected"][0]["text_bitstream"]["sha256"] == MODULE.digest(payload)
97
+ assert (tmp_path / "raw_text/item-1.txt").read_bytes() == payload
98
+
99
+
100
+ def test_manual_ingest_rejects_wrong_size(tmp_path):
101
+ MODULE.save(tmp_path / "selection.json", {"target": 1, "pool_size": 1})
102
+ MODULE.save(tmp_path / "manual_pending.json", {
103
+ "item": {"item_id": "item-1", "title": "Tytul", "handle": "123/1", "metadata": {}},
104
+ "landing_url": "https://open.icm.edu.pl/items/item-1", "accepted_license_labels": [],
105
+ "text_bitstream": {"bytes": 99, "checksum": {}, "content_url": "https://example.invalid"},
106
+ "license_evidence": [], "original_bitstreams": [],
107
+ })
108
+ download = tmp_path / "download.txt"
109
+ download.write_bytes(b"short")
110
+
111
+ try:
112
+ MODULE.ingest_manual(tmp_path, download)
113
+ except ValueError as error:
114
+ assert "expected 99" in str(error)
115
+ else:
116
+ raise AssertionError("wrong-size manual download was not rejected")