@@ -388,14 +388,16 @@ def descend(
388
388
handler .emit ((pltid , DCTERMS .isPartOf , scrid ))
389
389
handler .emit ((scrid , DCTERMS .hasPart , pltid ))
390
390
for annotation in scr .listAnnotations (None ):
391
- handler (annotation )
391
+ annid = handler (annotation )
392
+ handler .emit ((annid , DCTERMS .isPartOf , scrid ))
392
393
return scrid
393
394
394
395
elif isinstance (target , Plate ):
395
396
plt = self ._lookup (gateway , "Plate" , target .id )
396
397
pltid = handler (plt )
397
398
for annotation in plt .listAnnotations (None ):
398
- handler (annotation )
399
+ annid = handler (annotation )
400
+ handler .emit ((annid , DCTERMS .isPartOf , pltid ))
399
401
for well in plt .listChildren ():
400
402
wid = handler (well ) # No descend
401
403
handler .emit ((wid , DCTERMS .isPartOf , pltid ))
@@ -410,7 +412,8 @@ def descend(
410
412
prj = self ._lookup (gateway , "Project" , target .id )
411
413
prjid = handler (prj )
412
414
for annotation in prj .listAnnotations (None ):
413
- handler (annotation )
415
+ annid = handler (annotation )
416
+ handler .emit ((annid , DCTERMS .isPartOf , prjid ))
414
417
for ds in prj .listChildren ():
415
418
dsid = self .descend (gateway , ds ._obj , handler )
416
419
handler .emit ((dsid , DCTERMS .isPartOf , prjid ))
@@ -421,7 +424,8 @@ def descend(
421
424
ds = self ._lookup (gateway , "Dataset" , target .id )
422
425
dsid = handler (ds )
423
426
for annotation in ds .listAnnotations (None ):
424
- handler (annotation )
427
+ annid = handler (annotation )
428
+ handler .emit ((annid , DCTERMS .isPartOf , dsid ))
425
429
for img in ds .listChildren ():
426
430
imgid = self .descend (gateway , img ._obj , handler )
427
431
handler .emit ((imgid , DCTERMS .isPartOf , dsid ))
@@ -436,7 +440,8 @@ def descend(
436
440
handler .emit ((imgid , DCTERMS .hasPart , pixid ))
437
441
for annotation in img .listAnnotations (None ):
438
442
img ._loadAnnotationLinks ()
439
- handler (annotation )
443
+ annid = handler (annotation )
444
+ handler .emit ((annid , DCTERMS .isPartOf , imgid ))
440
445
for roi in self ._get_rois (gateway , img ):
441
446
handler (roi )
442
447
return imgid
0 commit comments