Skip to content

Commit 1ac67b9

Browse files
committed
pipeline refinement
2 parents 8d84134 + 96cf799 commit 1ac67b9

30 files changed

Lines changed: 2955 additions & 1530 deletions

File tree

data/integration/runs/latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20260420T214128Z-c1e60c32
1+
20260421T111602Z-8d84134d-manual_group_correction

docs/cli.md

Lines changed: 158 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,29 @@
44

55
### `rsetl run`
66

7-
Run the integration pipeline, either as a full run, a partial run, or by resuming an existing run.
7+
Run the full ETL/integration pipeline, a partial pipeline, a single stage, or resume an existing run.
88

99
**Options**
1010

11-
* `--tag TEXT` — append a tag to the run ID.
11+
* `--tag TEXT` — append a tag to the generated run ID.
1212
* `--resume-run TEXT` — resume an existing run by run ID or run directory path.
1313
* `--no-merge` — skip the `merge` stage.
1414
* `--no-human-updates` — skip the `human_updates` stage.
15-
* `--remove-opeb-metrics` — enable the `remove_opeb_metrics` stage.
16-
* `--from-stage {transformation,grouping,remove_opeb_metrics,conflict_detection,simplify_blocks,json_to_jsonl,disambiguation,human_updates,merge,stats}` — start the pipeline from this stage.
17-
* `--until {transformation,grouping,remove_opeb_metrics,conflict_detection,simplify_blocks,json_to_jsonl,disambiguation,human_updates,merge,stats}` — run until this stage, inclusive.
18-
* `--only {transformation,grouping,remove_opeb_metrics,conflict_detection,simplify_blocks,json_to_jsonl,disambiguation,human_updates,merge,stats}` — run only one stage.
19-
* `--python-exe PATH` — Python executable for subprocesses (default: `python`).
20-
* `--workdir PATH` — working directory (default: `.`).
21-
* `--runs-root PATH` — root folder for versioned outputs (default: `data/integration/runs`).
15+
* `--remove-opeb-metrics` — disable removal of OEB metrics.
16+
* `--dry-run-disambiguation` — run disambiguation without creating conflict files or GitHub issues.
17+
* `--from-stage STAGE` — start the pipeline from this stage.
18+
* `--until STAGE` — run the pipeline until this stage, inclusive.
19+
* `--only STAGE` — run only one stage.
20+
* `--python-exe PATH` — Python executable for subprocesses. Default: `python`.
21+
* `--workdir PATH` — working directory. Default: `.`.
22+
* `--runs-root PATH` — root folder for run outputs. Default: `data/integration/runs`.
2223

2324
**Stages**
2425

25-
The pipeline supports the following stage names:
26+
The pipeline supports the following stage names, in order:
2627

2728
* `transformation`
29+
* `license-normalization`
2830
* `grouping`
2931
* `remove_opeb_metrics`
3032
* `conflict_detection`
@@ -34,85 +36,155 @@ The pipeline supports the following stage names:
3436
* `human_updates`
3537
* `merge`
3638
* `stats`
39+
* `fairsoft`
3740

3841
**Examples**
3942

4043
```bash
41-
# standard run
44+
# Standard full run
4245
rsetl run
4346

44-
# run with tag and skip database merge
45-
rsetl run --tag 2025Q4 --no-merge
47+
# Run with a tag
48+
rsetl run --tag 2026Q2
4649

47-
# remove OEB metrics and change output directory
48-
rsetl run --remove-opeb-metrics --runs-root /data/rso/runs
50+
# Run without merging results into the database
51+
rsetl run --tag test-run --no-merge
4952

50-
# stop after disambiguation, before manual annotations are applied
51-
rsetl run --until disambiguation --remove-opeb-metrics --tag pre-annotation
53+
# Run until disambiguation
54+
rsetl run --until disambiguation --tag pre-human-review
5255

53-
# resume an existing run from human updates onward
54-
rsetl run --resume-run 20260325T103000Z-ab12cd-pre-annotation --from-stage human_updates
56+
# Run disambiguation in dry-run mode
57+
rsetl run --only disambiguation \
58+
--resume-run 20260428T090000Z-ab12cd-pre-human-review \
59+
--dry-run-disambiguation
5560

56-
# resume an existing run and execute only stats
57-
rsetl run --resume-run 20260325T103000Z-ab12cd-pre-annotation --only stats
61+
# Resume an existing run from human updates onward
62+
rsetl run \
63+
--resume-run 20260428T090000Z-ab12cd-pre-human-review \
64+
--from-stage human_updates
65+
66+
# Resume an existing run and execute only FAIRsoft scoring
67+
rsetl run \
68+
--resume-run 20260428T090000Z-ab12cd-pre-human-review \
69+
--only fairsoft
5870
```
5971

