Skip to content

Unify handling of labels in place of CURIEs #82

@cmungall

Description

@cmungall

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions