File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -558,11 +558,7 @@ def update_jsonld(self, jsonld):
558558 entity : Entity = self .get (entity_id )
559559 if not entity :
560560 raise ValueError (f"entity { entity_id } does not exist in the RO-Crate" )
561- # Keys starting with @ are removed here to avoid messing up things.
562- # https://github.com/ResearchObject/ro-crate-py/pull/149#issuecomment-1487039274
563- for key in list (jsonld .keys ()):
564- if key .startswith ('@' ):
565- del jsonld [key ]
561+ jsonld = {k : v for k , v in jsonld .items () if not k .startswith ('@' )}
566562 entity ._jsonld .update (jsonld )
567563 return entity
568564
Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ def test_update_jsonld(test_data_dir):
157157 assert updated_entity .type == 'CreativeWork'
158158 assert updated_entity ['name' ] == 'No potatoes today'
159159
160+ assert '@type' in update_dict
161+
160162
161163# --- add or update
162164
You can’t perform that action at this time.
0 commit comments