@@ -482,6 +482,29 @@ def check_prov(self, nested=False, single_tool=False, directory=False,
482
482
if not files :
483
483
self .assertTrue ((d ,RDF .type ,PROV .EmptyCollection ) in g )
484
484
self .assertTrue ((d ,RDF .type ,PROV .EmptyDictionary ) in g )
485
+ if secondary_files :
486
+ derivations = set (g .subjects (RDF .type , CWLPROV .SecondaryFile ))
487
+ self .assertTrue (derivations )
488
+ for der in derivations :
489
+ sec = set (g .subjects (PROV .qualifiedDerivation , der )).pop ()
490
+ prim = set (g .objects (der , PROV .entity )).pop ()
491
+
492
+ # UUID specializes a hash checksum
493
+ self .assertTrue (set (g .objects (sec , PROV .specializationOf )))
494
+ # extensions etc.
495
+ sec_basename = set (g .objects (sec , CWLPROV .basename )).pop ()
496
+ sec_nameroot = set (g .objects (sec , CWLPROV .nameroot )).pop ()
497
+ sec_nameext = set (g .objects (sec , CWLPROV .nameext )).pop ()
498
+ self .assertEquals (str (sec_basename ), "%s%s" % (sec_nameroot , sec_nameext ))
499
+ # TODO: Check hash data file exist in RO
500
+
501
+ # The primary entity should have the same, but different values
502
+ self .assertTrue (set (g .objects (prim , PROV .specializationOf )))
503
+ prim_basename = set (g .objects (prim , CWLPROV .basename )).pop ()
504
+ prim_nameroot = set (g .objects (prim , CWLPROV .nameroot )).pop ()
505
+ prim_nameext = set (g .objects (prim , CWLPROV .nameext )).pop ()
506
+ self .assertEquals (sec_nameroot , prim_basename )
507
+ self .assertEquals (str (prim_basename ), "%s%s" % (prim_nameroot , prim_nameext ))
485
508
486
509
487
510
class TestConvertPath (unittest .TestCase ):
0 commit comments