6072
**Notes**
6173

6274
* `--tag` cannot be used together with `--resume-run`.
6375
* When `--resume-run` is used, the existing run directory and run ID are reused.
64-
* Resumed runs append execution information to the existing `manifest.json`.
76+
* Resumed runs append a new execution record to the existing `manifest.json`.
77+
* When resuming, required input files for the selected stages must already exist.
78+
* The `remove_opeb_metrics`, `human_updates`, and `merge` stages can be skipped with their corresponding options.
79+
* `--dry-run-disambiguation` only affects the `disambiguation` stage.
6580

6681
---
6782

6883
### `rsetl run-transformation`
6984

7085
Run only the transformation step.
7186

72-
This command executes the transformation stage independently and creates a versioned run directory with provenance metadata, similarly to the full pipeline.
87+
This command executes transformation independently and creates a versioned run directory with provenance metadata.
7388

7489
**Options**
7590

76-
* `--tag TEXT` — append a tag to the run ID.
77-
* `--sources TEXT` — sources passed to the transformation step (default: `all`).
78-
* `--python-exe PATH` — Python executable for subprocesses (default: `python`).
79-
* `--workdir PATH` — working directory (default: `.`).
80-
* `--runs-root PATH` — root folder for versioned outputs (default: `data/integration/runs`).
91+
* `--tag TEXT` — append a tag to the generated run ID.
92+
* `--sources TEXT` — sources passed to the transformation step. Default: `all`.
93+
* `--python-exe PATH` — Python executable for subprocesses. Default: `python`.
94+
* `--workdir PATH` — working directory. Default: `.`.
95+
* `--runs-root PATH` — root folder for run outputs. Default: `data/integration/runs`.
8196

8297
**Examples**
8398

8499
```bash
85-
# run only transformation with default sources
100+
# Run transformation with default sources
86101
rsetl run-transformation
87102

88-
# run only transformation with a custom tag
103+
# Run transformation with a custom tag
89104
rsetl run-transformation --tag test1
90105

91-
# run only transformation with a custom output directory
106+
# Run transformation for selected sources
107+
rsetl run-transformation --sources biotools
108+
109+
# Use a custom output directory
92110
rsetl run-transformation --runs-root /data/rso/runs
93111
```
94112

95113
---
96114

