Skip to content

Commit

Permalink
Add minimal dtool dataset metadata schema (#4246)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
  • Loading branch information
3 people authored Dec 20, 2024
1 parent 0a558b6 commit 3931db8
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,11 @@ async function assertFileSystemIsValid() {
for (const testDir of await fs.readdir(rootTestDir)) {
if (isIgnoredFile(testDir)) continue

const schemaName = testDir + '.json'
const schemaPath = path.join(SchemaDir, schemaName)
const schemaPath = path.join(SchemaDir, testDir + '.json')
if (!(await exists(schemaPath))) {
printErrorAndExit(new Error(), [
`Failed to find a schema file at "${schemaPath}"`,
`Expected schema file computed from directory at "${path.join(rootTestDir, testDir)}"`,
])
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -7235,6 +7235,19 @@
"fileMatch": ["*.bitmovin.json", "*.bitmovin.yml", "*.bitmovin.yaml"],
"url": "https://raw.githubusercontent.com/bitmovin/bitmovin-api-sdk-examples/main/bitmovin-encoding-template.json"
},
{
"name": "dtool dataset metadata",
"description": "Metadata attached to a dtool dataset",
"fileMatch": [
"dtool-dataset.yml",
"dtool-dataset.yaml",
"dtool-dataset.json"
],
"url": "https://json.schemastore.org/dtool-dataset-metadata-1.0.json",
"versions": {
"v1.0": "https://json.schemastore.org/dtool-dataset-metadata-1.0.json"
}
},
{
"name": "pnpm Workspace (pnpm-workspace.yaml)",
"description": "Workspace file for pnpm",
Expand Down
89 changes: 89 additions & 0 deletions src/schemas/json/dtool-dataset-metadata-1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/dtool-dataset-metadata-1.0.json",
"title": "DToolDataset",
"description": "Schema for metadata attached to a dtool dataset",
"type": "object",
"properties": {
"uuid": {
"type": "string",
"format": "uuid"
},
"base_uri": {
"type": "string"
},
"uri": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"readme": {
"anyOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": true
}
]
},
"manifest": {
"type": "object",
"properties": {
"items": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"hash": {
"type": "string"
},
"relpath": {
"type": "string"
},
"size_in_bytes": {
"type": "integer"
},
"utc_timestamp": {
"type": "number"
}
}
}
},
"hash_function": {
"type": "string"
},
"dtoolcore_version": {
"type": "string"
}
}
},
"creator_username": {
"type": "string"
},
"frozen_at": {
"anyOf": [{ "type": "string" }, { "type": "number" }]
},
"created_at": {
"anyOf": [{ "type": "string" }, { "type": "number" }]
},
"annotations": {
"type": "object"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"number_of_items": {
"type": "integer"
},
"size_in_bytes": {
"type": "integer"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"annotations": {
"software": "bowtie2"
},
"base_uri": "s3://snow-white",
"creator_username": "olssont",
"frozen_at": "1536238185.881941",
"manifest": {
"dtoolcore_version": "3.7.0",
"hash_function": "md5sum_hexdigest",
"items": {
"e4cc3a7dc281c3d89ed4553293c4b4b110dc9bf3": {
"hash": "d89117c9da2cc34586e183017cb14851",
"relpath": "U00096.3.rev.1.bt2",
"size_in_bytes": 5741810,
"utc_timestamp": 1536832115.0
}
}
},
"name": "my-dataset",
"number_of_items": 1,
"readme": "---\ndescription: test dataset",
"size_in_bytes": 5741810,
"tags": ["rnaseq"],
"type": "dataset",
"uri": "s3://snow-white/af6727bf-29c7-43dd-b42f-a5d7ede28337",
"uuid": "af6727bf-29c7-43dd-b42f-a5d7ede28337"
}

0 comments on commit 3931db8

Please sign in to comment.