INCATools / INCATools/kgcl

Unify handling of labels in place of CURIEs

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

Description

The intent of KGCL was to allow for human readable labels wherever IDs are used. Like in the Protege manchester renderer, these would be enclosed in single quotes.

E.g `add obsolete 'my bad term'`

([original doc](https://docs.google.com/document/d/1__7p64FOI5ZhiZ6F2TXtUc8JN1XXGwglOiVRrlg9G_c/edit))

This was always intended as a surface syntax feature - just like the OWLAPI doesn't need to support use of quoted strings where it accepts URIs, neither should KGCL. The idea was mappers could handle this before and after serializing.

Note the idea was that this should be done with caution - for guaranteed interpretability the same snapshot of the ontology should be used for label rendering.

The current implementation is a bit inconsistent. In the data model, some slots have shadow slots such as `about_node_representation` or `subject_type`. In some cases the renderer will look at these and use these

https://github.com/INCATools/kgcl/blob/8a62f0e55405ccb797faddb55f4ae47195898a45/src/kgcl_schema/grammar/render_operations.py#L89-L101

In other cases it's hardwired to always use uri/curie

https://github.com/INCATools/kgcl/blob/8a62f0e55405ccb797faddb55f4ae47195898a45/src/kgcl_schema/grammar/render_operations.py#L142-L144

I think these additional shadow slots pollute the model, we should remove these.

we can go back to the original idea of doing this at the time of DSL rendering. But there may also be use cases for preserving the "deferred dereferencing" in yaml/json serializations, and in the object model.

This would involve weakening the range constraint to string and allowing:

```
type: NodeObsoletion
about_node: "'my bad term'"
```

I think this is a bad decision from the point of view of KGCL behaving like a representation of diffs on the side of the ontology. But if KGCL is a language for representing things from the side of the user (more like the UI model in Protege) then this is defensible.

Contributor guide

Open the contributing guide

Research direction

Start with src/kgcl_schema/grammar/render_operations.py, especially the linked sections around lines 89-101 and 142-144, then review the data model's shadow slots and the original design document. Resolve whether label handling belongs only in DSL rendering or also in YAML/JSON and the object model, and remove or retain shadow slots consistently once that policy is decided.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.