SED-ML / KiSAO

Ontology of algorithms for analyzing biological models, their parameters, and their outputs
Artistic License 2.0
9 stars 0 forks source link

Some KISAO terms fail lookup with `get_normalized_id` #98

Closed matthiaskoenig closed 2 years ago

matthiaskoenig commented 3 years ago

The following term ids fail lookup when iterating over all term_ids using the get_normalized_id function:

for term_id in kisao._ontology:
        if "KISAO#_KISAO_" in term_id:
            # logger.warning(f"Incorrect kisao id: {term_id}")
            print(term_id)
            continue
        try:
            kisao_id = kisao_ontology.get_normalized_id(term_id.split('#')[1], dialect=IdDialect.kisao)
        except (KeyError, ValueError) as err:
            print(f"Missing entries: {term_id}")
            print(err)

Results in:

Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000245
No KiSAO term has the id `KISAO_0000245`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000246
No KiSAO term has the id `KISAO_0000246`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000250
No KiSAO term has the id `KISAO_0000250`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000259
No KiSAO term has the id `KISAO_0000259`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000268
No KiSAO term has the id `KISAO_0000268`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000359
No KiSAO term has the id `KISAO_0000359`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000360
No KiSAO term has the id `KISAO_0000360`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000361
No KiSAO term has the id `KISAO_0000361`.
Missing entries: http://www.biomodels.net/kisao/KISAO#KISAO_0000399
No KiSAO term has the id `KISAO_0000399`.
jonrkarr commented 3 years ago

I'll have to look into this.

This is surprising. I'm just using a library that can parse OWL files. I don't know why it wouldn't be able to find some terms.

jonrkarr commented 3 years ago

I can't reproduce this issue with pronto 2.4.1/2.4.2 and python 3.9.5.

I corrected the code above and added as a unit test: libkisao/python/tests/test_ontology.py:test_term_ids_are_normalizable.

jonrkarr commented 2 years ago

Closing because there were errors in the original post and testing checks that all terms can be found.