Generate info dir#
Scans zipped JSON-LD data and provenance files and creates filesystem counter files.
Usage#
uv run python -m oc_meta.run.infodir.gen <rdf_directory> <new_info_dir> [options]
Parameters#
Parameter |
Required |
Description |
|---|---|---|
|
Yes |
Path to the RDF directory containing |
|
Yes |
New directory where counter files will be published |
|
No |
Generation report path; defaults to |
|
No |
Worker processes; defaults to |
|
No |
Missing-provenance examples retained in the report; defaults to |
The destination must not exist. This prevents an old or partially generated info dir from being updated in place.
Process#
Scans provenance ZIP files and writes snapshot counters to fixed-width temporary files.
Scans data ZIP files, records current entity maxima, and identifies current entities without provenance.
Sets each entity counter to the maximum identifier found in either data or provenance.
Converts the temporary counters sequentially to
prov_file_*.txt.Publishes the result from a sibling staging directory with a single rename.
The scan keeps at most twice the configured worker count in flight. Temporary storage uses four bytes per provenance counter position, in addition to the final text files.
Example#
uv run python -m oc_meta.run.infodir.gen \
/srv/oc_meta/rdf \
/srv/oc_meta/info_dir-new \
--workers 8 \
-o /srv/oc_meta/info-dir-generation.json
An invalid ZIP, invalid JSON-LD entity, or unsupported URI stops generation before the destination is published. Current entities without provenance do not stop generation; the report uses status generated_with_warnings and contains exact counts plus a bounded sample.