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)
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
|
if type(kgcl_instance) is NodeAnnotationChange: |
|
subject = render_entity( |
|
kgcl_instance.about_node, kgcl_instance.about_node_representation |
|
) |
|
predicate = render_entity( |
|
kgcl_instance.annotation_property, kgcl_instance.annotation_property_type |
|
) |
|
old_object = render_entity( |
|
kgcl_instance.old_value, kgcl_instance.old_value_type |
|
) |
|
new_object = render_entity( |
|
kgcl_instance.new_value, kgcl_instance.new_value_type |
|
) |
In other cases it's hardwired to always use uri/curie
|
if type(kgcl_instance) is NodeDeletion: |
|
subject = render_entity(kgcl_instance.about_node, "uri") |
|
return "delete " + subject |
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.
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)
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_representationorsubject_type. In some cases the renderer will look at these and use thesekgcl/src/kgcl_schema/grammar/render_operations.py
Lines 89 to 101 in 8a62f0e
In other cases it's hardwired to always use uri/curie
kgcl/src/kgcl_schema/grammar/render_operations.py
Lines 142 to 144 in 8a62f0e
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:
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.