ro-crate
ro-crate copied to clipboard
Consistent handling of property terms and type terms
trafficstars
It is accepted that RO-Crate does not allow URIs or CURIEs as properties. I can't find exactly where this is written in the spec, but this relates to the idea of the metadata being compacted, and crs4/rocrate-validator certainly flags such properties:
{
"@context": [
"https://w3id.org/ro/crate/1.2/context",
{"ex": "https://example.org/terms#"}
],
"@graph": [
{
"@id": "ro-crate-metadata.json",
"@type": "CreativeWork",
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.1"},
"about": {"@id": "./"}
},
{
"@id": "./",
"@type": "Dataset",
"name": "Example dataset for RO-Crate specification",
"description": "Official rainfall readings for Katoomba, NSW 2022, Australia",
"datePublished": "2022-12-01",
"license": "MIT",
"ex:hasVersion": "1.0"
}
]
}
[ ro-crate-1.1_2.1 ] Validation of the compaction format of the file descriptor:
Check if the file descriptor is in the compacted JSON-LD format
Detected issues
- [Violation]: The 1 occurrence of the JSON-LD key "ex:hasVersion" is not allowed in the compacted format because it is not present in the @context of the document
However, the same rules don't seem to apply to @type, despite also being an IRI:
{
"@context": [
"https://w3id.org/ro/crate/1.2/context",
{"ex": "https://example.org/terms#"}
],
"@graph": [
{
"@id": "ro-crate-metadata.json",
"@type": "CreativeWork",
"conformsTo": {"@id": "https://w3id.org/ro/crate/1.1"},
"about": {"@id": "./"}
},
{
"@id": "./",
"@type": ["Dataset", "ex:Dataset"],
"name": "Example dataset for RO-Crate specification",
"license": "MIT",
"description": "Official rainfall readings for Katoomba, NSW 2022, Australia",
"datePublished": "2022-12-01"
}
]
}
Gives
[OK] RO-Crate is a valid ro-crate-1.1 !!!
I personally am a big fan of CURIEs because they let me namespace my types and properties to avoid clashes, while supporting multiple vocabularies. However if we are going to ban them in properties, I think they should also be banned in @type, for consistency.