Skip to content

Generate info dir

Scans the RDF directory structure and populates Redis with the correct counter values based on existing entities.

Terminal window
uv run python -m oc_meta.run.infodir.gen <directory> [options]
ParameterRequiredDefaultDescription
directoryYes-Path to the RDF directory (containing br/, ra/, etc.)
--redis-hostNolocalhostRedis server host
--redis-portNo6379Redis server port
--redis-dbNo6Redis database number
  1. For each entity type (br, ra, ar, re, id), the script finds the highest numbered entity in each supplier prefix folder
  2. Sets the main counter for each entity type and prefix
  3. Scans all provenance files in parallel to find the highest snapshot number for each entity
  4. Updates the provenance counters in batch
Terminal window
uv run python -m oc_meta.run.infodir.gen /srv/oc_meta/rdf \
--redis-host localhost \
--redis-port 6379 \
--redis-db 5

This reads all RDF files under /srv/oc_meta/rdf and populates Redis database 5 with the counter values.