diff --git a/src/prefixmaps/ingest/ingest_w3id.py b/src/prefixmaps/ingest/ingest_w3id.py index 7a8bdf9..324bf20 100644 --- a/src/prefixmaps/ingest/ingest_w3id.py +++ b/src/prefixmaps/ingest/ingest_w3id.py @@ -2,21 +2,23 @@ from prefixmaps.datamodel.context import Context -API_LIST_CALL = "https://api.github.com/repos/perma-id/w3id.org/git/trees/master" +API_LIST_CALL = "https://api.github.com/repos/perma-id/w3id.org/git/trees/master:ids" def from_w3id() -> Context: """ Creates a Context from the https://github.com/perma-id/w3id.org/. + Each directory under ``ids/`` in that repository is served as ``https://w3id.org//``. + :return: """ import requests r = requests.get(API_LIST_CALL) - results = r.json() if r.status_code != 200: - raise ValueError(results.message) + raise ValueError(f"{API_LIST_CALL} returned {r.status_code}: {r.text}") + results = r.json() if results["truncated"]: raise ValueError("truncated results") ctxt = Context("w3id")