ResearchObject / ro-crate-py

Python library for RO-Crate
https://pypi.org/project/rocrate/
Apache License 2.0
46 stars 23 forks source link

Sync entity map with specific lists #166

Closed simleo closed 11 months ago

simleo commented 11 months ago

Fixes #165.

Fixes a problem that occurred when adding an entity with the same @id as an existing one. The new entity replaced the old one (in __entity_map) as stated in the docstring for add, but the old entity was still present in data_entities or contextual_entities. This PR changes default_entities, data_entities and contextual_entities in the ROCrate class to properties that return the appropriate list from __entity_map, which is now the single source of truth for what is or is not in the crate.