The focus of an RO-Crate
In addition to simple data packaging, Crates may have a “main” entry point or topic (referenced with a singleton mainEntity
property), or function as a bundle of one or more Contextual Entities referenced via the mentions
property.
Crates with a “main entity”
An RO-Crate may have a single main entity that is considered the point, or focus of the crate.
Crates with a data entity as mainEntity
In the Workflow RO-Crate profile, where the mainEntity
has a compound type ["File", "SoftwareSourceCode", "ComputationalWorkflow"]
, the use of mainEntity
singles-out the workflow file from supporting files.
{
"@id": "./",
"@type": "Dataset",
"name": "Example Workflow",
"description": "An example workflow RO Crate",
"license": "Apache-2.0",
"mainEntity": {
"@id": "example_workflow.cwl"
},
"hasPart": [
{
"@id": "example_workflow.cwl"
},
{
"@id": "diagram.svg"
},
{
"@id": "README.md"
}
]
}
Crates with a contextual entity as mainEntity
The focus of the RO-Crate may be a description of a Contextual Entity, for example in an RO-Crate used in a repository or encyclopedia where a RepositoryObject bundles together images and other files, but the main focus of the RO-Crate is on describing a person.
{
"@id": "./",
"@type": ["Dataset", "RepositoryObject"],
"name": "Reibey, Mary (1777 - 1855)",
"mainEntity": {
"@id": "https://en.wikipedia.org/wiki/Mary_Reibey"
}
"hasPart" : [
{"@id": "photo1.jpg"},
{"@id": "photo2.jpg"}
]
}
{
"@id": "https://en.wikipedia.org/wiki/Mary_Reibey",
"@type": "Person",
"name": "Mary Reibey",
"description": "Mary Reibey née Haydock (12 May 1777 – 30 May 1855) was an English-born merchant, shipowner and trader ..."
}
Crates which describe Contextual Entities
RO-Crates may describe Contextual Entities which are linked to the Root Dataset via mentions
relationships.
For example, RO-Crates can be used as containers for schema.org-style vocabularies (here also extending the RO-Crate JSON-LD context to define the namespace for txc:
):
{ "@context": [
"https://w3id.org/ro/crate/1.2-DRAFT/context",
{"txc": "https://purl.archive.org/language-data-commons/terms#"}
],
"@graph": [
{
"@id": "ro-crate-metadata.json",
"@type": "CreativeWork",
"description": "RO-Crate Metadata File Descriptor (this file)",
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.2-DRAFT"},
"about": {"@id": "./"}
},
{
"@id": "./",
"@type": "Dataset",
"description": "This is an experimental language data ontology based on OLAC terms for use in the ATAP and LDaCA projects",
"hasPart": [],
"name": "Language Data Ontology",
"mentions": ["txc:Annotation", "txc:CollectionEvent"]
},
{
"@id": "txc:Annotation",
"@type": "rdfs:Class",
"name": "Annotation",
"sameAs": "http://www.language-archives.org/REC/type-20020628.html#annotation",
"rdfs:comment": "The resource includes information which annotates some other linguistic record.",
"rdfs:label": "Annotation",
"rdfs:subClassOf": {
"@id": "schema:CreativeWork"
}
},
{
"@id": "txc:CollectionEvent",
"@type": "rdfs:Class",
"name": "CollectionEvent",
"rdfs:comment": "A description of an event at which one or more PrimaryTexts were captured, e.g. as video or audio",
"rdfs:label": "CollectionEvent",
"rdfs:subClassOf": [
{
"@id": "schema:Event"
},
{
"@id": "schema:CreateAction"
}
]
}
]
}
The following example shows both a mainEntity
which is a Data Entity and a Contextual Entity which is a test suite (#test1
).
{
"@id": "./",
"@type": "Dataset",
"name": "sort-and-change-case",
"description": "sort lines and change text to upper case",
"license": "Apache-2.0",
"mainEntity": {
"@id": "sort-and-change-case.ga"
},
"mentions": [ {"@id": "#test1"} ],
"hasPart": [
{
"@id": "sort-and-change-case.ga"
},
{
"@id": "test/test1/sort-and-change-case-test.yml"
}
]
},
{
"@id": "#test1",
"name": "test1",
"@type": "TestSuite",
"instance": [
{"@id": "#test1_1"}
],
"definition": {"@id": "test/test1/sort-and-change-case-test.yml"}
},
{
"@id": "#test1_1",
"name": "test1_1",
"@type": "TestInstance",
"runsOn": {"@id": "#jenkins"},
"url": "http://example.org/jenkins",
"resource": "job/tests/"
},
{
"@id": "test/test1/sort-and-change-case-test.yml",
"@type": [
"File",
"TestDefinition"
],
"conformsTo": {"@id": "#planemo"}
},
{
"@id": "#jenkins",
"@type": "TestService",
"name": "Jenkins",
"url": {"@id": "https://www.jenkins.io"}
},
{
"@id": "#planemo",
"@type": "SoftwareApplication",
"name": "Planemo",
"url": {"@id": "https://github.com/galaxyproject/planemo"},
"version": ">=0.70"
}