Skip to content

Commit

Permalink
Merge pull request #1836 from 4dn-dcic/wrr_schema
Browse files Browse the repository at this point in the history
Jsonschema update
  • Loading branch information
willronchetti authored Aug 18, 2023
2 parents baa25e1 + 624933a commit cf4db7f
Show file tree
Hide file tree
Showing 116 changed files with 1,299 additions and 983 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ fourfront
Change Log
----------

6.2.0
=====

* Removes ``jsonschema_serialize_fork``, updating schema format version and validation
* Repairs a bug in user registration


6.1.1
=====

Expand Down
1,793 changes: 1,050 additions & 743 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
# Note: Various modules refer to this system as "encoded", not "fourfront".
name = "encoded"
version = "6.1.1"
version = "6.2.0"
description = "4DN-DCIC Fourfront"
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
license = "MIT"
Expand Down Expand Up @@ -47,7 +47,7 @@ colorama = "0.3.3"
# we get odd 'pyo3_runtime.PanicException: Python API call failed' error on import
# of cryptography.hazmat.bindings._rust in cryptography package. 2023-04-21.
cryptography = "39.0.2"
dcicsnovault = "^9.1.1"
dcicsnovault = "^10.0.2"
dcicutils = "^7.5.0"
elasticsearch = "7.13.4"
elasticsearch-dsl = "^7.0.0" # TODO: port code from cgap-portal to get rid of uses
Expand All @@ -58,7 +58,6 @@ hupper = "1.5"
idna = "^2.10"
isodate = "0.6.0"
jmespath = "0.9.0"
jsonschema-serialize-fork = "^2.1.1"
Markdown = "^3.4.3"
netaddr = ">=0.8.0,<1"
passlib = "^1.7.4"
Expand Down
12 changes: 6 additions & 6 deletions src/encoded/schema_formats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re

from dcicutils.misc_utils import ignored, is_valid_absolute_uri
from jsonschema_serialize_fork import FormatChecker
from jsonschema import Draft202012Validator
from pyramid.threadlocal import get_current_request
from .server_defaults import (
ACCESSION_FACTORY,
Expand All @@ -23,7 +23,7 @@
uuid_re = re.compile(r'(?i)[{]?(?:[0-9a-f]{4}-?){8}[}]?')


@FormatChecker.cls_checks("uuid")
@Draft202012Validator.FORMAT_CHECKER.cls_checks("uuid")
def is_uuid(instance):
# Python's UUID ignores all dashes, whereas Postgres is more strict
# http://www.postgresql.org/docs/9.2/static/datatype-uuid.html
Expand All @@ -39,7 +39,7 @@ def is_accession(instance):
)


@FormatChecker.cls_checks("accession")
@Draft202012Validator.FORMAT_CHECKER.cls_checks("accession")
def is_accession_for_server(instance):
# Unfortunately we cannot access the accessionType here
if accession_re.match(instance):
Expand All @@ -51,14 +51,14 @@ def is_accession_for_server(instance):
return False


@FormatChecker.cls_checks("gene_name")
@Draft202012Validator.FORMAT_CHECKER.cls_checks("gene_name")
def is_gene_name(instance):
"""This SHOULD check a webservice at HGNC/MGI for validation, but for now this just returns True always.."""
ignored(instance)
return True


@FormatChecker.cls_checks("target_label")
@Draft202012Validator.FORMAT_CHECKER.cls_checks("target_label")
def is_target_label(instance):
if is_gene_name(instance):
return True
Expand All @@ -72,6 +72,6 @@ def is_target_label(instance):
return True


