Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
0f5400b
This initializes a uv package in this repository.
gaurav Dec 2, 2025
d3ffc97
Added basic CLI.
gaurav Dec 2, 2025
c2ff184
Add /data to the .gitignore.
gaurav Dec 2, 2025
e238b8b
Initial implementation of a basic xref query-er.
gaurav Dec 3, 2025
18479d6
Added a method to look up a particular identifier.
gaurav Dec 4, 2025
7317bfb
Added CURIE expansion/recursive lookup.
gaurav Dec 4, 2025
642dd21
Added a basic ConcordTester.
gaurav Dec 4, 2025
75db5b2
Added labels via NodeNorm.
gaurav Dec 4, 2025
eddd497
Midnight commit: attempting to improve expansion.
gaurav Jan 8, 2026
3a55a23
Added some improvements.
gaurav Jan 8, 2026
e45e2f0
Added a CLAUDE.md by Claude.ai.
gaurav Feb 14, 2026
46e829f
Reorganized file slightly.
gaurav Feb 14, 2026
0fb11c5
Claude wrote some tests.
gaurav Feb 14, 2026
7876189
Improved downloader using Claude.
gaurav Feb 14, 2026
f3d6e52
Added MD5 download functionality.
gaurav Feb 14, 2026
76907ba
Removed empty model file.
gaurav Feb 15, 2026
8e3ba7c
Attempted to rename this package to babel-explorer.
gaurav Feb 15, 2026
cf3394d
Add comprehensive pytest suite for all core modules
gaurav Feb 15, 2026
26f217c
Merge branch 'main' into basic-implementation-in-uv
gaurav Feb 17, 2026
7950034
Added uv.lock (not sure why it wasn't added previously).
gaurav Mar 2, 2026
47535d3
Update CLAUDE.md
gaurav Mar 2, 2026
a0719fa
Update pyproject.toml
gaurav Mar 2, 2026
ab67878
Update src/babel_explorer/core/babel_xrefs.py
gaurav Mar 2, 2026
96523ca
Update src/babel_explorer/core/nodenorm.py
gaurav Mar 2, 2026
bf11732
Replace MD5 checksumming with HTTP header caching and freshness window
gaurav Mar 2, 2026
d983de5
Added some CURIEs to test.
gaurav Mar 3, 2026
93086b1
Partially changed --expand to --recurse.
gaurav Mar 3, 2026
d374760
More fully changed --expand to --recurse.
gaurav Mar 3, 2026
26b6f9d
Add pytest-xdist for parallel test execution
gaurav Mar 3, 2026
bb756cf
Replace Python recursion in get_curie_xrefs with DuckDB WITH RECURSIVE
gaurav Mar 3, 2026
e7ca380
Fix xdist race condition: skip test-data cleanup in parallel runs
gaurav Mar 3, 2026
4c3870b
Made output a bit prettier.
gaurav Mar 3, 2026
1cc5c7b
Update src/babel_explorer/core/nodenorm.py
gaurav Mar 16, 2026
d1ec8fe
Simplify babel_xrefs: extract helper, remove dead fetches, fix defaul…
gaurav Mar 16, 2026
ed1a27d
Fix LabeledCrossReference: make it a frozen dataclass subclass
gaurav Mar 16, 2026
afd722d
Fix BabelDownloader: use tempfile.gettempdir() when local_path is None
gaurav Mar 16, 2026
26cef00
Fix test-concord: guard against None from get_clique_identifiers
gaurav Mar 16, 2026
bdceca8
Potential fix for pull request finding
gaurav Mar 16, 2026
2f439bc
Potential fix for pull request finding
gaurav Mar 16, 2026
612e1ce
Potential fix for pull request finding
gaurav Mar 16, 2026
52075ca
Potential fix for pull request finding
gaurav Mar 16, 2026
59c2c3c
Potential fix for pull request finding
gaurav Mar 16, 2026
f2677fd
Potential fix for pull request finding
gaurav Mar 16, 2026
f1c2857
Potential fix for pull request finding
gaurav Mar 16, 2026
dd194e9
Fix DuckDB connection leaks by using context managers
gaurav Mar 16, 2026
cafe303
Fix and simplify test mocks for context manager protocol
gaurav Mar 16, 2026
45250ab
Add configurable HTTP timeout to NodeNorm and BabelDownloader
gaurav Mar 16, 2026
7d67f00
Fix _etag_matches docstring to match actual behavior
gaurav Mar 16, 2026
597ab30
Got rid of ignore_curies_in_expansion, which is no longer used.
gaurav Mar 16, 2026
ab0aa33
Add ruff CI and fix all lint errors
gaurav Mar 16, 2026
ae8a424
Rename lint workflow to CI and add unit test job
gaurav Mar 16, 2026
5a5f00e
Improved documentation.
gaurav Mar 16, 2026
b7a3f93
Add tests for parse_duration() in cli.py
gaurav Mar 16, 2026
54b6c5b
Add CliRunner tests for xrefs, ids, and test-concord commands
gaurav Mar 16, 2026
1ce6428
Reformatted code with ruff.
gaurav Mar 26, 2026
f54561a
Update src/babel_explorer/cli.py
gaurav Mar 30, 2026
4481350
Cache get_identifier() locals in _to_labeled_xref; root-anchor lib/ i…
gaurav Mar 30, 2026
43a004d
Fix bugs and gaps identified in PR #1 code review
gaurav Mar 30, 2026
6d2eb1f
Run integration tests on push to master and weekly on Tuesdays
gaurav Mar 30, 2026
e3d3434
Add module, class, and method docstrings to new files in PR #1
gaurav Mar 30, 2026
807bfb2
Fix LabeledCrossReference biolink_type fields to list[str]; simplify …
gaurav Apr 1, 2026
06c3833
Address PR #1 review: frozen Identifier, atomic rename, fail-open HEA…
gaurav Apr 1, 2026
14fe2eb
Sync CLAUDE.md with current code
gaurav Apr 1, 2026
6f5dcfa
Merge branch 'basic-implementation-in-uv' of github.com:TranslatorSRI…
gaurav Apr 1, 2026
7d8faa8
Address PR #1 review: fix six correctness and quality issues
gaurav Apr 1, 2026
0607e00
Add --format [text|json|tsv|csv] option to all CLI commands
gaurav Apr 9, 2026
0761033
Add console format with rich color highlighting; replace text default
gaurav Apr 9, 2026
859c279
Fix Identifier.from_dict splitting string fields into characters
gaurav Apr 9, 2026
23532d5
Deduplicate CLI options and centralise logging setup
gaurav May 17, 2026
92f48e8
Simplify core query and normalisation logic
gaurav May 17, 2026
be2d865
Clean up downloader: fix redundant check, remove noisy comments
gaurav May 17, 2026
d614af1
Fix lru_cache memory leak and IN-parameter query in BabelXRefs
gaurav May 17, 2026
f1a8532
Fix urljoin silently stripping path segments in BabelDownloader
gaurav May 17, 2026
e899a21
Delete unintentional src/__init__.py
gaurav May 17, 2026
c63c47a
Housekeeping: trailing newline, empty test init, FUTURE.md → issues
gaurav May 17, 2026
dda0549
Apply ruff formatting to cli, formatting, and test files
gaurav May 17, 2026
6576fa7
Potential fix for pull request finding
gaurav May 18, 2026
8a49cad
Potential fix for pull request finding
gaurav May 18, 2026
d1badf4
Use read_parquet() inline in SQL instead of magic variable-name resol…
gaurav May 18, 2026
5ca6a26
Remove lru_cache from get_downloaded_file; fix timeout comment
gaurav May 18, 2026
aa1612e
Replace lru_cache with instance-level dict caches in NodeNorm
gaurav May 18, 2026
7f0dfb3
Add --paths flag and depth-based coloring for recursive xrefs
gaurav May 30, 2026
ef3cc2f
Prefix path edge lines with "- " for GitHub markdown list paste
gaurav May 30, 2026
87eca6e
Use double-quoted labels in all console output (CURIE "label")
gaurav May 30, 2026
ac04249
Omit label entirely when absent instead of showing empty placeholder
gaurav May 31, 2026
21770b8
Apply ruff formatting to babel_xrefs and formatting
gaurav Aug 14, 2026
1b48c7a
Detect the Babel release behind a server URL and pin the cache to it
gaurav Aug 14, 2026
ec43b98
Read Babel and NodeNorm URLs from .env instead of hardcoding them
gaurav Aug 14, 2026
233630c
Document .env configuration and Babel version handling
gaurav Aug 14, 2026
6e97ebc
Configure ruff lint rules and apply the resulting fixes
gaurav Aug 14, 2026
ba84b9d
Annotate ruff failures on the PR diff and document the pre-commit step
gaurav Aug 14, 2026
ac9a0e6
Delete the unused BabelDownloader.get_output_file
gaurav Aug 14, 2026
189b29e
Cover NodeNorm version lookup, missing-file reporting and refresh sco…
gaurav Aug 14, 2026
6661266
Ignore .idea/
gaurav Aug 14, 2026
711d2f8
Remove the test data directory once all xdist workers have finished
gaurav Aug 14, 2026
f137b92
Reject --paths with non-console output formats
gaurav Aug 14, 2026
2f133b7
Add --labels to the ids command
gaurav Aug 14, 2026
1e81660
Render CURIE labels through a single formatting helper
gaurav Aug 14, 2026
d608957
Keep tabular output valid when records omit an absent label
gaurav Aug 14, 2026
27979b4
Batch NodeNorm lookups and Parquet scans
gaurav Aug 14, 2026
8effe1f
Simplify duration parsing and version caching
gaurav Aug 14, 2026
e18e8c6
Ignore node_modules/
gaurav Aug 14, 2026
5401fae
Skip the NodeNorm version check for --recurse
gaurav Aug 18, 2026
78c6e35
Stop the Babel label column from eating the NodeNorm one
gaurav Aug 18, 2026
3385e89
Normalise BABEL_URL before probing for Concord.parquet
gaurav Aug 18, 2026
a58fe6a
Make a Babel version change re-check rather than re-download
gaurav Aug 18, 2026
abd2df1
Document the cache refresh, version check and label field
gaurav Aug 18, 2026
f192ae4
Stop a partial or unverified download from becoming the cached Parquet
gaurav Aug 31, 2026
1a43d2f
Keep Identifiers.parquet's own label column in json/tsv/csv output
gaurav Aug 31, 2026
040db75
Document the partial-download rules
gaurav Aug 31, 2026
b55081f
Explain why a .tmp is deleted in two places
gaurav Sep 1, 2026
76ae040
Compose the Babel URL from a releases directory and a version
gaurav Sep 1, 2026
e1473e6
Rename .env.example to env.default and document the new settings
gaurav Sep 1, 2026
2cb4f73
Add package metadata and a changelog for the 0.1.0 release
gaurav Sep 1, 2026
37e9fac
Stop claiming "not slow" means no multi-gigabyte download
gaurav Sep 1, 2026
89dac95
Test that the committed config template cannot leak a private URL
gaurav Sep 1, 2026
f7ab3f7
Re-check cached Parquet files whenever the Babel release changes
gaurav Sep 1, 2026
9006a0d
Reject `xrefs --paths` with one CURIE before downloading Concord.parquet
gaurav Sep 1, 2026
99ccaf7
Report an unreachable NodeNorm as an error rather than a traceback
gaurav Sep 1, 2026
8eb7633
Spill DuckDB query temporaries into the cache dir, not the working di…
gaurav Sep 1, 2026
4d229c4
Describe the caching that exists, and stop counting tests in the chan…
gaurav Sep 1, 2026
8be1143
Never resume a download the server gave no validator for
gaurav Sep 1, 2026
892bc28
Give BabelXRefs a public cache reset the integration tests can call
gaurav Sep 1, 2026
1c3bc59
Derive the config template's expected settings from the CLI itself
gaurav Sep 1, 2026
ef2b673
Drop batched NodeNorm lookups from the future-work list
gaurav Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
push:
branches: [main]
schedule:
- cron: "0 17 * * 2" # Tuesdays at 12pm EST (17:00 UTC); 1pm during EDT
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv sync --group dev
# `uv run` uses the ruff pinned in uv.lock, so CI lints with the same version
# developers have locally. --output-format github annotates the PR diff inline.
# Paths come from [tool.ruff] in pyproject.toml rather than being repeated here.
- run: uv run ruff check --output-format github
- run: uv run ruff format --check

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv sync --group dev
- run: uv run pytest -v -m "not integration"

integration-test:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv sync --group dev
- run: uv run pytest -v -m "integration and not slow"
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Ignore data files.
/data

# Node dependencies, wherever they are installed (e.g. web/node_modules).
# Deliberately not /web, so frontend source under it is still tracked.
node_modules/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
Expand All @@ -14,8 +21,9 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
# Python distribution lib directories (not web/src/lib/)
/lib/
/lib64/
parts/
sdist/
var/
Expand Down Expand Up @@ -135,7 +143,11 @@ celerybeat.pid
*.sage.py

# Environments
# .env.* as well as .env: a .env.backup or .env.local holding the Translator-specific
# releases URL is exactly what must never be committed, and a blanket `git add` would
# take it. env.default does not match this pattern and stays tracked.
.env
.env.*
.envrc
.venv
env/
Expand Down Expand Up @@ -173,7 +185,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

All notable changes to babel-explorer are documented here. This project follows
[semantic versioning](https://semver.org/).

## 0.1.0 — 2026-09-01

First release. A Click CLI for querying Babel intermediate files through DuckDB, with optional
label enrichment from NodeNorm.

### Added

- `xrefs` — cross-references for one or more CURIEs, with `--recurse` for transitive expansion
(a single `WITH RECURSIVE` DuckDB query), `--paths` for the shortest paths connecting the given
CURIEs, and `--labels` for NodeNorm labels and Biolink types.
- `ids` — identifier records from `Identifiers.parquet`, with `--labels`.
- `test-concord` — compare a proposed concordance change against NodeNorm's current cliques.
- `--format json|tsv|csv` on `xrefs` and `ids` for machine-readable output.
- `BabelDownloader`: streaming downloads with ETag-based freshness checking, resumable retries,
and a cache that holds one Babel release at a time and refreshes itself when that release
changes.
- Configuration from `.env` or the environment — `BABEL_RELEASES_URL`, `BABEL_VERSION`,
`BABEL_LOCAL_DIR`, `BABEL_CHECK_DOWNLOAD`, `NODENORM_URL`, `BABEL_ALLOW_VERSION_MISMATCH` —
with `env.default` as the committed template. Precedence: flag > environment > `.env` > default.
- A version-skew check that refuses to mix labels from one Babel release with cross-references
from another, overridable with `--allow-version-mismatch`.

### Known limitations

- **The shipped defaults cannot query data yet.** Public Babel releases do not publish
`duckdb/Concord.parquet` or `duckdb/Identifiers.parquet`. Translator team members can set
`BABEL_RELEASES_URL` to an internal releases URL; everyone else gets a clear error rather than
results. Tracked in [#16](https://github.com/TranslatorSRI/babel-explorer/issues/16).
- **`--labels` fails against the public defaults.** NodeNorm dev reports Babel `2025sep1` while
public `latest` is `2025dec11`, so the skew check fires. Pin `BABEL_VERSION` to the release
NodeNorm was built from, or pass `--allow-version-mismatch`. Tracked in
[#17](https://github.com/TranslatorSRI/babel-explorer/issues/17).
- The integration tests skip without a Babel release publishing the Parquet files, so a default
run exercises only the unit suite. Tracked in
[#18](https://github.com/TranslatorSRI/babel-explorer/issues/18).
Loading
Loading