Skip to content

Store semantic_types as a Redis SET instead of a LIST #379

Description

@gaurav

The loader's merge_semantic_meta_data LPUSHes into the semantic_types key, and because that function runs once per loader Kubernetes Job (mode: load shards one Job per file), the list ends up with one copy of every type per file — dozens of duplicates.

The frontend papers over this by deduping on read (get_semantic_types uses list(set(...)), and get_curie_prefixes now does the same as of the loader-reorg branch). The proper fix is to switch the key to a Redis SET (SADD in the loader, SMEMBERS in the frontend).

Why this is not a drop-in change: mode: restore loads pre-built RDB backups produced by the old loader, where semantic_types is a LIST. A new frontend doing SMEMBERS against a restored LIST gets WRONGTYPE, breaking /get_semantic_types and /get_curie_prefixes. This needs a coordinated loader + frontend + backup-regeneration rollout.

Context: documentation/Development.md (backlog section), node_normalizer/loader/loader.py merge_semantic_meta_data, node_normalizer/normalizer.py get_curie_prefixes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions