You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @caufieldjh! I have recently upgraded ontoGPT to its latest version. I've encountered an issue while executing commands such as “ontogpt extract -t gene_protein -i abstract_geneProtein.txt” which results in the following error message:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/ontogpt", line 8, in
sys.exit(main())
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/cli.py", line 336, in extract
results = ke.extract_from_text(text=text, cls=target_class_def, show_prompt=show_prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 97, in extract_from_text
extracted_object = self.parse_completion_payload(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 559, in parse_completion_payload
return self.ground_annotation_object(raw, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 629, in ground_annotation_object
obj = self.ground_annotation_object(val, rng_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 631, in ground_annotation_object
obj = self.normalize_named_entity(val, slot.range) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/knowledge_engine.py", line 352, in normalize_named_entity
for normalized_id in self.normalize_identifier(obj_id, cls):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/knowledge_engine.py", line 416, in normalize_identifier
for obj_id in self.map_identifier(input_id, cls):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/knowledge_engine.py", line 449, in map_identifier
for mapping in mapper.sssom_mappings([input_id]):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/oaklib/implementations/translator/translator_implementation.py", line 62, in sssom_mappings
equiv_identifiers = data.get("equivalent_identifiers", [])
^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
Hi @emanuelecavalleri - this is a bug in oaklib that got fixed here: INCATools/ontology-access-kit#663 , but hasn't made it into a released version of that package yet.
In the meantime, there's an easy fix:
Open oaklib's translator_implementation.py (so on your system, "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/oaklib/implementations/translator/translator_implementation.py") with your choice of editor and find the line beginning with NODE_NORMALIZER_ENDPOINT.
It should be around line 26.
In the URL in that line, change the "1.3" to "1.4" so the line then reads:
Hello @caufieldjh! I have recently upgraded ontoGPT to its latest version. I've encountered an issue while executing commands such as “ontogpt extract -t gene_protein -i abstract_geneProtein.txt” which results in the following error message:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/ontogpt", line 8, in
sys.exit(main())
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/cli.py", line 336, in extract
results = ke.extract_from_text(text=text, cls=target_class_def, show_prompt=show_prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 97, in extract_from_text
extracted_object = self.parse_completion_payload(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 559, in parse_completion_payload
return self.ground_annotation_object(raw, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 629, in ground_annotation_object
obj = self.ground_annotation_object(val, rng_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/spires_engine.py", line 631, in ground_annotation_object
obj = self.normalize_named_entity(val, slot.range) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/knowledge_engine.py", line 352, in normalize_named_entity
for normalized_id in self.normalize_identifier(obj_id, cls):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/knowledge_engine.py", line 416, in normalize_identifier
for obj_id in self.map_identifier(input_id, cls):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ontogpt/engines/knowledge_engine.py", line 449, in map_identifier
for mapping in mapper.sssom_mappings([input_id]):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/oaklib/implementations/translator/translator_implementation.py", line 62, in sssom_mappings
equiv_identifiers = data.get("equivalent_identifiers", [])
^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
Package Versions:
ontogpt: 0.3.3
oaklib: 0.5.20
sssom: 0.3.41
Thanks in advance!
Emanuele
The text was updated successfully, but these errors were encountered: