Check info dir#
Verifies filesystem counter files against both current RDF entities and provenance:
Entity counters (
info_file_*.txt): the counter must equal the maximum resource number found in current data or provenance.Provenance counters (
prov_file_*.txt): each value must match the maximum snapshot number found in the RDF provenance.File structure: expected files, numeric values, and exact line counts must match.
Missing provenance: every current entity without a provenance snapshot is reported.
Usage#
uv run python -m oc_meta.run.infodir.check <directory> <info_dir> [options]
Parameters#
Parameter |
Required |
Description |
|---|---|---|
|
Yes |
Path to the zipped JSON-LD RDF directory |
|
Yes |
Base directory for counter files |
|
No |
Output JSON report path; defaults to |
|
No |
Worker processes; defaults to |
|
No |
Examples retained per category; defaults to |
|
No |
Temporary storage directory; defaults to the parent of |
Process#
Reconstructs expected provenance counters in fixed-width temporary files.
Scans current entities and derives exact entity counter values.
Reads each text counter file sequentially and compares values in blocks.
Counts every difference while retaining only the configured number of examples.
Writes a JSON report.
Example#
uv run python -m oc_meta.run.infodir.check \
/srv/oc_meta/rdf \
/srv/oc_meta/info_dir \
--workers 8 \
-o /tmp/report.json
Status and exit codes#
aligned, exit0: counters and source data agree.warnings, exit1: counters agree, but current entities without provenance exist.mismatched, exit1: counter values or files differ.scan_failed, exit2: the RDF source could not be scanned.
Output#
{
"timestamp": "2026-07-18T12:00:00+00:00",
"status": "mismatched",
"root_path": "/srv/oc_meta/rdf",
"info_dir": "/srv/oc_meta/info_dir",
"entity_counter_mismatches": {
"total": 1,
"examples": [
{
"prefix": "060",
"short_name": "br",
"expected": 500000,
"actual": 400000,
"relation": "too_low"
}
],
"truncated": false
}
}
The report contains the same total, examples, and truncated structure for provenance mismatches, counter file errors, and live entities without provenance.