Skip to content

Commit

Permalink
Update OBO lexical matching example
Browse files Browse the repository at this point in the history
Closes #15
  • Loading branch information
cthoyt committed Mar 12, 2024
1 parent edf0859 commit 7988416
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lexica/obo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ safe = []
print("## Lexical matching returned results\n")
for graph in data['graphs']:
for node in sorted(graph['nodes'], key=lambda n: n['id']):
if node['type'] == "PROPERTY":
continue
uri = node['id']
if not uri.startswith(obo_uri_prefix):
continue

# Skip nodes without a label
name = node.get('lbl')
if not name:
continue

identifier = uri[len(obo_uri_prefix) :]
name = node['lbl']

results = []
results.extend(grounder.ground(name))
Expand Down

0 comments on commit 7988416

Please sign in to comment.