Task #5785 (closed)
Opened 13 years ago
Closed 13 years ago
BUG: loadTagSets return AnnotationAnnotationLinkI
Reported by: | atarkowska | Owned by: | jburel |
---|---|---|---|
Priority: | blocker | Milestone: | OMERO-Beta4.3 |
Component: | Services | Version: | n.a. |
Keywords: | n.a. | Cc: | jburel, jamoore, cxallan |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2011-06-16 (14) |
Description (last modified by atarkowska)
loadTagSet return AnnotationAnnotationLinkI rather then AnnotationI. It complicate to build hierarchy because everything is returned separately. Currently omero.gateway lazy loading approch does not allow to use wrap the implementation. It should return hierarchy of:
- TagAnnotationI (tagset)
- TagAnnotationI (tag1)
- TagAnnotationI (tag2)
- TagAnnotationI (tag3)
...
Change History (10)
comment:1 Changed 13 years ago by atarkowska
- Component changed from General to Services
- Description modified (diff)
- Priority changed from minor to blocker
comment:2 Changed 13 years ago by atarkowska
- Cc jburel jmoore cxallan added
- Owner jmoore deleted
comment:3 Changed 13 years ago by jmoore
- Owner set to jburel
comment:4 Changed 13 years ago by jburel
Looking closely at the code we have 2 possibilities:
- actual implementation:A collection of objects (tag annotation or link) is returned
- tag if orphaned
- AnnotationAnnotationLink object so we can extract the tag set linked to the tags i.e. displaying a hierarchical structure from a flat structure
link = (AnnotationAnnotationLink) object; parent = link.getParent(); child = link.getChild(); id = parent.getId().getValue(); if (sets.get(id) == null) { tagSet = new TagAnnotationData((TagAnnotation) parent); sets.put(id, tagSet); result.add(tagSet); tagSet.setTags(new HashSet<TagAnnotationData>()); } else tagSet = sets.get(parent.getId().getValue());
- Change the method and return a map
- key are tag or tag Set
- If it is a tag Set, the value is a list containing tag object.
The first option was chosen to mimic the returned value of loadContainerHierarchy method in ContainerService
comment:5 Changed 13 years ago by atarkowska
I do not see any problems with returning TagAnnotationI and AnnotationAnnotationLinkI list but the problem is that List should contain single AnnotationAnnotationLinkI where Parent is TagSet? and children are tags. Having structure in graph will help a lot.
Currently is see:
<class 'omero.model.AnnotationAnnotationLinkI'> parent 8902 child 6591 <class 'omero.model.AnnotationAnnotationLinkI'> parent 8902 child 8905
comment:6 Changed 13 years ago by jburel
we will use linkedAnnotationList()
comment:7 Changed 13 years ago by atarkowska
We could change the query to:
sql = "select roottag from TagAnnotation as roottag "\ "left outer join fetch roottag.annotationLinks tal "\ "left outer join fetch tal.child tag "\ "left outer join fetch roottag.details.owner ownerroottag "\ "left outer join fetch tag.details.owner ownerTag " if eid is not None: params.map = {} params.map["eid"] = rlong(long(eid)) sql+=" where roottag.details.owner.id = :eid and tag.details.owner.id = :eid"
comment:8 Changed 13 years ago by jburel
Query will be a bit more complicated than that, I will review that later on.
comment:9 Changed 13 years ago by jburel
- Remaining Time set to 0.4
- Status changed from new to accepted
TODO:
- Change method
- Check tests
- modify insight
comment:10 Changed 13 years ago by jburel <j.burel@…>
- Remaining Time changed from 0.4 to 0
- Resolution set to fixed
- Status changed from accepted to closed
(In [24c693aee63b618267f38a3c3f92faa340c27c55/ome.git] on branch develop) Modify the implementation of the loadTagSets mehtod in medataservice.
Now only returned tagAnnotation objects. (close #5785)
Methods were added by J-M:
Passing to him to see what he thinks about the change.