115+
### `rsetl enrich-publications`
116+
117+
Enrich publication metadata and citation counts using Europe PMC.
118+
119+
This command delegates to the publication enrichment adapter and can update MongoDB, write a JSONL cache, or run in inspection/dry-run modes depending on the options passed.
120+
121+
**Options**
122+
123+
* `--collection TEXT` — MongoDB collection name. Default: `publicationsMetadataDev`.
124+
* `--jsonl-path PATH` — path to the JSONL cache/output file. Default: `data/cache/publications_enrichment.jsonl`.
125+
* `--progress-every N` — print progress every N processed documents. Default: `1000`.
126+
* `--limit N` — maximum number of documents to process.
127+
* `--no-skip-seen` — do not skip DOIs already present in the JSONL file.
128+
* `--no-skip-existing-europe-pmc-citations` — process records even if they already contain Europe PMC citations.
129+
* `--no-write-cache` — do not append results to the JSONL file.
130+
* `--no-update-db` — do not update MongoDB.
131+
* `--dry-run` — show configuration and exit without running enrichment.
132+
133+
**Examples**
134+
135+
```bash
136+
# Run publication enrichment with default settings
137+
rsetl enrich-publications
138+
139+
# Process only 100 records
140+
rsetl enrich-publications --limit 100
141+
142+
# Print progress more frequently
143+
rsetl enrich-publications --progress-every 100
144+
145+
# Run enrichment without updating MongoDB
146+
rsetl enrich-publications --no-update-db
147+
148+
# Reprocess records even if Europe PMC citations already exist
149+
rsetl enrich-publications --no-skip-existing-europe-pmc-citations
150+
151+
# Check the effective configuration without running
152+
rsetl enrich-publications --dry-run
153+
```
154+
155+
---
156+
157+
### `rsetl run-webavailability`
158+
159+
Run the daily web availability update and ensure ToolsDev URLs exist.
160+
161+
Additional arguments are passed through to the web availability job.
162+
163+
**Example**
164+
165+
```bash
166+
rsetl run-webavailability
167+
```
168+
169+
---
170+
97171
### `rsetl runs list`
98172

99173
List available pipeline runs.
100174

101-
Shows a compact summary of existing run directories, including whether they contain a manifest, whether disambiguation output exists, and the latest executed stages.
175+
Shows a compact summary including run ID, update time, manifest availability, disambiguation output availability, resumability, execution count, and latest executed stages.
102176

103177
**Options**
104178

105-
* `--workdir PATH` — working directory (default: `.`).
106-
* `--runs-root PATH` — root folder for versioned outputs (default: `data/integration/runs`).
179+
* `--workdir PATH` — working directory. Default: `.`.
180+
* `--runs-root PATH` — root folder for run outputs. Default: `data/integration/runs`.
107181
* `--json` — output the run list as JSON.
108182

109183
**Examples**
110184

111185
```bash
112-
# list runs in table format
113186
rsetl runs list
114187

115-
# list runs as JSON
116188
rsetl runs list --json
117189
```
118190

@@ -122,60 +194,53 @@ rsetl runs list --json
122194

123195
Show details for a specific run.
124196

125-
By default this prints a human-readable summary including run metadata, latest execution information, paths, and latest options.
197+
By default this prints a human-readable summary with run metadata, latest execution information, paths, and latest options.
126198

127199
**Arguments**
128200

129201
* `run_ref` — run ID or full run directory path.
130202

131203
**Options**
132204

133-
* `--workdir PATH` — working directory (default: `.`).
134-
* `--runs-root PATH` — root folder for versioned outputs (default: `data/integration/runs`).
205+
* `--workdir PATH` — working directory. Default: `.`.
206+
* `--runs-root PATH` — root folder for run outputs. Default: `data/integration/runs`.
135207
* `--json` — output the full manifest as JSON.
136208

137209
**Examples**
138210

139211
```bash
140-
# show one run by run ID
141-
rsetl runs show 20260325T103000Z-ab12cd-pre-annotation
212+
rsetl runs show 20260428T090000Z-ab12cd-pre-human-review
142213

143-
# show one run by full path
144-
rsetl runs show /data/rso/runs/20260325T103000Z-ab12cd-pre-annotation
214+
rsetl runs show /data/rso/runs/20260428T090000Z-ab12cd-pre-human-review
145215

146-
# show manifest as JSON
147-
rsetl runs show 20260325T103000Z-ab12cd-pre-annotation --json
216+
rsetl runs show 20260428T090000Z-ab12cd-pre-human-review --json
148217
```
149218

150219
---
151220

152221
### `rsetl runs latest`
153222

154-
Show the most recent run.
155-
156-
By default this prints a human-readable summary of the latest run.
223+
Show the latest run.
157224

158225
**Options**
159226

160-
* `--workdir PATH` — working directory (default: `.`).
161-
* `--runs-root PATH` — root folder for versioned outputs (default: `data/integration/runs`).
227+
* `--workdir PATH` — working directory. Default: `.`.
228+
* `--runs-root PATH` — root folder for run outputs. Default: `data/integration/runs`.
162229
* `--json` — output the full manifest as JSON.
163230

