ResearchObject/ro-crate-py

Add method to include additional contexts at the top level

Closed this issue · 1 comments

Right now, it is possible to add additional terms from other contexts to the top level contexts through the attached Metadata instance, using the extra_terms dictionary:

a_crate = ROCrate(gen_preview=False)
a_crate.metadata.extra_terms.update(
    {
        "sha256": "https://w3id.org/ro/terms/workflow-run#sha256"
    }
)

which leads to

{
    "@context": [
        "https://w3id.org/ro/crate/1.1/context",
        {
            "sha256": "https://w3id.org/ro/terms/workflow-run#sha256"
        }
    ],
    "@graph": [

but there is no method nor provision in the current implementation to add additional contexts, in order to get something like:

{
    "@context": [
        "https://w3id.org/ro/crate/1.1/context",
        "https://w3id.org/ro/terms/workflow-run"
    ],
    "@graph": [

Could you add such method, please?

Thanks!