Convert TIB Knowledge Loom records into FORRT nanopublications — semantic, signed, replicable assertions published to the nanopub network.
Each Knowledge Loom record becomes three types of nanopublications:
- FORRT Claims — one per statement (what was found)
- FORRT-KL Replication Study — the study design (software, methods, data, script)
- FORRT-KL Replication Outcomes — the results (actual values, metrics, visualizations)
loom_records.txt maps all 32 Knowledge Loom records to their GitLab repos:
a03gjbxh5v 4 lezhnina-2025-1-1 Analysis of difference for Iris species
vjea9aobg7 2 paredes-2022-1 Determinants of B. oleae abundance DONE
...
Single record — notebooks/loom2nanopub.ipynb
Interactive workflow with preview before each publish step:
- Set
LOOM_RESOURCE_IDin the Configuration cell - Run all cells top to bottom
- Preview each TriG file before publishing
- Mark the record as DONE in
loom_records.txt
Batch — notebooks/loom2nanopub_batch.ipynb
Process all non-DONE records:
- Run Setup cells (section 1)
- Run Generate — creates TriG files for all records into
outputs/<ID>/ - Review the generated files
- Set
PUBLISH_BATCH = Trueand run Publish
# Single record
python loom2nanopub.py a03gjbxh5v
# All non-DONE records
python loom2nanopub.py --all
# Dry run (show what would be generated)
python loom2nanopub.py --all --dry-run
# Custom output directory
python loom2nanopub.py --all -o ./batch-output/The tools parse dtreg JSON-LD files from each record's GitLab repo and the Knowledge Loom API to produce nanopubs with:
| Field | Source | Nanopub type |
|---|---|---|
| Statement text | KL API | Claim |
| Source publication DOI | KL API (basises) |
Claim |
| Data source description | dtreg has_input |
Claim |
| Software packages + versions | dtreg executes → part_of |
Study |
| Runtime environment | dtreg part_of → part_of |
Study |
| Method calls | dtreg executes → is_implemented_by |
Study |
| Input data descriptions | dtreg has_input → label |
Study, Outcome |
| Input dataset URLs | metadata.json file_mapping |
Study |
| Analysis script URL | dtreg top-level is_implemented_by |
Study |
| Result values (actual numbers) | dtreg has_output → source_table |
Outcome |
| Target variable | dtreg targets → label |
Outcome |
| Result visualization URL | dtreg has_output → has_expression |
Outcome |
| KL record link | KL URL | Study, Outcome |
Publishing must be sequential per record because each nanopub references the previous:
- Claims — published first, resource URIs collected
- Study — references claims via
targetsClaim, study URI collected - Outcomes — reference study via
isOutcomeOf
Both the batch notebook and CLI handle this automatically.
- Python 3.10+
rdflibnanopub(Python library for signing and publishing)- A nanopub profile (
~/.nanopub/or custom path)
mamba activate sciencelive # or your env with rdflib + nanopub