Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add add_tree method #151

Merged
merged 1 commit into from
May 30, 2023
Merged

Add add_tree method #151

merged 1 commit into from
May 30, 2023

Conversation

simleo
Copy link
Collaborator

@simleo simleo commented May 29, 2023

Adds an add_tree method to recursively add a directory along with its contents to the JSON-LD metadata (add_dataset already adds contents recursively to the crate's payload), listing directory contents in the hasPart of the Dataset instances.

@simleo simleo requested a review from rsirvent May 29, 2023 13:35
@rsirvent
Copy link
Contributor

I have a doubt in line 330 of rocrate/rocrate.py, the "add_dataset" call:

Would this add a "Dataset" entity for every sub-folder inside the root folder passed as initial parameter??? Shouldn't this be only done for the root folder?

@simleo
Copy link
Collaborator Author

simleo commented May 30, 2023

I have a doubt in line 330 of rocrate/rocrate.py, the "add_dataset" call:

Would this add a "Dataset" entity for every sub-folder inside the root folder passed as initial parameter??? Shouldn't this be only done for the root folder?

Dataset is the type used in RO-Crate to represent all directory data entities. It's OK to have a Dataset entity for all subfolders, and that's what the newly added add_tree method does. It's also OK to only list the top-level folder, and that's what you get with the existing add_dataset method (see the tip at the end of the spec section on Referencing files and folders from the Root Data Entity: "There is no requirement to represent every file and folder in an RO-Crate as Data Entities in the RO-Crate JSON-LD").

@simleo simleo merged commit f5281c1 into ResearchObject:master May 30, 2023
@simleo simleo deleted the add_tree branch May 30, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants