INCATools / INCATools/ontology-access-kit

oaklib fails to import with linkml-runtime 1.10.0: Format.JSON removed

Open Beginner friendly
#867 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
198
Forks
35
Avg merge
3d 4h
Merged PRs (30d)
1

Description

## Description

Fresh install of `oaklib` via `uv tool install oaklib` fails on import due to a version skew between `linkml` 1.9.3 and `linkml-runtime` 1.10.0.

## Error

```
AttributeError: type object 'Format' has no attribute 'JSON'. Did you mean: 'JSONLD'?
```

Full traceback:

```
File "/lib/python3.12/site-packages/oaklib/__init__.py", line 8, in
from oaklib.interfaces import BasicOntologyInterface
File "/lib/python3.12/site-packages/oaklib/interfaces/__init__.py", line 1, in
from oaklib.interfaces.basic_ontology_interface import BasicOntologyInterface
File "/lib/python3.12/site-packages/oaklib/interfaces/basic_ontology_interface.py", line 14, in
from sssom.parsers import parse_sssom_table, to_mapping_set_document
File "/lib/python3.12/site-packages/sssom/__init__.py", line 13, in
from sssom.io import get_metadata_and_prefix_map
File "/lib/python3.12/site-packages/sssom/io.py", line 18, in
from linkml.validator import ValidationReport
File "/lib/python3.12/site-packages/linkml/__init__.py", line 32, in
LOCAL_METAMODEL_JSONLD_FILE = linkml_files.LOCAL_PATH_FOR(Source.META, Format.JSON)
AttributeError: type object 'Format' has no attribute 'JSON'. Did you mean: 'JSONLD'?
```

## Cause

`linkml-runtime` 1.10.0 removed or renamed `Format.JSON` from its enum, but `linkml` 1.9.3 still references it in `__init__.py`. When pip/uv resolves dependencies, it picks up the incompatible combination.

Related: linkml/linkml#3241 (same root cause — linkml/linkml-runtime version skew)

## Workaround

Pin `linkml-runtime<1.10.0`:

```bash
uv tool install oaklib --with "linkml-runtime<1.10.0"
# or
pip install oaklib "linkml-runtime<1.10.0"
```

## Suggested fix

Add an upper bound on `linkml-runtime` in oaklib's dependencies (or in sssom/linkml) until linkml releases a version compatible with linkml-runtime 1.10.0.

## Environment

- oaklib: latest (via `uv tool install oaklib`)
- linkml: 1.9.3
- linkml-runtime: 1.10.0
- Python: 3.12
- OS: Ubuntu (DigitalOcean droplet)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with a fresh `uv tool install oaklib` and inspect the import path through `oaklib/__init__.py` and `linkml/__init__.py`. Check oaklib's dependency declarations for the linkml-runtime constraint, then verify that a fresh install imports successfully without the `Format.JSON` error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.