-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify handling of labels in place of CURIEs #82
Comments
Personally, I believe allowing referencing terms by their label rather than by their ID is a bad idea. IDs exist for a reason. They are stable and non-ambiguous, contrary to labels. But if we are to allow that, I agree that it should be a “surface” feature of the DSL. So when parsing (going from the DSL representation to KGCL objects), resolving the labels should be done at parsing time, and once parsing is done, all that is left is the identifier of the resolved entity – the fact that the entity had been referenced by its label in the original instruction does not need to appear anywhere in the model. Conversely, when rendering (going from KGCL objects to DSL syntax, e.g. when displaying a diff), it's the responsibility of the renderer to maybe turn the identifiers present in the model into labels, if this is desired. Random thoughts:
Here I don’t follow. What would those use cases be? Allowing labels directly in the object model is the opposite of making the use of labels a “surface feature” only. This would force all code dealing with KGCL to handle the possibility that any ID could in fact be a label that must be resolved before use, instead of isolating that case in KGCL parsers/renderers. |
Support for using labels when identifiers would be expected is tentatively implemented in KGCL-Java in a separate branch. This is the “surface feature“ implementation, where everything is done in the parser. |
It just occurred to me that if we allow the use of labels when identifiers are expected, we can then solve the problem in #56 (allowing the creation of a new class without having to know its ID in advance) with a much more intuitive syntax. Instead of doing this (as proposed in #56, and currently supported in KGCL-Java):
we could do something like this:
All that would be required is to amend the syntax of the |
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
orsubject_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.
The text was updated successfully, but these errors were encountered: