ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
22 stars 32 forks source link

BlitzGateway: Support linking annotations to other annotations #433

Open DavidStirling opened 4 days ago

DavidStirling commented 4 days ago

A user came across this issue when trying to programatically create TagAnnotations linked under a parent TagSet.

Currently the linkAnnotation function on the Blitz wrapper classes uses the OMERO_CLASS class variable to construct the link object name. Since Annotation wrapper subclasses do not define this variable the function errors out searching for NoneAnnotationLink.

It looks like setting OMERO_CLASS = "Annotation" would fix this particular scenario (we need an AnnotationAnnotationLink), but it's not clear to me if this would cause problems with other functionality in the wrapper.

will-moore commented 4 days ago

It makes sense that linkAnnotation() should work to create AnnotationAnnotationLinks.

Just searching for OMERO_CLASS finds this code that would need checking/updating: https://github.com/ome/omero-py/blob/master/src/omero/gateway/__init__.py#L3421

I seem to remember the Parent-Child direction of links in TagSet->Tag was not intuitive, but I may have this wrong. Is it tagset.linkAnnotation(tag) or would it be tag.linkAnnotation(tagset)?