@FormatChecker.cls_checks("uri", raises=ValueError)
@Draft202012Validator.FORMAT_CHECKER.cls_checks("uri", raises=ValueError)
def is_uri(instance):
return is_valid_absolute_uri(instance)
4 changes: 2 additions & 2 deletions src/encoded/schemas/access_key.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Admin access key",
"id": "/profiles/access_key.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/access_key.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [],
"additionalProperties": false,
"mixinProperties": [
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/analysis_step.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Analysis step",
"description": "Schema for submitting a computational analysis steps as a part of a workflow.",
"id": "/profiles/analysis_step.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/analysis_step.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["name", "version", "lab", "award"],
"additionalProperties": false,
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/antibody.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Antibody",
"id": "/profiles/antibody.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/antibody.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"mixinProperties": [
{ "$ref": "mixins.json#/schema_version" },
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/award.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Grant",
"id": "/profiles/award.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/award.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [ "name"],
"identifyingProperties": ["uuid", "name", "title"],
"additionalProperties": false,
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/badge.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Badge",
"id": "/profiles/badge.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/badge.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"identifyingProperties": ["badge_name", "uuid", "aliases"],
"required": ["title", "lab", "award"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/bio_feature.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Biological Feature",
"description": "A biological feature like a Gene, Protein, Cellular Structure.",
"id": "/profiles/bio_feature.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/bio_feature.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["award", "lab", "description", "feature_type"],
"identifyingProperties": ["uuid", "aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/biosample.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Biosample",
"description": "Biological material used in the experiment with information on modifications, treatments and preparation.",
"id": "/profiles/biosample.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/biosample.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [ "biosource", "award", "lab"],
"identifyingProperties": ["uuid","accession","aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/biosample_cell_culture.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Cell culture details for biosample preparation",
"description": "Cell culture specific parameters and protocols.",
"id": "/profiles/biosample_cell_culture.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/biosample_cell_culture.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["culture_start_date", "award", "lab"],
"identifyingProperties": ["uuid", "aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/biosource.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Biosource",
"description": "General description of the biological material, e.g. cell line",
"id": "/profiles/biosource.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/biosource.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["biosource_type", "award", "lab"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/construct.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Construct",
"description": "DNA construct used for modification or treatment",
"id": "/profiles/construct.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/construct.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["name", "construct_type", "award", "lab"],
"identifyingProperties": ["uuid", "aliases", "name"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/data_release_update.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Data Release Update",
"id": "/profiles/data_release_update.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/data_release_update.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["update_tag", "award", "lab"],
"additionalProperties": false,
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/document.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Document",
"description": "Additional files like pdf, doc, txt",
"id": "/profiles/document.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/document.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["lab", "award"],
"identifyingProperties": ["uuid","aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/enzyme.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Enzyme",
"description": "DNA digestion enzymes like HindIII or DNaseI",
"id": "/profiles/enzyme.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/enzyme.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [ "name", "enzyme_source", "award", "lab"],
"identifyingProperties": ["uuid","aliases","name"],
Expand Down
6 changes: 3 additions & 3 deletions src/encoded/schemas/experiment.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"title": "Experiment",
"description": "Common metadata for all experiments.",
"id": "/profiles/experiment.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "biosample", "award", "lab"],
"identifyingProperties": ["uuid", "accession" , "aliases"],
"additionalProperties": false,
"dependencies": {
"dependentRequired": {
"biosample_quantity": ["biosample_quantity_units"],
"biosample_quantity_units": ["biosample_quantity"]
},
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/experiment_atacseq.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "ATAC-seq Experiment",
"description": "Genome-wide chromosome chromatin-accessibility experiments ATAC-seq",
"id": "/profiles/experiment_atacseq.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_atacseq.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down
6 changes: 3 additions & 3 deletions src/encoded/schemas/experiment_capture_c.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Capture Hi-C Experiment",
"description": "Hi-C coupled with oligonucleotide capture technology.",
"id": "/profiles/experiment_capture_c.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_capture_c.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down Expand Up @@ -38,7 +38,7 @@
"mixinColumns": [
{ "$ref": "experiment.json#/columns"}
],
"dependencies": {
"dependentRequired": {
"crosslinking_temperature": ["crosslinking_method", "crosslinking_time"],
"crosslinking_time": ["crosslinking_method", "crosslinking_temperature"],
"digestion_temperature": ["digestion_enzyme", "digestion_time"],
Expand Down
6 changes: 3 additions & 3 deletions src/encoded/schemas/experiment_chiapet.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Proximity Ligation with ChIP Experiment",
"description": "Proximity Ligation and Sequencing with Targeted Chromatin Immunoprecipitation.",
"id": "/profiles/experiment_chiapet.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_chiapet.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down Expand Up @@ -39,7 +39,7 @@
"mixinColumns": [
{ "$ref": "experiment.json#/columns"}
],
"dependencies": {
"dependentRequired": {
"crosslinking_temperature": ["crosslinking_method", "crosslinking_time"],
"crosslinking_time": ["crosslinking_method", "crosslinking_temperature"],
"digestion_temperature": ["digestion_enzyme", "digestion_time"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/experiment_damid.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "DAM-ID Seq Experiment",
"description": "",
"id": "/profiles/experiment_damid.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_damid.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down
6 changes: 3 additions & 3 deletions src/encoded/schemas/experiment_hi_c.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Hi-C Experiment",
"description": "Genome-wide chromosome conformation capture experiments including Hi-C, micro-C, DNase Hi-C",
"id": "/profiles/experiment_hi_c.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_hi_c.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down Expand Up @@ -37,7 +37,7 @@
"mixinColumns": [
{ "$ref": "experiment.json#/columns"}
],
"dependencies": {
"dependentRequired": {
"crosslinking_temperature": ["crosslinking_method", "crosslinking_time"],
"crosslinking_time": ["crosslinking_method", "crosslinking_temperature"],
"digestion_temperature": ["digestion_enzyme", "digestion_time"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/experiment_mic.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Microscopy Experiment",
"description": "Imaging Experiments with channel/label/target information.",
"id": "/profiles/experiment_mic.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_mic.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/experiment_repliseq.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Repli-seq Experiment",
"description": "Genome-wide analysis of replication timing by next-generation sequencing.",
"id": "/profiles/experiment_repliseq.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_repliseq.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down
6 changes: 3 additions & 3 deletions src/encoded/schemas/experiment_seq.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Sequencing Experiment",
"description": "Schema for ChIP-seq, RNA-seq and other related genomics experiments.",
"id": "/profiles/experiment_seq.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_seq.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["experiment_type", "award", "lab", "biosample"],
"identifyingProperties": ["uuid", "accession", "aliases"],
Expand Down Expand Up @@ -32,7 +32,7 @@
{ "$ref": "mixins.json#/static_embeds" },
{ "$ref": "experiment.json#/properties" }
],
"dependencies": {
"dependentRequired": {
"3p_adenylation_time": ["3p_adenylation_temperature"],
"3p_adenylation_temperature": ["3p_adenylation_time"]
},
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/experiment_set.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Experiment Set",
"description": "Schema for submitting metadata for an experiment set.",
"id": "/profiles/experiment_set.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_set.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [ "award", "lab", "description"],
"identifyingProperties": ["uuid", "aliases"],
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/schemas/experiment_set_replicate.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Replicate Experiments",
"description": "Experiment Set for technical/biological replicates.",
"id": "/profiles/experiment_set_replicate.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "/profiles/experiment_set_replicate.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [ "award", "lab", "description"],
"identifyingProperties": ["uuid", "aliases"],
Expand Down
Loading

0 comments on commit cf4db7f

Please sign in to comment.