Skip to content

Error when running obo-lexical-review: AttributeError: 'NoneType' object has no attribute 'strip' #491

Description

@pfabry

When using the obo-lexical-review function with the following commad:

PS C:\Users\XXX> uv run --with "pyobo[gilda]" pyobo obo-lexical-review VariO --location "C:\localPathtoOntology\VariO_1.09.owl" --skip-upper

I get the following error message:

Inferred URI prefix from given OBO CURIE prefix: http://purl.obolibrary.org/obo/VariO_
given ontology path does not end with JSON. implicitly converting to OBO Graph JSON using ROBOT
reading converted OBO Graph JSON
Loading lexical index from https://github.com/biopragmatics/biolexica/raw/main/lexica/obo/obo.ssslm.tsv.gz using SSSLM
Done loading lexical index
  0%|                                                                                         | 0/1 [00:00<?, ?graph/s]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\XXX\.venv\Scripts\pyobo.exe\__main__.py", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Users\XXX\.venv\Lib\site-packages\click\core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\XXX\.venv\Lib\site-packages\click\core.py", line 1406, in main
    rv = self.invoke(ctx)
  File "C:\Users\XXX\.venv\Lib\site-packages\click\core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\XXX\.venv\Lib\site-packages\click\core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXX\.venv\Lib\site-packages\click\core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\XXX\.venv\Lib\site-packages\pyobo\cli\obo_lexical_review.py", line 78, in obo_lexical_review
    passed, failed = _get_calls(
                     ~~~~~~~~~~^
        graph_document=graph_document,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        skip_upper=skip_upper,
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\XXX\.venv\Lib\site-packages\pyobo\cli\obo_lexical_review.py", line 187, in _get_calls
    matches.extend(
    ~~~~~~~~~~~~~~^
        match
        ^^^^^
        for synonym in node.meta.synonyms
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        for match in matcher.get_matches(synonym.val)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\XXX\.venv\Lib\site-packages\pyobo\cli\obo_lexical_review.py", line 190, in <genexpr>
    for match in matcher.get_matches(synonym.val)
                 ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "C:\Users\XXX\.venv\Lib\site-packages\ssslm\ner.py", line 574, in get_matches
    for scored_match in self._grounder.ground(
                        ~~~~~~~~~~~~~~~~~~~~~^
        text, context=context, organisms=organisms, namespaces=namespaces
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\XXX\.venv\Lib\site-packages\gilda\grounder.py", line 280, in ground
    raw_str = raw_str.strip()
              ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions