Skip to content

Commit

Permalink
Link annotation objects
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmoore committed Jun 18, 2024
1 parent 598c354 commit 33599e3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/omero_rdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,16 @@ def descend(
handler.emit((pltid, DCTERMS.isPartOf, scrid))
handler.emit((scrid, DCTERMS.hasPart, pltid))
for annotation in scr.listAnnotations(None):
handler(annotation)
annid = handler(annotation)
handler.emit((annid, DCTERMS.isPartOf, scrid))
return scrid

elif isinstance(target, Plate):
plt = self._lookup(gateway, "Plate", target.id)
pltid = handler(plt)
for annotation in plt.listAnnotations(None):
handler(annotation)
annid = handler(annotation)
handler.emit((annid, DCTERMS.isPartOf, pltid))
for well in plt.listChildren():
wid = handler(well) # No descend
handler.emit((wid, DCTERMS.isPartOf, pltid))
Expand All @@ -410,7 +412,8 @@ def descend(
prj = self._lookup(gateway, "Project", target.id)
prjid = handler(prj)
for annotation in prj.listAnnotations(None):
handler(annotation)
annid = handler(annotation)
handler.emit((annid, DCTERMS.isPartOf, prjid))
for ds in prj.listChildren():
dsid = self.descend(gateway, ds._obj, handler)
handler.emit((dsid, DCTERMS.isPartOf, prjid))
Expand All @@ -421,7 +424,8 @@ def descend(
ds = self._lookup(gateway, "Dataset", target.id)
dsid = handler(ds)
for annotation in ds.listAnnotations(None):
handler(annotation)
annid = handler(annotation)
handler.emit((annid, DCTERMS.isPartOf, dsid))
for img in ds.listChildren():
imgid = self.descend(gateway, img._obj, handler)
handler.emit((imgid, DCTERMS.isPartOf, dsid))
Expand All @@ -436,7 +440,8 @@ def descend(
handler.emit((imgid, DCTERMS.hasPart, pixid))
for annotation in img.listAnnotations(None):
img._loadAnnotationLinks()
handler(annotation)
annid = handler(annotation)
handler.emit((annid, DCTERMS.isPartOf, imgid))
for roi in self._get_rois(gateway, img):
handler(roi)
return imgid
Expand Down

0 comments on commit 33599e3

Please sign in to comment.