INCATools / kgcl

Datamodel for KGCL (Knowledge Graph Change Language)
https://w3id.org/kgcl/
MIT License
11 stars 4 forks source link

The grammar should return clean objects #66

Open cmungall opened 7 months ago

cmungall commented 7 months ago

Currently the grammar yields linkml instances like:

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:

{
  "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