Commit 9bb872d
Add lookup() / related() high-level helpers and fresh() cache scope
Two new wrappers fold the common four-step pattern (resolve → relations
→ entities → join) into single calls. Both accept friendly id_type
aliases (``name``, ``chebi``, ``hmdb``, ``uniprot``, …) and pivot the
matching identifiers into named columns; ``related()`` does the
subject + object join and exposes filters by sources, predicates,
relation_categories, and participant_types (also aliased:
``protein``, ``small_molecule``, …). Multi-valued aliases pick the
shortest representative.
Also adds ``cache_clear()`` and a ``fresh()`` context manager: any
URL+payload first-touched inside the block is re-downloaded; later
identical requests in the same scope hit the freshly populated cache.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 20741d5 commit 9bb872d
4 files changed
Lines changed: 683 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
0 commit comments