INCATools / INCATools/ontology-access-kit

Bioportal mappings fail with `AttributeError`

Open
#844 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
198
Forks
35
Avg merge
3d 4h
Merged PRs (30d)
1

Description

Running the `mappings` command with `bioportal` results in an `AttributeError`.
This includes the examples in the docs: https://incatools.github.io/ontology-access-kit/examples/Command-Line-Examples.html#BioPortal

On a fresh install:
```bash
$ pipx install oaklib
installed package oaklib 0.6.23, installed using Python 3.12.3
These apps are now globally available
- boomerang
- runoak
- vskit
done! ✨ 🌟 ✨
```
```
$ runoak -vvv -i bioportal: mappings CTENO:0000018 -O sssom
/home/harry/.local/share/pipx/venvs/oaklib/lib/python3.12/site-packages/eutils/__init__.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
INFO:root:Setting other_languages=()
INFO:root:Settings = Settings(impl=None, autosave=False, associations_type=None, preferred_language=None, other_languages=())
INFO:root:API KEY path = /home/harry/.config/ontology-access-kit/bioportal-apikey.txt
INFO:root:Fetching mappings for ('CTENO:0000018',)
DEBUG:root:Query terms: ['CTENO:0000018']
DEBUG:root:CURIE: CTENO:0000018
AttributeError: module 'collections' has no attribute 'Iterable'
```

The semsql version does not produce this error (though there are no mappings in this case):
```
$ runoak -vvv -i sqlite:obo:cteno mappings CTENO:0000018 -O sssom
/home/harry/.local/share/pipx/venvs/oaklib/lib/python3.12/site-packages/eutils/__init__.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
INFO:root:Setting other_languages=()
INFO:root:Settings = Settings(impl=None, autosave=False, associations_type=None, preferred_language=None, other_languages=())
INFO:root:Locator: obo:cteno
INFO:root:Ensuring gunzipped for https://s3.amazonaws.com/bbop-sqlite/cteno.db.gz
INFO:root:Locator, post-processed: sqlite:////home/harry/.data/oaklib/cteno.db
INFO:root:Fetching mappings for ('CTENO:0000018',)
DEBUG:root:Query terms: ['CTENO:0000018']
DEBUG:root:CURIE: CTENO:0000018
INFO:sqlalchemy.engine.Engine:BEGIN (implicit)
INFO:sqlalchemy.engine.Engine:SELECT statements.subject AS statements_subject, statements.predicate AS statements_predicate, statements.object AS statements_object, statements.value AS statements_value, statements.datatype AS statements_datatype, statements.language AS statements_language
FROM statements
WHERE statements.predicate IN (?, ?, ?, ?, ?, ?, ?) AND statements.subject IN (?)
INFO:sqlalchemy.engine.Engine:[generated in 0.00022s] ('skos:broadMatch', 'skos:narrowMatch', 'skos:closeMatch', 'skos:exactMatch', 'skos:relatedMatch', 'oio:hasDbXref', 'owl:sameAs', 'CTENO:0000018')
INFO:sqlalchemy.engine.Engine:SELECT statements.subject AS statements_subject, statements.predicate AS statements_predicate, statements.object AS statements_object, statements.value AS statements_value, statements.datatype AS statements_datatype, statements.language AS statements_language
FROM statements
WHERE statements.predicate IN (?, ?, ?, ?, ?, ?, ?) AND statements.value IN (?)
INFO:sqlalchemy.engine.Engine:[generated in 0.00027s] ('skos:broadMatch', 'skos:narrowMatch', 'skos:closeMatch', 'skos:exactMatch', 'skos:relatedMatch', 'oio:hasDbXref', 'owl:sameAs', 'CTENO:0000018')
INFO:sqlalchemy.engine.Engine:SELECT statements.subject AS statements_subject, statements.predicate AS statements_predicate, statements.object AS statements_object, statements.value AS statements_value, statements.datatype AS statements_datatype, statements.language AS statements_language
FROM statements
WHERE statements.predicate IN (?, ?, ?, ?, ?, ?, ?) AND statements.object IN (?)
INFO:sqlalchemy.engine.Engine:[generated in 0.00016s] ('skos:broadMatch', 'skos:narrowMatch', 'skos:closeMatch', 'skos:exactMatch', 'skos:relatedMatch', 'oio:hasDbXref', 'owl:sameAs', 'CTENO:0000018')
INFO:sqlalchemy.engine.Engine:SELECT prefix.prefix AS prefix_prefix, prefix.base AS prefix_base
FROM prefix
INFO:sqlalchemy.engine.Engine:[generated in 0.00013s] ()
# curie_map:
# owl: http://www.w3.org/2002/07/owl#
# rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
# rdfs: http://www.w3.org/2000/01/rdf-schema#
# semapv: https://w3id.org/semapv/vocab/
# skos: http://www.w3.org/2004/02/skos/core#
# sssom: https://w3id.org/sssom/
# license: https://w3id.org/sssom/license/unspecified
# mapping_set_id: https://w3id.org/sssom/mappings/13a8f939-a8ed-483a-95bf-74c1ab58ac64
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the documented `runoak -i bioportal: mappings CTENO:0000018 -O sssom` command under Python 3.12 and trace the `collections.Iterable` error through the BioPortal mappings path. Done means the command completes without this AttributeError and the BioPortal example in the linked documentation works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.