Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added data_access module for managed access data. Fixes #1535 #1537

Merged
merged 20 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/jsonBrowser/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,16 @@ text | The text for the term as the user provides it. | string | yes | | Organ
ontology | An ontology term identifier in the form prefix:accession. | string | no | | Organ ontology ID | | UBERON:0000948; UBERON:0002405
ontology_label | The preferred label for the ontology term referred to in the ontology field. This may differ from the user-supplied value in the text field. | string | no | | Organ ontology label | | heart; immune system

## Data use restriction<a name='Data use restriction'></a>
_Data use restriction for the project._

Location: module/project/data_use_restriction.json

Property name | Description | Type | Required? | Object reference? | User friendly name | Allowed values | Example
--- | --- | --- | --- | --- | --- | --- | ---
DUO_id | Type of data use restrictions associated with the project. | string | yes | | Data use conditions ontology ID | DUO:0000004, DUO:0000042, DUO:0000042;DUO:0000046 | DUO:0000004
DUO_label | Label corresponding to the data use restrictions ID associated with the project | string | yes | | Data use conditions ontology label | no restriction, general research use, general research use;non-commercial use only | no restriction

## Funder<a name='Funder'></a>
_Information about the project funding source._

Expand Down
6 changes: 6 additions & 0 deletions docs/jsonBrowser/required_fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Property name | Description | Type | Object reference? | User friendly name | Al
schema_type | The type of the metadata schema entity. | string | | | project |
project_core | Core project-level information. | object | [See core project_core](core.md#project-core) | Project core | |
funders | Funding source(s) supporting the project. | array | [See module funder](module.md#funder) | Funding source(s) | |
data_use_restriction | Information about the data use restrictions for the project. | object | [See module data_use_restriction](module.md#data-use-restriction) | Data access | |
### Specimen from organism
Property name | Description | Type | Object reference? | User friendly name | Allowed values | Example
--- | --- | --- | --- | --- | --- | ---
Expand Down Expand Up @@ -327,6 +328,11 @@ text | The name of a cell type supplied by a user. | string | | Cell type | |
Property name | Description | Type | Object reference? | User friendly name | Allowed values | Example
--- | --- | --- | --- | --- | --- | ---
text | The text for the term as the user provides it. | string | | Organ | | heart; immune system
### Data use restriction<a name='Data use restriction'></a>
Property name | Description | Type | Object reference? | User friendly name | Allowed values | Example
--- | --- | --- | --- | --- | --- | ---
DUO_id | Type of data use restrictions associated with the project. | string | | Data use conditions ontology ID | DUO:0000004, DUO:0000042, DUO:0000042;DUO:0000046 | DUO:0000004
DUO_label | Label corresponding to the data use restrictions ID associated with the project | string | | Data use conditions ontology label | no restriction, general research use, general research use;non-commercial use only | no restriction
### Funder<a name='Funder'></a>
Property name | Description | Type | Object reference? | User friendly name | Allowed values | Example
--- | --- | --- | --- | --- | --- | ---
Expand Down
1 change: 1 addition & 0 deletions docs/jsonBrowser/type.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ insdc_study_accessions | An International Nucleotide Sequence Database Collabora
biostudies_accessions | A BioStudies study accession. | array | no | | BioStudies accession | | S-EXMP1; S-HCAS33
funders | Funding source(s) supporting the project. | array | yes | [See module funder](module.md#funder) | Funding source(s) | |
estimated_cell_count | An estimated number of cells in this project | integer | no | | Estimated cell count | | 10000; 2100000
data_use_restriction | Information about the data use restrictions for the project. | object | yes | [See module data_use_restriction](module.md#data-use-restriction) | Data access | |

## Specimen from organism
_Information about the specimen that was collected from the donor organism._
Expand Down
89 changes: 89 additions & 0 deletions json_schema/module/project/data_use_restriction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Data use restriction for the project.",
"additionalProperties": false,
"required": [
"DUO_id",
"DUO_label"
],
"title": "Data use restriction",
"name": "data_use_restriction",
"type": "object",
"properties": {
"describedBy": {
"description": "The URL reference to the schema.",
"type": "string",
"pattern" : "^(http|https)://schema.(.*?)humancellatlas.org/module/project/(([0-9]{1,}.[0-9]{1,}.[0-9]{1,})|([a-zA-Z]*?))/data_use_restriction"
},
"schema_version": {
"description": "The version number of the schema in major.minor.patch format.",
"type": "string",
"pattern": "^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$",
"example": "4.6.1"
},
"DUO_id": {
"description": "Type of data use restrictions associated with the project.",
"type": "string",
"enum": [
"DUO:0000004",
"DUO:0000042",
"DUO:0000042;DUO:0000046"
Copy link
Contributor

@hannes-ucsc hannes-ucsc Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of a custom separator strikes me as hacky since it requires custom parsing on the consumer end. Multiplicity in JSON is natively handled as—I hesitate to bring this up again—arrays. You could still restrict the valid term combinations with allOf and require DUO:0000004.

Alternatively, we could ditch the combination from the contributor form. I personally find it confusing and it makes for a simpler "radio button" form UI instead of the more complicated "only some checkbox combinations are valid" approach.

],
"user_friendly": "Data use conditions ontology ID",
"guidelines": "Must be one of: DUO:0000004, DUO:0000042, DUO:0000042;DUO:0000046",
"example": "DUO:0000004"
},
"DUO_label": {
"description": "Label corresponding to the data use restrictions ID associated with the project",
"type": "string",
"enum": [
"no restriction",
"general research use",
"general research use;non-commercial use only"
],
"user_friendly": "Data use conditions ontology label",
"guidelines": "Must be one of: no restriction, general research use, general research use;non-commercial use only",
"example": "no restriction"
}
},

"allOf": [
{
"if": {
"properties": {
"DUO_id": { "const": "DUO:0000004" }
}
},
"then": {
"properties": {
"DUO_label": { "const": "no restriction" }
}
}
},
{
"if": {
"properties": {
"DUO_id": { "const": "DUO:0000042" }
}
},
"then": {
"properties": {
"DUO_label": { "const": "general research use" }
}
}
},
{
"if": {
"properties": {
"DUO_id": { "const": "DUO:0000042;DUO:0000046" }
}
},
"then": {
"properties": {
"DUO_label": { "const": "general research use;non-commercial use only" }
}
}
}
]

}
7 changes: 7 additions & 0 deletions json_schema/property_migrations.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"migrations": [
{
"source_schema": "project",
"property": "data_access",
"effective_from": "18.0.0",
"reason": "Data access is now recorded as a mandatory field",
"type": "new required property"
},
{
"source_schema": "cell_line",
"property": "timecourse",
Expand Down
9 changes: 8 additions & 1 deletion json_schema/type/project/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"describedBy",
"schema_type",
"project_core",
"funders"
"funders",
"data_use_restriction"
],
"title": "Project",
"name": "project",
Expand Down Expand Up @@ -164,6 +165,12 @@
"type": "integer",
"example": "10000; 2100000",
"user_friendly": "Estimated cell count"
},
"data_use_restriction": {
"description": "Information about the data use restrictions for the project.",
"type": "object",
idazucchi marked this conversation as resolved.
Show resolved Hide resolved
"$ref": "module/project/data_use_restriction.json",
"user_friendly": "Data access"
}
}
}
2 changes: 2 additions & 0 deletions json_schema/update_log.csv
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Schema,Change type,Change message,Version,Date
type/project/project,major,"Added data_use_restriction field",,
module/project/data_use_restriction,major,"Added data restriction type as project module",,
5 changes: 3 additions & 2 deletions json_schema/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"contact": "9.0.0",
"funder": "2.0.0",
"hca_bionetwork": "1.0.1",
"publication": "7.0.0"
"publication": "7.0.0",
"data_use_restriction": "0.0.0"
},
"protocol": {
"channel": "2.0.4",
Expand Down Expand Up @@ -137,4 +138,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/schema_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

required_schema_fields = ['$schema', 'description', 'additionalProperties', 'title', 'name', 'type', 'properties']

allowed_schema_fields = ['$schema', 'description', 'additionalProperties', 'required', 'title', 'name', 'type', 'properties', 'definitions', 'dependencies']
allowed_schema_fields = ['$schema', 'description', 'additionalProperties', 'required', 'title', 'name', 'type', 'properties', 'definitions', 'dependencies','allOf']
idazucchi marked this conversation as resolved.
Show resolved Hide resolved

# Properties

Expand Down
Loading