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

How to reference and retrieve another RO-Crate #296

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

stain
Copy link
Contributor

@stain stain commented Apr 25, 2024

This PR fixes #228 #160

Generalizes the Content-negotiate-or-signposting section from not just Profile Crates.

For ZIP files this is still vague in that it says If the retrieved resource is a ZIP file (Content-Type: application/zip), then extract ro-crate-metadata.json, or, if the archive root only contains a single folder (e.g. folder1/), extract folder1/ro-crate-metadata.json
I've also added BagIt reference as this would be a second folder, e.g. folder1/data/ro-crate-metadata.json and then the checksums should be verified first as we do in https://trefx.uk/5s-crate/0.4/#check-phase

As for referencing another RO-rate from another, either the referenced RO-Crate can have its own distribution with a conformsTo:

  {
    "@id": "./",
    "@type": "Dataset",
    "identifier": "https://doi.org/10.48546/workflowhub.workflow.775.1",
    "url": "https://workflowhub.eu/workflows/775/ro_crate?version=1",
    "name": "Research Object Crate for Jupyter Notebook Molecular Structure Checking",
    "distribution": {"@id": "https://workflowhub.eu/workflows/775/ro_crate?version=1"},
    "…": ""
  },
  {
    "@id": "https://workflowhub.eu/workflows/775/ro_crate?version=1",
    "@type": "DataDownload",
    "encodingFormat": ["application/zip", {"@id": "https://www.nationalarchives.gov.uk/PRONOM/x-fmt/263"}],
    "conformsTo": { "@id": "https://w3id.org/ro/crate" }
  }

or it can have a subjectOf to a ro-crate-metadata.json:

{
  "@id": "http://example.com/another-crate/",
  "@type": "Dataset",
  "conformsTo": { "@id": "https://w3id.org/ro/crate" },
  "subjectOf": { "@id": "http://example.com/another-crate/ro-crate-metadata.json" }
},
{
  "@id": "http://example.com/another-crate/ro-crate-metadata.json",
  "@type": "CreativeWork",
  "encodingFormat": "application/ld+json"
}

As used by the 5s-crate profile: https://trefx.uk/5s-crate/0.4/#referencing-a-workflow-crate

@stain
Copy link
Contributor Author

stain commented May 20, 2024

Could @dgarijo or @ptsefton have a look at this? I've used it here:
https://stain.github.io/workflow-run-crate/profiles/0.5-DRAFT/process_run_crate/ro-crate-preview.html#https%3A//www.researchobject.org/workflow-run-crate-paper/mapping/

Perhaps we should add that isPartOf pattern as well on how to mention a file within another crate? (Could get tricky to make absolute URIs..)

@dgarijo
Copy link
Contributor

dgarijo commented May 20, 2024 via email

@dgarijo
Copy link
Contributor

dgarijo commented May 27, 2024

Thanks @stain , I have had a look. The only thing that it is not fully clear to me is where the distribution information is supposed to be added: is it on the crate referencing the other crate, or in the referenced crate metadata?

For example, let's say crate A references crate B. Usually I would add a link in A to B. But here you recommend adding also where B is stored, correct? As opposed to adding a link to B, and hoping that when I resolve the id I get a JSON-LD with the distribution information.

The only potential issue I see is that distributions may not have persistent ids. If the link from A to B persists, but the distribution is hosted elsewhere in the meantime, B has no means to tell A about this. But I am ok with this limitation

#### Referencing other RO-Crates

A referenced RO-Crate is also a [Dataset], but where its [hasPart] do not need to be listed. Instead, its content and further metadata is available from its own RO-Crate Metadata File:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify if this metadata goes in the source crate (crate referencing another crate) or the target crate (referenced crate).

Copy link
Contributor

@dgarijo dgarijo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
RO-Crate specifications
  
Under discussion/review
Development

Successfully merging this pull request may close these issues.

Use Case: How to get the contents of a RO as a zip file?
2 participants