forked from orinoco/query-things
Query and export implementations for the RSE group data model from https://concepts.datalad.org/s/demo-rse-group
- Python 100%
The `--record-cache` argument in `inject_links_pid` was available but the cache was never used by the command. Given that this command normally requests records to be looked up from the Pool by class (not by single PID) it is not obvious what a full implementation of cache should look like (commands which fetch one PID at a time can consult cache first and API only if not cached). This commit adds partial, but hopefully intuitive cache handling. If the option `--only-from-cache` is given, then no requests to the API will be made; instead, all cached records (and cached records only) will be scanned, filtered by class name (if requested), checked whether they link the given object, and injected. No writing to cache is done. If the `--only-from-cache` option is not used, the cache is ignored (as previously). This "inject from cache" was motivated by the following use case: extending Person records with their Project roles. This can be done as follows: Fetch project records, inline `associated_with::roles`, save in cache, then run inject-links-pid --only-from-cache to inject projects with roles inlined (inline-records currently can't deal with nested properties). |
||
|---|---|---|
| query_rse_group | ||
| .changelog.md.j2 | ||
| .gitignore | ||
| pyproject.toml | ||
| README.md | ||