Server Handbook live check: run log
------------------------------------------------------------------------------
Tool https://serverhandbook.com/tools/dspace-saf-builder
Check scripts/live/checks/tool-dspace-saf-builder.mjs (sha256 72467bfd38f49797c88a26c11ca4b9ed6091ac0d4c1a9d9cf6410b58cdf7e2c3)
Ran at 2026-12-02T01:10:12Z (1208 s)
Result PASS, all 27 claims held
Tested on
System Ubuntu 26.04.1 LTS
Kernel 7.0.0-44-generic
Package openjdk-21-jdk-headless 21.0.13.1+2-1~26.04.1
Package maven 3.9.12-1
Package ant 1.10.15-1build1
Package postgresql-17 17.12-1.pgdg26.04+1
Package dspace 10.1
Package solr 9.11.0
Setup A fresh Ubuntu 26.04 server (4 GB of memory) with DSpace 10.1 installed as lesson 1 of the DSpace course installs it (PostgreSQL, Solr 9.11.0, the backend as services; done by the check before the first step shown), reached over SSH as a sudo user.
Every version above was read from the server at run time. Passwords used on the
throwaway test server are shown as [password]. How we test: https://serverhandbook.com/how-we-test
------------------------------------------------------------------------------
What the steps changed on the server (recorded before the first step and after the last)
Packages added (0)
Packages upgraded (0)
Packages removed (0)
Services enabled at boot (0)
Services disabled (0)
Listening sockets opened (0)
Listening sockets closed (0)
Files added in /etc (0)
Files changed in /etc (0)
Files removed from /etc (0)
Disk used on / (includes logs written during the run): +16.5 MB
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Claims (27), each with what the run saw
------------------------------------------------------------------------------
1. ok a bare Ubuntu 26.04 server box (web-server) starts
2. ok the tool refuses every broken spreadsheet with its reason, and its zip reads cleanly (local check: all pass)
| PASS the fixture builds with no errors and no notes
| PASS five items, item_001 … item_005
| PASS python reads the zip without a CRC error and every XML file parses
| PASS the Urdu title keeps its language: title.none[ur]
| PASS the Chinese title and file name survive
| PASS two authors from one cell with ||
| PASS dcterms goes to metadata_dcterms.xml with quotes and commas kept
| PASS contents: one line per file, tab, bundle:ORIGINAL
| PASS refused: no dc.title column
| PASS refused: a row with no title
| PASS refused: a file the reader did not add
| PASS refused: a file name that is a folder path
| PASS refused: a name the importer keeps (contents)
| PASS refused: a column that is not a field
| PASS refused: the same column twice
| PASS refused: an unquoted comma (more cells than columns)
| PASS refused: a hidden control character
| PASS refused: only a header
| PASS batch-edit columns (id, collection) are left out with a note, not an error
|
| all checks pass
3. ok (setup) the tools: Java 21, Ant, git, Maven, Node
4. ok (setup) the PostgreSQL project's apt repository (26.04 ships 18; DSpace 10 supports up to 17)
5. ok (setup) PostgreSQL 17
6. ok (setup) role and database dspace
7. ok (setup) the dspace user and /dspace
8. ok (setup) Solr 9.11.0 on 127.0.0.1:8983
9. ok (setup) Solr answers
10. ok (setup) the DSpace 10.1 source and local.cfg
11. ok (setup) mvn package
12. ok (setup) ant fresh_install
13. ok (setup) database migrate
14. ok (setup) the Solr cores
15. ok (setup) Solr is back with the cores
16. ok (setup) the backend service
17. ok (setup) the REST API answers: DSpace 10.1
18. ok (setup) the administrator
19. ok structure-builder made the collection and printed its handle
|
| Faculty of ScienceTheses
20. ok the zip holds item_001 … item_005, each with dublin_core.xml, and the Urdu and Chinese file names intact
| File Name Modified Size
| item_001/dublin_core.xml 2026-12-02 06:10:32 576
| item_001/metadata_dcterms.xml 2026-12-02 06:10:32 303
| item_001/contents 2026-12-02 06:10:32 29
| item_001/thesis-1.pdf 2026-12-02 06:10:32 157
| item_002/dublin_core.xml 2026-12-02 06:10:32 604
| item_002/contents 2026-12-02 06:10:32 56
| item_002/thesis-2.pdf 2026-12-02 06:10:32 157
| item_002/data-2.csv 2026-12-02 06:10:32 17
| item_003/dublin_core.xml 2026-12-02 06:10:32 518
| item_003/contents 2026-12-02 06:10:32 29
| item_003/thesis-3.pdf 2026-12-02 06:10:32 157
| item_004/dublin_core.xml 2026-12-02 06:10:32 646
| item_004/contents 2026-12-02 06:10:32 34
| item_004/تحقیق-۴.pdf 2026-12-02 06:10:32 162
| item_005/dublin_core.xml 2026-12-02 06:10:32 512
| item_005/contents 2026-12-02 06:10:32 29
| item_005/论文-5.pdf 2026-12-02 06:10:32 157
21. ok dspace import --zip ends with "The script has completed" and no error
| Schema: dc Element: title Qualifier: none Value: پنجاب کے دیہات میں پانی کا استعمال
| Schema: dc Element: contributor Qualifier: author Value: Ahmed, Bilal
| Schema: dc Element: date Qualifier: issued Value: 2025
| Schema: dc Element: type Qualifier: none Value: Thesis
| Schema: dc Element: subject Qualifier: none Value: water
| Processing contents file: /dspace/imports/importSAF/faf7dfbc-1688-4a63-aa3e-c9d0be8bdcf4/saf-import.zip/item_004/contents
| Bitstream: تحقیق-۴.pdf Bundle: ORIGINAL
| Processing handle file: handle
| It appears there is no handle file -- generating one
| 3 item_004
| Loading dublin core from /dspace/imports/importSAF/faf7dfbc-1688-4a63-aa3e-c9d0be8bdcf4/saf-import.zip/item_005/dublin_core.xml
| Schema: dc Element: title Qualifier: none Value: 稻田灌溉用水研究
| Schema: dc Element: contributor Qualifier: author Value: 王, 芳
| Schema: dc Element: date Qualifier: issued Value: 2024
| Schema: dc Element: type Qualifier: none Value: Thesis
| Schema: dc Element: subject Qualifier: none Value: irrigation
| Processing contents file: /dspace/imports/importSAF/faf7dfbc-1688-4a63-aa3e-c9d0be8bdcf4/saf-import.zip/item_005/contents
| Bitstream: 论文-5.pdf Bundle: ORIGINAL
| Processing handle file: handle
| It appears there is no handle file -- generating one
| 4 item_005
| Started: 2026-12-02T01:29:01.643583660Z
| Ended: 2026-12-02T01:29:16.343039236Z
| Elapsed time: 14 secs (14700 msecs)
| The script has completed
22. ok the mapfile lists the five items with their new handles
| item_001 123456789/3
| item_002 123456789/4
| item_003 123456789/5
| item_004 123456789/6
| item_005 123456789/7
23. ok item_001: title, author, date, both subjects, the dcterms abstract with its quotes and comma, its PDF
| item_001 | dc.title=Soil moisture in dry seasons | dc.contributor.author=Khan, Sara | dc.date.issued=2024 | dc.subject=soil | dc.subject=drought | dcterms.abstract=Moisture measured weekly, "before and after" the rains. | file=thesis-1.pdf
| item_002 | dc.title=Groundwater recharge on terraced farms | dc.contributor.author=Osei, Kwame | dc.contributor.author=Mensah, Ama | dc.date.issued=2025 | dc.subject=groundwater | file=thesis-2.pdf | file=data-2.csv
| item_003 | dc.title=Rainfall records 1990 to 2020 | dc.contributor.author=Lopez, Ana | dc.date.issued=2023 | dc.subject=rainfall | file=thesis-3.pdf
| item_004 | dc.title=Water use in Punjab villages | dc.title[ur]=پنجاب کے دیہات میں پانی کا استعمال | dc.contributor.author=Ahmed, Bilal | dc.date.issued=2025 | dc.subject=water | file=تحقیق-۴.pdf
| item_005 | dc.title=稻田灌溉用水研究 | dc.contributor.author=王, 芳 | dc.date.issued=2024 | dc.subject=irrigation | file=论文-5.pdf
24. ok item_002: two authors from one cell (||), two files from one cell
| item_001 | dc.title=Soil moisture in dry seasons | dc.contributor.author=Khan, Sara | dc.date.issued=2024 | dc.subject=soil | dc.subject=drought | dcterms.abstract=Moisture measured weekly, "before and after" the rains. | file=thesis-1.pdf
| item_002 | dc.title=Groundwater recharge on terraced farms | dc.contributor.author=Osei, Kwame | dc.contributor.author=Mensah, Ama | dc.date.issued=2025 | dc.subject=groundwater | file=thesis-2.pdf | file=data-2.csv
| item_003 | dc.title=Rainfall records 1990 to 2020 | dc.contributor.author=Lopez, Ana | dc.date.issued=2023 | dc.subject=rainfall | file=thesis-3.pdf
| item_004 | dc.title=Water use in Punjab villages | dc.title[ur]=پنجاب کے دیہات میں پانی کا استعمال | dc.contributor.author=Ahmed, Bilal | dc.date.issued=2025 | dc.subject=water | file=تحقیق-۴.pdf
| item_005 | dc.title=稻田灌溉用水研究 | dc.contributor.author=王, 芳 | dc.date.issued=2024 | dc.subject=irrigation | file=论文-5.pdf
25. ok item_004: the Urdu title kept with language "ur", and the Urdu file name
| item_001 | dc.title=Soil moisture in dry seasons | dc.contributor.author=Khan, Sara | dc.date.issued=2024 | dc.subject=soil | dc.subject=drought | dcterms.abstract=Moisture measured weekly, "before and after" the rains. | file=thesis-1.pdf
| item_002 | dc.title=Groundwater recharge on terraced farms | dc.contributor.author=Osei, Kwame | dc.contributor.author=Mensah, Ama | dc.date.issued=2025 | dc.subject=groundwater | file=thesis-2.pdf | file=data-2.csv
| item_003 | dc.title=Rainfall records 1990 to 2020 | dc.contributor.author=Lopez, Ana | dc.date.issued=2023 | dc.subject=rainfall | file=thesis-3.pdf
| item_004 | dc.title=Water use in Punjab villages | dc.title[ur]=پنجاب کے دیہات میں پانی کا استعمال | dc.contributor.author=Ahmed, Bilal | dc.date.issued=2025 | dc.subject=water | file=تحقیق-۴.pdf
| item_005 | dc.title=稻田灌溉用水研究 | dc.contributor.author=王, 芳 | dc.date.issued=2024 | dc.subject=irrigation | file=论文-5.pdf
26. ok item_005: the Chinese title, author and file name
| item_001 | dc.title=Soil moisture in dry seasons | dc.contributor.author=Khan, Sara | dc.date.issued=2024 | dc.subject=soil | dc.subject=drought | dcterms.abstract=Moisture measured weekly, "before and after" the rains. | file=thesis-1.pdf
| item_002 | dc.title=Groundwater recharge on terraced farms | dc.contributor.author=Osei, Kwame | dc.contributor.author=Mensah, Ama | dc.date.issued=2025 | dc.subject=groundwater | file=thesis-2.pdf | file=data-2.csv
| item_003 | dc.title=Rainfall records 1990 to 2020 | dc.contributor.author=Lopez, Ana | dc.date.issued=2023 | dc.subject=rainfall | file=thesis-3.pdf
| item_004 | dc.title=Water use in Punjab villages | dc.title[ur]=پنجاب کے دیہات میں پانی کا استعمال | dc.contributor.author=Ahmed, Bilal | dc.date.issued=2025 | dc.subject=water | file=تحقیق-۴.pdf
| item_005 | dc.title=稻田灌溉用水研究 | dc.contributor.author=王, 芳 | dc.date.issued=2024 | dc.subject=irrigation | file=论文-5.pdf
27. ok (tested on) the box reports its OS, kernel and the version of 6 package(s)
| PRETTY_NAME="Ubuntu 26.04.1 LTS"
| VIRT=none
| KERNEL=7.0.0-44-generic
| PKG ant 1.10.15-1build1
| PKG maven 3.9.12-1
| PKG openjdk-21-jdk-headless 21.0.13.1+2-1~26.04.1
| PKG postgresql-17 17.12-1.pgdg26.04+1
| dspace: DSpace version: 10.1
| solr: /opt/solr-9.11.0
------------------------------------------------------------------------------
Commands and what they printed (5)
------------------------------------------------------------------------------
$ sudo -u dspace tee /srv/import/structure.xml > /dev/null <<'EOF'
$ Faculty of ScienceTheses
$ EOF
$ sudo -iu dspace /dspace/bin/dspace structure-builder -f /srv/import/structure.xml -o /srv/import/structure-out.xml -e admin@example.org
$ sudo cat /srv/import/structure-out.xml
Faculty of ScienceTheses
$ python3 -m zipfile -l /srv/import/saf-import.zip
File Name Modified Size
item_001/dublin_core.xml 2026-12-02 06:10:32 576
item_001/metadata_dcterms.xml 2026-12-02 06:10:32 303
item_001/contents 2026-12-02 06:10:32 29
item_001/thesis-1.pdf 2026-12-02 06:10:32 157
item_002/dublin_core.xml 2026-12-02 06:10:32 604
item_002/contents 2026-12-02 06:10:32 56
item_002/thesis-2.pdf 2026-12-02 06:10:32 157
item_002/data-2.csv 2026-12-02 06:10:32 17
item_003/dublin_core.xml 2026-12-02 06:10:32 518
item_003/contents 2026-12-02 06:10:32 29
item_003/thesis-3.pdf 2026-12-02 06:10:32 157
item_004/dublin_core.xml 2026-12-02 06:10:32 646
item_004/contents 2026-12-02 06:10:32 34
item_004/تحقیق-۴.pdf 2026-12-02 06:10:32 162
item_005/dublin_core.xml 2026-12-02 06:10:32 512
item_005/contents 2026-12-02 06:10:32 29
item_005/论文-5.pdf 2026-12-02 06:10:32 157
$ sudo -iu dspace /dspace/bin/dspace import --add --eperson=admin@example.org --collection=123456789/2 --source=/srv/import --zip=saf-import.zip --mapfile=/srv/import/mapfile 2>&1 | grep -vE '^\s+(at |\.\.\. [0-9]+ more)' | tail -n 25
Schema: dc Element: title Qualifier: none Value: پنجاب کے دیہات میں پانی کا استعمال
Schema: dc Element: contributor Qualifier: author Value: Ahmed, Bilal
Schema: dc Element: date Qualifier: issued Value: 2025
Schema: dc Element: type Qualifier: none Value: Thesis
Schema: dc Element: subject Qualifier: none Value: water
Processing contents file: /dspace/imports/importSAF/faf7dfbc-1688-4a63-aa3e-c9d0be8bdcf4/saf-import.zip/item_004/contents
Bitstream: تحقیق-۴.pdf Bundle: ORIGINAL
Processing handle file: handle
It appears there is no handle file -- generating one
3 item_004
Loading dublin core from /dspace/imports/importSAF/faf7dfbc-1688-4a63-aa3e-c9d0be8bdcf4/saf-import.zip/item_005/dublin_core.xml
Schema: dc Element: title Qualifier: none Value: 稻田灌溉用水研究
Schema: dc Element: contributor Qualifier: author Value: 王, 芳
Schema: dc Element: date Qualifier: issued Value: 2024
Schema: dc Element: type Qualifier: none Value: Thesis
Schema: dc Element: subject Qualifier: none Value: irrigation
Processing contents file: /dspace/imports/importSAF/faf7dfbc-1688-4a63-aa3e-c9d0be8bdcf4/saf-import.zip/item_005/contents
Bitstream: 论文-5.pdf Bundle: ORIGINAL
Processing handle file: handle
It appears there is no handle file -- generating one
4 item_005
Started: 2026-12-02T01:29:01.643583660Z
Ended: 2026-12-02T01:29:16.343039236Z
Elapsed time: 14 secs (14700 msecs)
The script has completed
$ sudo cat /srv/import/mapfile
item_001 123456789/3
item_002 123456789/4
item_003 123456789/5
item_004 123456789/6
item_005 123456789/7
$ python3 - <<'EOF'
$ import json, sys, urllib.request
$ API = 'http://localhost:8080/server/api'
$ def get(u):
$ return json.load(urllib.request.urlopen(u))
$ for line in open('/srv/import/mapfile', encoding='utf-8'):
$ folder, handle = line.split()
$ item = get(API + '/pid/find?id=' + handle)
$ md = item['metadata']
$ out = [folder]
$ for k in ['dc.title', 'dc.contributor.author', 'dc.date.issued', 'dc.subject', 'dcterms.abstract']:
$ for v in md.get(k, []):
$ out.append(k + ('[' + v['language'] + ']' if v.get('language') else '') + '=' + v['value'])
$ bundles = get(API + '/core/items/' + item['uuid'] + '/bundles?embed=bitstreams')['_embedded']['bundles']
$ for b in bundles:
$ if b['name'] == 'ORIGINAL':
$ for bs in b['_embedded']['bitstreams']['_embedded']['bitstreams']:
$ out.append('file=' + bs['name'])
$ print(' | '.join(out))
$ EOF
item_001 | dc.title=Soil moisture in dry seasons | dc.contributor.author=Khan, Sara | dc.date.issued=2024 | dc.subject=soil | dc.subject=drought | dcterms.abstract=Moisture measured weekly, "before and after" the rains. | file=thesis-1.pdf
item_002 | dc.title=Groundwater recharge on terraced farms | dc.contributor.author=Osei, Kwame | dc.contributor.author=Mensah, Ama | dc.date.issued=2025 | dc.subject=groundwater | file=thesis-2.pdf | file=data-2.csv
item_003 | dc.title=Rainfall records 1990 to 2020 | dc.contributor.author=Lopez, Ana | dc.date.issued=2023 | dc.subject=rainfall | file=thesis-3.pdf
item_004 | dc.title=Water use in Punjab villages | dc.title[ur]=پنجاب کے دیہات میں پانی کا استعمال | dc.contributor.author=Ahmed, Bilal | dc.date.issued=2025 | dc.subject=water | file=تحقیق-۴.pdf
item_005 | dc.title=稻田灌溉用水研究 | dc.contributor.author=王, 芳 | dc.date.issued=2024 | dc.subject=irrigation | file=论文-5.pdf
------------------------------------------------------------------------------
The check's source (scripts/live/checks/tool-dspace-saf-builder.mjs)
As it ran.
------------------------------------------------------------------------------
/**
* TOOL proof (plan07 §2): /tools/dspace-saf-builder. Rented server (DSpace needs the RAM), per release. Hidden setup:
* DSpace 10.1 as lesson 1 installs it, backend only (scripts/live/dspace-base.mjs, ui: false).
*
* Runs on the small 4 GB build server (backend only), and the setup line says so (baseSetup memory).
*
* What it proves: the zip the tool makes, built by the tool's OWN module (lib/tools/dspace-saf-builder, through
* scripts/tools/check-dspace-saf-builder.ts --out) from the sample spreadsheet the page offers (five items: an Urdu
* title with language="ur", a Chinese title and file name, two authors in one cell, a dcterms abstract with quotes and
* commas, an item with two files), is imported by DSpace's own `dspace import --add --zip`; the mapfile lists five
* items; and the REST API returns every value and file as the spreadsheet had them.
* The checks the tool makes BEFORE an import (a missing file, a bad column …) run on this computer:
* `npx tsx scripts/tools/check-dspace-saf-builder.ts`, part of this run (hidden, its result is a claim).
*/
import { execFileSync } from 'node:child_process'
import { mkdtempSync, writeFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { bareBox, reportBox } from '../lib.mjs'
import { putFile } from '../box.mjs'
import { AS_DSPACE, basePackages, baseSetup, installDSpace } from '../dspace-base.mjs'
export const meta = { box: 'vps' }
const RELEASE = process.env.LIVE_BOX_RELEASE || '24.04'
const DB_PASS = '[password]'
const ADMIN_PASS = '[password]'
const ADMIN_EMAIL = 'admin@example.org'
const D = '/dspace/bin/dspace'
const FILES = ['thesis-1.pdf', 'thesis-2.pdf', 'data-2.csv', 'thesis-3.pdf', 'تحقیق-۴.pdf', '论文-5.pdf']
// Every item as the REST API should return it: the spreadsheet's values, nothing typed twice by hand elsewhere.
const PY = `
import json, sys, urllib.request
API = 'http://localhost:8080/server/api'
def get(u):
return json.load(urllib.request.urlopen(u))
for line in open('/srv/import/mapfile', encoding='utf-8'):
folder, handle = line.split()
item = get(API + '/pid/find?id=' + handle)
md = item['metadata']
out = [folder]
for k in ['dc.title', 'dc.contributor.author', 'dc.date.issued', 'dc.subject', 'dcterms.abstract']:
for v in md.get(k, []):
out.append(k + ('[' + v['language'] + ']' if v.get('language') else '') + '=' + v['value'])
bundles = get(API + '/core/items/' + item['uuid'] + '/bundles?embed=bitstreams')['_embedded']['bundles']
for b in bundles:
if b['name'] == 'ORIGINAL':
for bs in b['_embedded']['bitstreams']['_embedded']['bitstreams']:
out.append('file=' + bs['name'])
print(' | '.join(out))
`
const check = (ctx) =>
bareBox(ctx, async ({ sudoUser }) => {
const sh = sudoUser()
const { run, L } = sh
// hidden, on this computer: the tool's own refusals, then the zip from the sample spreadsheet with six small files
const local = execFileSync('npx', ['tsx', 'scripts/tools/check-dspace-saf-builder.ts'], { encoding: 'utf8' })
ctx.check('the tool refuses every broken spreadsheet with its reason, and its zip reads cleanly (local check: all pass)', /all checks pass/.test(local) && !/^FAIL/m.test(local), local)
const dir = mkdtempSync(join(tmpdir(), 'saf-files-'))
for (const f of FILES) writeFileSync(join(dir, f), f.endsWith('.csv') ? 'year,mm\n2024,812\n' : `%PDF-1.4\n% ${f}\n1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj\n2 0 obj << /Type /Pages /Kids [] /Count 0 >> endobj\ntrailer << /Root 1 0 R >>\n%%EOF\n`)
const zip = join(dir, 'saf-import.zip')
execFileSync('npx', ['tsx', 'scripts/tools/check-dspace-saf-builder.ts', `--out=${zip}`, `--files=${dir}`], { encoding: 'utf8' })
installDSpace(ctx, sh, { release: RELEASE, dbPass: DB_PASS, adminEmail: ADMIN_EMAIL, adminPass: ADMIN_PASS, ui: false })
if (!putFile(zip, '/tmp/saf-import.zip')) throw new Error('could not copy the zip to the box')
L('sudo mkdir -p /srv/import && sudo mv /tmp/saf-import.zip /srv/import/ && sudo chown -R dspace:dspace /srv/import')
// ── a collection to import into (as the lesson makes it) ───────────────────────────────
const struct = run(
[
`sudo -u dspace tee /srv/import/structure.xml > /dev/null <<'EOF'`,
'Faculty of ScienceTheses',
'EOF',
`${AS_DSPACE} ${D} structure-builder -f /srv/import/structure.xml -o /srv/import/structure-out.xml -e ${ADMIN_EMAIL}`,
'sudo cat /srv/import/structure-out.xml',
].join('\n'),
{ id: 'structure-builder', timeout: 300000 },
)
const handle = struct.out.match(/ list.out.includes(`${f}/dublin_core.xml`)) && list.out.includes('item_004/تحقیق-۴.pdf') && list.out.includes('item_005/论文-5.pdf') && list.out.includes('item_001/metadata_dcterms.xml'), list.out)
// ── DSpace's own import of it ─────────────────────────────────────────────────────────
const imp = run(`${AS_DSPACE} ${D} import --add --eperson=${ADMIN_EMAIL} --collection=${handle} --source=/srv/import --zip=saf-import.zip --mapfile=/srv/import/mapfile 2>&1 | grep -vE '^\\s+(at |\\.\\.\\. [0-9]+ more)' | tail -n 25`, { id: 'import-zip', timeout: 600000 })
ctx.check('dspace import --zip ends with "The script has completed" and no error', /The script has completed/.test(imp.out) && !/Exception|ERROR|aborting/i.test(imp.out), imp.out)
const map = run('sudo cat /srv/import/mapfile', { id: 'mapfile' })
ctx.check('the mapfile lists the five items with their new handles', (map.out.match(/^item_00[1-5] 123456789\/\d+$/gm) || []).length === 5, map.out)
// ── every value and file, read back from the REST API ─────────────────────────────────
const items = run(`python3 - <<'EOF'\n${PY.trim()}\nEOF`, { id: 'items-rest' })
const row = (f) => items.out.split('\n').find((l) => l.startsWith(`${f} |`)) ?? ''
ctx.check('item_001: title, author, date, both subjects, the dcterms abstract with its quotes and comma, its PDF', row('item_001').includes('dc.title=Soil moisture in dry seasons') && row('item_001').includes('dc.subject=soil | dc.subject=drought') && row('item_001').includes('dcterms.abstract=Moisture measured weekly, "before and after" the rains.') && row('item_001').includes('file=thesis-1.pdf'), items.out)
ctx.check('item_002: two authors from one cell (||), two files from one cell', row('item_002').includes('dc.contributor.author=Osei, Kwame | dc.contributor.author=Mensah, Ama') && row('item_002').includes('file=thesis-2.pdf') && row('item_002').includes('file=data-2.csv'), items.out)
ctx.check('item_004: the Urdu title kept with language "ur", and the Urdu file name', row('item_004').includes('dc.title[ur]=پنجاب کے دیہات میں پانی کا استعمال') && row('item_004').includes('file=تحقیق-۴.pdf'), items.out)
ctx.check('item_005: the Chinese title, author and file name', row('item_005').includes('dc.title=稻田灌溉用水研究') && row('item_005').includes('dc.contributor.author=王, 芳') && row('item_005').includes('file=论文-5.pdf'), items.out)
ctx.stepsDone()
reportBox(ctx, L, baseSetup(RELEASE, { ui: false, memory: '4 GB' }), basePackages(RELEASE).packages, basePackages(RELEASE).extra)
})
export default check