164231
**Examples**
165232

166233
```bash
167-
# show latest run summary
168234
rsetl runs latest
169235

170-
# show latest run as JSON
171236
rsetl runs latest --json
172237
```
173238

174239
---
175240

176241
### `rsetl check-env`
177242

178-
Check environment variables and connectivity to MongoDB, external APIs, and tokens.
243+
Check environment variables and API connectivity.
179244

180245
**Example**
181246

@@ -187,7 +252,8 @@ rsetl check-env
187252

188253
## Environment configuration
189254

190-
You can store environment variables in a `.env` file instead of exporting them manually.
255+
The pipeline loads environment variables from a `.env` file if present.
256+
191257
Example `.env`:
192258

193259
```env
@@ -199,24 +265,49 @@ MONGO_PWD=pass
199265
MONGO_AUTH_SRC=admin
200266
MONGO_DB=observatory
201267
202-
# Disambiguation tokens
268+
# Disambiguation
203269
GITHUB_TOKEN=ghp_...
270+
GITLAB_TOKEN=...
204271
OPENROUTER_API_KEY=...
205272
HUGGINGFACE_API_KEY=...
206-
# GITLAB_TOKEN=...
273+
```
274+
275+
## Run outputs
207276

208-
# Optional APIs (useful for development)
209-
OBSERVATORY_API_URL=https://observatory.openebench.bsc.es/api
210-
LICENSES_API_URL=https://licenses-mapping/api
277+
Each full pipeline run creates a versioned directory under:
278+
279+
```text
280+
data/integration/runs/<timestamp>-<gitsha>(-tag)/
211281
```
212282

213-
The pipeline automatically loads this file if present.
283+
A `latest` symlink points to the most recent run.
284+
285+
Full pipeline runs write a `manifest.json` file containing:
214286

215-
## Notes
287+
* run ID and run directory;
288+
* git short SHA;
289+
* created and last-updated timestamps;
290+
* paths to generated files;
291+
* latest execution options;
292+
* selected and executed stages;
293+
* masked environment configuration;
294+
* execution history.
216295

217-
* `rsetl --help`, `rsetl run --help`, `rsetl run-transformation --help`, `rsetl runs --help`, `rsetl runs list --help`, `rsetl runs show --help`, `rsetl runs latest --help`, and `rsetl check-env --help` show contextual usage.
218-
* Each run creates a versioned directory under `data/integration/runs/<timestamp>-<gitsha>(-tag)/`.
219-
* A `latest` symlink points to the most recent run.
220-
* Full pipeline runs write a `manifest.json` file with provenance metadata.
221-
* Resumed runs update the existing `manifest.json` and append a new execution record to `execution_history`.
222-
* Transformation-only runs write a `manifest.transformation.json` file with provenance metadata.
296+
Transformation-only runs write their own transformation manifest.
297+
298+
## Help
299+
300+
Use the built-in help commands for contextual usage:
301+
302+
```bash
303+
rsetl --help
304+
rsetl run --help
305+
rsetl run-transformation --help
306+
rsetl enrich-publications --help
307+
rsetl run-webavailability --help
308+
rsetl runs --help
309+
rsetl runs list --help
310+
rsetl runs show --help
311+
rsetl runs latest --help
312+
rsetl check-env --help
313+
```

docs/installation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Some stages call external services (APIs and model providers); make sure credent
2121
??? info "Other services used"
2222
The following services are also accessed in some steps but require no credentials:
2323

24-
- [Observatory REST API](https://observatory.openebench.bsc.es/api/docs): for FAIRness evaluation
2524
- [Licenses-mapping API](https://observatory.openebench.bsc.es/licenses-mapping/docs): for SPDX license normalization
2625
- [Europe PMC](https://europepmc.org/RestfulWebService) and [Semantic Scholar](https://www.semanticscholar.org/product/api) APIs: for publication enrichment
2726

0 commit comments

Comments
 (0)