Annotations not updated when a tag is renamed
Describe the bug I had a tagset, with four label names. I changed the name of one of the labels. But instead of renaming with the new name all the annotation that had this label, it created a new label with the new, while letting the older label (and its name) as is: it is still in the tagset list, and the annotation still have the older name. I had this problem in a sentence classification task.
To Reproduce The description should be enough to reproduce the bug.
Expected behavior I would expect the older label name to disappear in the tagset and be replaced by the new name. I would also expect the sentences annotated with the former label name have the new name over them.
Screenshots None.
Please complete the following information:
- Version and build ID: 20.0 (2021-07-26 22:05:55, build 18e61d40)
- OS: Linux Ubuntu
- Browser: Firefox
Additional context None.
Renaming tags has no effect on existing annotations - that is correct. The workaround for this is modelling the tagset as a knowledge base. In a KB, you can always change the label. Although, changing the label also only changes how the annotation is shown in the UI - in the actual annotation data, the concept IRI is used and that again cannot be changed.
Updating all occurrences of a tag in the annotated data when the user changes a tag would be a very big operation. And also there would be other considerations to take such as:
- What happens if a tag is deleted from the tagset? Would it mean that the tag is removed from all annotations? Or would the entire annotations be removed?
- What happens if the user unassigns a tagset from a feature - would it remove all the tags from existing annotations as well?
- What happens if a user assigns a tagset to a feature which for which there are already annotations that contain a tag which is not in the tagset?
I think the ideal would be to have a kind of 'migration UI' for the cases you detailed, which would include warnings and show the implied changes.
But what I talk about is just changing the displayed name of one tag, not removing the tag from the annotated sentences. I don't know (yet ;) ) how these are stored in the DB, but maybe we should have a displayed name column for the tags, that can change.
The tags are stored "as is" in the data - by their actual name. There is no indirection.
The KB entries are stored by their ID - so here is an indirection where you can change the label that is displayed without having to update all the data.