ResearchObject / ro-crate-py

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

Support indirect data entity linking from root #141

Closed simleo closed 11 months ago

simleo commented 1 year ago

Currently we detect data entities only if they are directly linked to from the root data entity:

{
    "@id": "./",
    "@type": "Dataset",
    "hasPart": [
        {"@id": "spam"},
        {"@id": "spam/foo.txt"}
    ]
},
{
    "@id": "spam",
    "@type": "Dataset",
    "hasPart": [
        {"@id": "spam/foo.txt"}
    ]
},
{
    "@id": "spam/foo.txt",
    "@type": "File"
}

We should also support indirect linking as specified in the specs. In the above example, for instance, we should treat spam/foo.txt as a data entity even if it wasn't listed in the root data entity's hasPart.