Skip to content

Commit f54925b

Browse files
committed
Add additional schema files and reorganize
Changes to be committed: modified: biocompute/services.py new file: config/schemas/1.1.0/dataset_extension.json new file: config/schemas/1.1.0/fhir_extension.json new file: config/schemas/1.1.0/galaxy_extension.json new file: config/schemas/1.1.0/license_extension.json new file: config/schemas/1.1.0/scm_extension.json renamed: config/schemas/dataset_extension.json -> config/schemas/1.2.0/dataset_extension.json renamed: config/schemas/fhir_extension.json -> config/schemas/1.2.0/fhir_extension.json renamed: config/schemas/galaxy_extension.json -> config/schemas/1.2.0/galaxy_extension.json renamed: config/schemas/license_extension.json -> config/schemas/1.2.0/license_extension.json renamed: config/schemas/scm_extension.json -> config/schemas/1.2.0/scm_extension.json renamed: config/schemas/2791object.json -> config/schemas/2791/2791object.json renamed: config/schemas/description_domain.json -> config/schemas/2791/description_domain.json renamed: config/schemas/error_domain.json -> config/schemas/2791/error_domain.json renamed: config/schemas/execution_domain.json -> config/schemas/2791/execution_domain.json renamed: config/schemas/io_domain.json -> config/schemas/2791/io_domain.json renamed: config/schemas/parametric_domain.json -> config/schemas/2791/parametric_domain.json renamed: config/schemas/provenance_domain.json -> config/schemas/2791/provenance_domain.json renamed: config/schemas/usability_domain.json -> config/schemas/2791/usability_domain.json modified: config/settings.py modified: requirements.txt
1 parent 588156e commit f54925b

21 files changed

+321
-8
lines changed

