diff --git a/schemas/bioconductor.json b/schemas/bioconductor.json index 9f9ca96..bd655ae 100644 --- a/schemas/bioconductor.json +++ b/schemas/bioconductor.json @@ -65,7 +65,7 @@ "provider": { "type": "string", "description": "Name of the data provider.", - "enum": [ "GEO", "SRA", "ArrayExpress", "PubMed", "DOI", "other" ] + "enum": [ "GEO", "SRA", "ArrayExpress", "PubMed", "ExperimentHub", "DOI", "other" ] }, "id": { "type": "string", @@ -91,6 +91,10 @@ "if": { "properties": { "provider": { "const": "PubMed" } } }, "then": { "properties": { "id": { "type": "string", "pattern": "^[1-9][0-9]+$" } } } }, + { + "if": { "properties": { "provider": { "const": "ExperimentHub" } } }, + "then": { "properties": { "id": { "type": "string", "pattern": "^EH[0-9]+$" } } } + }, { "if": { "properties": { "provider": { "const": "DOI" } } }, "then": { "properties": { "id": { "type": "string", "pattern": "^[a-zA-Z0-9\\.]+/[a-zA-Z0-9\\.]+$" } } } diff --git a/tests/schemas/bioconductor.test.js b/tests/schemas/bioconductor.test.js index 855f752..64f064b 100644 --- a/tests/schemas/bioconductor.test.js +++ b/tests/schemas/bioconductor.test.js @@ -25,6 +25,7 @@ test("Bioconductor schema behaves as expected", () => { { provider: "ArrayExpress", id: "E-MTAB-12345" }, { provider: "PubMed", id: "12332423" }, { provider: "DOI", id: "123.13/231.23" }, + { provider: "ExperimentHub", id: "EH12345" }, { provider: "other", id: "https://123213.com" } ], maintainer_name: "Aaron Lun", @@ -93,6 +94,8 @@ test("Bioconductor schema behaves as expected", () => { expect(() => validate(obj)).toThrow("pattern"); obj.sources = [{ provider: "PubMed", id: "foo" }]; expect(() => validate(obj)).toThrow("pattern"); + obj.sources = [{ provider: "ExperimentHub", id: "foo" }]; + expect(() => validate(obj)).toThrow("pattern"); obj.sources = [{ provider: "DOI", id: "foo" }]; expect(() => validate(obj)).toThrow("pattern"); obj.sources = [{ provider: "other", id: "foo" }];