Skip to content

fix: read w3id namespaces from ids/ after upstream move - #84

Open
jdsika wants to merge 1 commit into
linkml:mainfrom
ASCS-eV:fix/w3id-ids-subtree
Open

jdsika wants to merge 1 commit into
linkml:mainfrom
ASCS-eV:fix/w3id-ids-subtree

Conversation

@jdsika

@jdsika jdsika commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On 2026-09-04 perma-id/w3id.org moved every namespace directory from the repository root into ids/ (upstream commit 94ed72fc, "Move hosted files and rules to ids/ directory."). The served URLs did not change: ids/kgcl/ still serves https://w3id.org/kgcl/.

from_w3id() still lists the root tree, so it now returns only docs, ids and tools instead of about 2,300 namespaces. As a result:

  • tests/test_etl/test_w3id.py fails with KeyError: 'kgcl'.
  • The next make etl, or a dispatch of the Refresh workflow (which commits and pushes), would silently overwrite w3id.csv with those three rows.

Change

  • List git/trees/master:ids instead of the root tree. The call works unauthenticated, returns 2,309 entries and is not truncated.
  • Check the HTTP status before parsing the JSON. The old error branch called results.message on a dict, so any non-200 response (an unauthenticated rate limit, or a 404 if ids/ ever moves) raised an AttributeError instead of a clear error. It now raises ValueError with the URL, status code and body.

This PR does not regenerate w3id.csv. The committed data is intact and matches upstream as of June 2026.

Verification

  • pytest tests/test_etl/test_w3id.py passes. The full suite passes locally.
  • The fixed ETL returns 2,295 prefixes, against 1,972 in the committed w3id.csv: 326 added and 3 gone. All three are real upstream changes:
    • cpp was deleted.
    • FAIRagro was renamed to fairagro.
    • linkedEarth was renamed to linkedearth.
  • Mocked 404 and 502 responses now raise ValueError with the status code and body.
  • flake8 with the tox -e flake8 plugin set and black --check -l 100 are clean.

On 2026-09-04 perma-id/w3id.org moved every namespace directory from
the repository root into ids/ (upstream commit 94ed72fc). from_w3id()
still listed the root tree, so it returned only docs, ids and tools.
A refresh would overwrite w3id.csv with those three rows, and
tests/test_etl/test_w3id.py fails with KeyError 'kgcl'.

List git/trees/master:ids instead. Also check the HTTP status before
parsing JSON. The old error branch called .message on a dict, which
turned any non-200 response (rate limit, or a future 404 if ids/
moves) into an AttributeError.

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
@jdsika

jdsika commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@amc-corey-cox this fixes the CI. The other PRs need rebasing after merge to turn green as well

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants