Closed ptsefton closed 11 months ago
Loading this dataset causes an error as the hasPart value is not an array but the code assumes it will be :
{ "@id": "./", "@type": "Dataset", "hasPart": {"@id": "spam/foo.txt"} }, { "@id": "spam/foo.txt", "@type": "File" }
This line is the culprit: https://github.com/ResearchObject/ro-crate-py/blob/dc3f75b0d0390dedbf9a830b6325b76dba468f1f/rocrate/rocrate.py#L145C1-L146C1
parts = root_entity.pop('hasPart', [])
I added this to my copy make it work but not sure if you have a general purpose way of doing this in this library:
if not isinstance(parts, list): parts = [parts]
Loading this dataset causes an error as the hasPart value is not an array but the code assumes it will be :
This line is the culprit: https://github.com/ResearchObject/ro-crate-py/blob/dc3f75b0d0390dedbf9a830b6325b76dba468f1f/rocrate/rocrate.py#L145C1-L146C1
parts = root_entity.pop('hasPart', [])
I added this to my copy make it work but not sure if you have a general purpose way of doing this in this library: