@@ -312,7 +312,7 @@ def record_process_end(
312
312
self .document .wasEndedBy (process_run_id , None , self .workflow_run_uri , when )
313
313
314
314
def _add_nested_annotations (
315
- self , annotation_key , annotation_value , e : ProvEntity
315
+ self , annotation_key : str , annotation_value : Any , e : ProvEntity
316
316
) -> ProvEntity :
317
317
"""Propagate input data annotations to provenance."""
318
318
# Change https:// into http:// first
@@ -398,13 +398,13 @@ def declare_file(self, value: CWLObjectType) -> Tuple[ProvEntity, ProvEntity, st
398
398
399
399
# Identify all schema annotations
400
400
schema_annotations = dict (
401
- [(v , value [v ]) for v in value .keys () if " schema.org" in v ]
401
+ [(v , value [v ]) for v in value .keys () if v . startswith ( "https:// schema.org") ]
402
402
)
403
403
404
404
# Transfer SCHEMA annotations to provenance
405
405
for s in schema_annotations :
406
406
if "additionalType" in s :
407
- additional_type = schema_annotations [s ].split (sep = "/" )[
407
+ additional_type = cast ( str , schema_annotations [s ]) .split (sep = "/" )[
408
408
- 1
409
409
] # find better method?
410
410
file_entity .add_attributes ({PROV_TYPE : SCHEMA [additional_type ]})
@@ -527,13 +527,13 @@ def declare_directory(self, value: CWLObjectType) -> ProvEntity:
527
527
528
528
# Identify all schema annotations
529
529
schema_annotations = dict (
530
- [(v , value [v ]) for v in value .keys () if " schema.org" in v ]
530
+ [(v , value [v ]) for v in value .keys () if v . startswith ( "https:// schema.org") ]
531
531
)
532
532
533
533
# Transfer SCHEMA annotations to provenance
534
534
for s in schema_annotations :
535
535
if "additionalType" in s :
536
- additional_type = schema_annotations [s ].split (sep = "/" )[
536
+ additional_type = cast ( str , schema_annotations [s ]) .split (sep = "/" )[
537
537
- 1
538
538
] # find better method?
539
539
coll .add_attributes ({PROV_TYPE : SCHEMA [additional_type ]})
0 commit comments