@@ -312,7 +312,7 @@ def record_process_end(
312312 self .document .wasEndedBy (process_run_id , None , self .workflow_run_uri , when )
313313
314314 def _add_nested_annotations (
315- self , annotation_key , annotation_value , e : ProvEntity
315+ self , annotation_key : str , annotation_value : Any , e : ProvEntity
316316 ) -> ProvEntity :
317317 """Propagate input data annotations to provenance."""
318318 # Change https:// into http:// first
@@ -398,13 +398,13 @@ def declare_file(self, value: CWLObjectType) -> Tuple[ProvEntity, ProvEntity, st
398398
399399 # Identify all schema annotations
400400 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") ]
402402 )
403403
404404 # Transfer SCHEMA annotations to provenance
405405 for s in schema_annotations :
406406 if "additionalType" in s :
407- additional_type = schema_annotations [s ].split (sep = "/" )[
407+ additional_type = cast ( str , schema_annotations [s ]) .split (sep = "/" )[
408408 - 1
409409 ] # find better method?
410410 file_entity .add_attributes ({PROV_TYPE : SCHEMA [additional_type ]})
@@ -527,13 +527,13 @@ def declare_directory(self, value: CWLObjectType) -> ProvEntity:
527527
528528 # Identify all schema annotations
529529 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") ]
531531 )
532532
533533 # Transfer SCHEMA annotations to provenance
534534 for s in schema_annotations :
535535 if "additionalType" in s :
536- additional_type = schema_annotations [s ].split (sep = "/" )[
536+ additional_type = cast ( str , schema_annotations [s ]) .split (sep = "/" )[
537537 - 1
538538 ] # find better method?
539539 coll .add_attributes ({PROV_TYPE : SCHEMA [additional_type ]})
0 commit comments