INCATools / INCATools/kgcl

The grammar should return clean objects

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
23
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Currently the grammar yields linkml instances like:

```python
NodeRename(id='CHANGE:001', type='NodeRename', ...,` old_value=Token('SINGLE_QUOTE_LITERAL', "'nuclear envelope'"), new_value=Token('SINGLE_QUOTE_LITERAL', "'foo bar'")`
```

No need for this

Also the rendered json is:

```json
{
"id": "CHANGE:001",
"type": "NodeRename",
"old_value": "'nuclear envelope'",
"new_value": "'foo bar'",
"about_node": "GO:0005635",
"about_node_representation": "curie",
"@type": "NodeRename"
}
```

The single quotes are not necessary. It's already a string field.

Currently downstream code such as OAK has a workaround for this:

https://github.com/INCATools/ontology-access-kit/blob/8da76e19698058b43c4ae4ba2b5bcda35a1c851a/src/oaklib/utilities/kgcl_utilities.py#L99-L123

In theory this should still work with clean code but we should still wait until 1.0.0

Contributor guide

Open the contributing guide

Research direction

Locate the Python grammar or parser entry point that creates the shown LinkML NodeRename instance, then reproduce the example. Use the OAK workaround linked in the issue as a compatibility reference and verify that parsed values and rendered JSON no longer contain Token wrappers or unnecessary quote characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.