biocompute/services.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,24 @@ def load_schema(schema_uri):
5151
- dict: The loaded JSON schema.
5252
"""
5353
schema_mapping = {
54-
"https://w3id.org/ieee/ieee-2791-schema/2791object.json": f"{BASE_DIR}/config/schemas/2791object.json",
55-
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/dataset_extension.json": f"{BASE_DIR}/config/schemas/dataset_extension.json",
56-
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/fhir_extension.json": f"{BASE_DIR}/config/schemas/fhir_extension.json",
57-
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/galaxy_extension.json": f"{BASE_DIR}/config/schemas/galaxy_extension.json",
58-
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/license_extension.json": f"{BASE_DIR}/config/schemas/license_extension.json",
59-
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/scm_extension.json": f"{BASE_DIR}/config/schemas/scm_extension.json"
54+
"https://w3id.org/ieee/ieee-2791-schema/2791object.json": f"{BASE_DIR}/config/schemas/2791/2791object.json",
55+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/dataset/dataset_extension.json": f"{BASE_DIR}/config/schemas/1.1.0/dataset_extension.json",
56+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/fhir/fhir_extension.json": f"{BASE_DIR}/config/schemas/1.1.0/fhir_extension.json",
57+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/galaxy/galaxy_extension.json": f"{BASE_DIR}/config/schemas/1.1.0/galaxy_extension.json",
58+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/license/license_extension.json": f"{BASE_DIR}/config/schemas/1.1.0/license_extension.json",
59+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.1.0/scm/scm_extension.json": f"{BASE_DIR}/config/schemas/1.1.0/scm_extension.json",
60+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.2.0/dataset/dataset_extension.json": f"{BASE_DIR}/config/schemas/1.2.0/dataset_extension.json",
61+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.2.0/fhir/fhir_extension.json": f"{BASE_DIR}/config/schemas/1.2.0/fhir_extension.json",
62+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.2.0/galaxy/galaxy_extension.json": f"{BASE_DIR}/config/schemas/1.2.0/galaxy_extension.json",
63+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.2.0/license/license_extension.json": f"{BASE_DIR}/config/schemas/1.2.0/license_extension.json",
64+
"https://raw.githubusercontent.com/biocompute-objects/extension_domain/1.2.0/scm/scm_extension.json": f"{BASE_DIR}/config/schemas/1.2.0/scm_extension.json"
6065
}
66+
6167
if schema_uri in schema_mapping:
68+
print(schema_uri in schema_mapping, schema_uri)
6269
return jsonref.load_uri(f"file://{schema_mapping[schema_uri]}")
70+
else:
71+
print(schema_uri in schema_mapping, schema_uri)
6372
try:
6473
return jsonref.load_uri(schema_uri)
6574
except (JSONDecodeError, TypeError, RequestsConnectionError) as e:
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://www.w3id.org/biocompute/extension_domain/1.1.0/dataset/dataset_extension.json",
4+
"title": "dataset_extension",
5+
"type": "object",
6+
"description": "The external references extension to list additional licenses and dataset catagories for a dataset BCO (dsBCO).",
7+
"required": ["dataset_extension", "extension_schema"],
8+
"additionalProperties": false,
9+
"properties": {
10+
"dataset_extension": {
11+
"type": "object",
12+
"additionalProperties": false,
13+
"required": ["dataset_categories"],
14+
"properties": {
15+
"additional_license": {
16+
"type": "object",
17+
"description": "The additional license property contains the details about the licenses applied to the dataset and the script or tool/software used to process the given dataset.",
18+
"additionalProperties": false,
19+
"properties": {
20+
"data_license": {
21+
"title": "data_license",
22+
"type": "string",
23+
"description": "The license applied to the data or the dataset by the author",
24+
"examples": [
25+
"https://creativecommons.org/licenses/by/4.0/"
26+
]
27+
},
28+
"script_license": {
29+
"title": "script_license",
30+
"type": "string",
31+
"description": "The license applied to the computational script or the tool/software developed to process (parse, QC, align) the input dataset for a final output dataset.",
32+
"examples": [
33+
"https://www.gnu.org/licenses/gpl-3.0.en.html"
34+
]
35+
}
36+
}
37+
},
38+
"dataset_categories": {
39+
"title": "dataset_categories",
40+
"type": "array",
41+
"description": "Dataset categories describe and provide more information about the dataset which can be used to classify, group, sort and filter datasets.",
42+
"items": {
43+
"required": [
44+
"category_value",
45+
"category_name"
46+
],
47+
"additionalProperties": false,
48+
"properties": {
49+
"category_value": {
50+
"type": "string",
51+
"title": "category_value",
52+
"description": "An explanation about the purpose of this instance.",
53+
"examples": [
54+
"Homo sapiens"
55+
]
56+
},
57+
"category_name": {
58+
"type": "string",
59+
"title": "category_name",
60+
"description": "An explanation about the purpose of this instance.",
61+
"enum": [
62+
"species",
63+
"molecule",
64+
"tag",
65+
"file_type",
66+
"status",
67+
"scope"
68+
]
69+
}
70+
}
71+
}
72+
}
73+
}
74+
},
75+
"extension_schema": {
76+
"title": "extension_schema",
77+
"type": "string",
78+
"format": "uri",
79+
"description": "The schema applied to the extension object",
80+
"examples": [
81+
"http://www.w3id.org/biocompute/extension_domain/example.json"
82+
]
83+
84+
}
85+
}
86+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://w3id.org/biocompute/extension_domain/1.1.0/fhir/fhir_extension.json",
4+
"title": "fhir_extension",
5+
"type": "object",
6+
"description": "The external references extension to FHIR resource",
7+
"required": ["fhir_extension", "extension_schema"],
8+
"additionalProperties": false,
9+
"properties":{
10+
"extension_schema": {
11+
"title": "extension_schema",
12+
"type": "string",
13+
"format": "uri",
14+
"description": "The schema applied to the extension object",
15+
"examples": [
16+
"http://www.w3id.org/biocompute/extension_domain/example.json"
17+
]
18+
19+
},
20+
"fhir_extension":{
21+
"title": "",
22+
"type": "array",
23+
"decription": "",
24+
"items": {
25+
"required": [
26+
"fhir_endpoint",
27+
"fhir_version",
28+
"fhir_resources"
29+
],
30+
"properties": {
31+
"fhir_endpoint": {
32+
"type": "string",
33+
"description": "Base URI of FHIR server where the resources are stored",
34+
"examples": [
35+
"http://fhirtest.uhn.ca/baseDstu3"
36+
],
37+
"format": "uri"
38+
},
39+
"fhir_version": {
40+
"type": "string",
41+
"description": "FHIR version of the server endpoint"
42+
},
43+
"fhir_resources": {
44+
"type": "array",
45+
"items": {
46+
"type": "object",
47+
"required": [
48+
"fhir_resource",
49+
"fhir_id"
50+
],
51+
"properties": {
52+
"fhir_resource": {
53+
"type": "string",
54+
"description": "Type of FHIR resource used"
55+
},
56+
"fhir_id": {
57+
"type": "string",
58+
"description": "Server-specific identifier string"
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://www.w3id.org/biocompute/extension_domain/1.1.0/galaxy/galaxy_extension.json",
4+
"title": "galaxy_extension",
5+
"type": "object",
6+
"description": "The external references **example** extension for a Galaxy BCO.",
7+
"required": ["galaxy_extension", "extension_schema"],
8+
"additionalProperties": false,
9+
"properties": {
10+
"extension_schema": {
11+
"type": "string",
12+
"format": "uri",
13+
"description": "The schema applied to the extension object",
14+
"examples": [
15+
"http://www.w3id.org/biocompute/extension_domain/example.json"
16+
]
17+
18+
},
19+
"galaxy_extension": {
20+
"type": "object",
21+
"required": [
22+
"galaxy_url",
23+
"galaxy_version"
24+
],
25+
"properties": {
26+
"galaxy_url": {
27+
"type": "string",
28+
"description": "The base url for the galaxy instance used to create the BioCompute Object.",
29+
"examples": [
30+
"https://galaxy.aws.biochemistry.gwu.edu/"
31+
],
32+
"format": "uri"
33+
},
34+
"galaxy_version": {
35+
"type": "string",
36+
"description": "The specific version of the Galaxy software used to generate the BioCompute Object.",
37+
"examples": [
38+
"20.01"
39+
]
40+
}
41+
}
42+
}
43+
}
44+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://www.w3id.org/biocompute/extension_domain/1.1.0/license/license_extension.json",
4+
"type": "object",
5+
"description": "The extension to add additional licenses.",
6+
"required": ["licence_extension", "extension_schema"],
7+
"additionalProperties": false,
8+
"properties":{
9+
"extension_schema": {
10+
"title": "extension_schema",
11+
"type": "string",
12+
"format": "uri",
13+
"description": "The schema applied to the extension object",
14+
"examples": [
15+
"http://www.w3id.org/biocompute/extension_domain/example.json"
16+
]
17+
},
18+
"licence_extension":{
19+
"required": [
20+
"data_license",
21+
"scripts_license"
22+
],
23+
"properties": {
24+
"data_license": {
25+
"type": "string",
26+
"examples": [
27+
"https://github.com/example/repo1"
28+
],
29+
"format": "uri"
30+
},
31+
"scripts_license": {
32+
"type": "string",
33+
"examples": [
34+
"https://github.com/example/repo1"
35+
],
36+
"format": "uri"
37+
}
38+
}
39+
}
40+
}
41+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://w3id.org/biocompute/extension_domain/1.1.0/scm/scm_extension.json",
4+
"title": "scm_extension",
5+
"type": "object",
6+
"description": "The external references extension to a SCM repository",
7+
"required": ["scm_extension", "extension_schema"],
8+
"additionalProperties": false,
9+
"properties":{
10+
"extension_schema": {
11+
"title": "extension_schema",
12+
"type": "string",
13+
"format": "uri",
14+
"description": "The schema applied to the extension object",
15+
"examples": [
16+
"http://www.w3id.org/biocompute/extension_domain/example.json"
17+
]
18+
19+
},
20+
"scm_extension":{
21+
"required": [
22+
"scm_repository",
23+
"scm_type",
24+
"scm_commit",
25+
"scm_path"
26+
],
27+
"properties": {
28+
"scm_repository": {
29+
"type": "string",
30+
"examples": [
31+
"https://github.com/example/repo1"
32+
],
33+
"format": "uri"
34+
},
35+
"scm_type": {
36+
"type": "string",
37+
"enum": [
38+
"git",
39+
"svn",
40+
"hg",
41+
"other"
42+
]
43+
},
44+
"scm_commit": {
45+
"type": "string",
46+
"examples": [
47+
"c9ffea0b60fa3bcf8e138af7c99ca141a6b8fb21"
48+
]
49+
},
50+
"scm_path": {
51+
"type": "string",
52+
"examples": [
53+
"workflow/hive-viral-mutation-detection.cwl"
54+
],
55+
"format": "string"
56+
},
57+
"scm_preview": {
58+
"type": "string",
59+
"examples": [
60+
"https://github.com/example/repo1/blob/c9ffea0b60fa3bcf8e138af7c99ca141a6b8fb21/workflow/hive-viral-mutation-detection.cwl"
61+
],
62+
"format": "uri"
63+
}
64+
}
65+
}
66+
}
67+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)