Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running lexical match script #15

Closed
pfabry opened this issue Feb 29, 2024 · 1 comment
Closed

Error while running lexical match script #15

pfabry opened this issue Feb 29, 2024 · 1 comment

Comments

@pfabry
Copy link

pfabry commented Feb 29, 2024

When running the lexical match script described here: https://github.com/biopragmatics/biolexica/tree/main/lexica/obo#readme I've encountered the following error:

KeyError                                  Traceback (most recent call last)
Cell In[13], line 26
     24 for graph in data['graphs']:
     25     for node in sorted(graph['nodes'], key=lambda n: n['id']):
---> 26         if node['type'] == "PROPERTY":
     27             continue
     28         uri = node['id']

KeyError: 'type'

It seems that when loading the json file, the script can't create a dictionnary for the nodes. It happened for now with just one file (gallont.json) while another file (lsdao.json) has been processed without any problem. Both files have been generated with ROBOT convert function.

@cthoyt
Copy link
Member

cthoyt commented Mar 12, 2024

Hi @pfabry, this script was written under the impression that all valid OBO Graph JSON files contain a type in each node. This script is meant as an example that can be adapted for purpose, but I will add an update that removes this check completely (there aren't so many properties to worry about)

@cthoyt cthoyt closed this as completed in 7988416 Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants