diff --git a/.github/workflows/validate_schemas.yaml b/.github/workflows/validate_schemas.yaml new file mode 100644 index 0000000..d4c59ad --- /dev/null +++ b/.github/workflows/validate_schemas.yaml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: + - "*" + tags: + - "*" + pull_request: + +jobs: + validate_schemas: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -r tests/test_requirements.txt + pip list + + - name: Test with pytest + run: | + python -m pytest tests diff --git a/connect_aux_data/organizations.json b/connect_aux_data/organizations.json index 623721e..2e82743 100644 --- a/connect_aux_data/organizations.json +++ b/connect_aux_data/organizations.json @@ -1,399 +1,218 @@ -[{ - "canonical_name": "Sample Organization", - "aliases": [ - "Test Organization", - "Do Not Use" - ], - "description": "A sample organization for testing, and not for Production use.", - "homepage": "https://materialsdatafacility.org", - "permission_groups": [ - "5fc63928-3752-11e8-9c6f-0e00fd09bf20" - ], - "acl": [ - "5fc63928-3752-11e8-9c6f-0e00fd09bf20" - ], - "rightsList": [{ - "rightsURI": "https://example.com/license", - "rights": "Example License: No legal effect" - }], - "fundingReferences": [{ - "funderName": "Materials Data Facility", - "awardNumber": { - "awardNumber": "42" - }, - "awardTitle": "MDF Exemplary Organization Grant" - }], - "data_destinations": [ - "globus://e38ee745-6d04-11e5-ba46-22000b92c6ec/MDF/mdf_connect/test_files/deleteme_contents/" - ], - "curation": true, - "project_blocks": [], - "required_fields": [ - "dc.descriptions.description" - ], - "parent_organizations": [], - "services": {} -}, { - "canonical_name": "Advanced Photon Source", - "aliases": [ - "APS" - ], - "description": "The Advanced Photon Source is an Office of Science User Facility operated for the U.S. Department of Energy Office of Science by Argonne National Laboratory", - "homepage": "https://www.aps.anl.gov/", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - "Argonne National Laboratory" - ] -}, { +[ + { "canonical_name": "AFRL Additive Manufacturing Challenge", "aliases": [ - "MIDAS" + "MIDAS" ], "description": "Organization for AFRL Additive Manufacturing Challenge datasets", "permission_groups": [ - "fe6bbb86-74fe-11e8-b558-0a7d99bc78fe" - ], - "acl": [ - "abcb2d16-02da-11e9-87e3-0e8017bdda58" + "fe6bbb86-74fe-11e8-b558-0a7d99bc78fe" ], - "dataset_acl":[ - "abcb2d16-02da-11e9-87e3-0e8017bdda58" + "visible_to": [ + "public" ], "curation": true, - "data_destinations":[ - "globus://e55b4eab-6d04-11e5-ba46-22000b92c6ec/afrl-midas/submissions" - ] -}, { - "canonical_name": "APS Sector 1", - "aliases": [ + "mint_doi": true, + "data_destinations": [ + "globus://e55b4eab-6d04-11e5-ba46-22000b92c6ec/afrl-midas/submissions" ], + "domains": ["materials"] + }, + { + "canonical_name": "APS Sector 1", + "aliases": [], "description": "Sector 1 of the Advanced Photon Source.", "homepage": "https://www.aps.anl.gov/Users-Information/Help-Reference/Contacts/Sector-Beamline-Locations-Phones", + "mint_doi": true, "permission_groups": [ - "public" - ], - "parent_organizations": [ - "Advanced Photon Source" - ] -}, { - "canonical_name": "APS Sector 2", - "aliases": [ - ], - "description": "Sector 2 of the Advanced Photon Source.", - "homepage": "https://www.aps.anl.gov/Users-Information/Help-Reference/Contacts/Sector-Beamline-Locations-Phones", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - "Advanced Photon Source" - ] -}, { - "canonical_name": "Argonne National Laboratory", - "aliases": [ - "ANL" + "public" ], - "description": "Argonne serves America as a science and energy laboratory distinguished by the breadth of our R&D capabilities in concert with our powerful suite of experimental and computational facilities.", - "homepage": "https://www.anl.gov/", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - ] -}, { - "canonical_name": "Center for Hierarchical Materials Design", - "aliases": [ - "CHiMaD" - ], - "description": "Center for Hierarchical Materials Design (CHiMaD) is a NIST-sponsored center of excellence for advanced materials research focusing on developing the next generation of computational tools, databases and experimental techniques in order to enable the accelerated design of novel materials and their integration to industry, one of the primary goals of the U.S. Government's Materials Genome Initiative (MGI).", - "homepage": "http://chimad.northwestern.edu/", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - "National Institute of Standards and Technology" - ] -}, { - "canonical_name": "Center for Predictive Integrated Structural Materials Science", - "aliases": [ - "PRISMS", - "Department of Energy Software Innovation Center for Integrated Multi-Scale Modeling of Structural Metals" - ], - "description": "Combining the efforts of experimental and computational researchers, the overarching goal of the PRISMS Center is to establish a unique scientific platform that will enable accelerated predictive materials science for structural metals.", - "homepage": "http://prisms-center.org/", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - ] -}, { - "canonical_name": "Center for Predictive Simulation of Functional Materials", - "aliases": [ - "CPSFM" - ], - "description": "The Center for Predictive Simulation of Functional Materials develops, applies, validates, and disseminates parameter-free methods, open source codes, and scientific data to predict and explain the properties of functional materials for energy applications.", - "homepage": "https://cpsfm.ornl.gov", - "permission_groups": [ - "cc192dca-3751-11e8-90c1-0a7c735d220a" - ], - "acl": [ - "public" - ] -}, { - "canonical_name": "High Throughput Experimental Materials Database", - "aliases": [ - "HTEM" - ], - "description": "The HTEM DB contains information about materials obtained from high-throughput experiments at NREL.", - "homepage": "https://htem.nrel.gov/", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - "National Renewable Energy Laboratory" - ] -}, { - "canonical_name": "Materials Commons", - "aliases": [ - "MCPub" + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/mdf_open/" ], - "description": "The Materials Commons is a platform for organizing, collaborating, publishing and sharing research data.", - "homepage": "https://materialscommons.org/", - "permission_groups": [ - "public" + "visible_to": [ + "public" ], - "parent_organizations": [ - "Center for Predictive Integrated Structural Materials Science" - ] -}, { + "domains": ["materials"], + "curation": false + }, + { "canonical_name": "MDF Open", "aliases": [ - "Open" + "Open" ], "description": "A template for open and published data.", "permission_groups": [ - "cc192dca-3751-11e8-90c1-0a7c735d220a" + "cc192dca-3751-11e8-90c1-0a7c735d220a" ], - "acl": [ - "public" + "visible_to": [ + "public" ], "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/mdf_open/" - } - } -}, { + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/mdf_open/" + ], + "domains": ["materials"] + }, + { "canonical_name": "NanoMFG", "description": "The aim of the nanomanufacturing (nanoMFG) node is to develop computational software tools aimed at creating smart, model-driven and experimentally informed nanomanufactured structures and devices.", "homepage": "https://nanohub.org/groups/nanomfg", + "mint_doi": true, "permission_groups": [ - "ad88f7cb-cf53-11e9-8526-0e161d24c936" + "ad88f7cb-cf53-11e9-8526-0e161d24c936" ], - "project_blocks": [ - "nanomfg" - ], - "parent_organizations": [ - "National Science Foundation" - ] -}, { - "canonical_name": "National Institute of Standards and Technology", - "aliases": [ - "NIST" - ], - "description": "The National Institute of Standards and Technology (NIST) was founded in 1901 and is now part of the U.S. Department of Commerce. NIST is one of the nation's oldest physical science laboratories.", - "homepage": "https://www.nist.gov/", - "permission_groups": [ - "public" - ], - "parent_organizations": [ - ] -}, { - "canonical_name": "National Renewable Energy Laboratory", - "aliases": [ - "NREL" + "visible_to": [ + "public" ], - "description": "The National Renewable Energy Laboratory is a national laboratory of the U.S. Department of Energy, Office of Energy Efficiency and Renewable Energy, operated by the Alliance for Sustainable Energy, LLC.", - "homepage": "https://www.nrel.gov/", - "permission_groups": [ - "public" + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/mdf_open/" ], - "parent_organizations": [ - ] -}, { - "canonical_name": "National Science Foundation", - "aliases": [ - "NSF" + "project_blocks": [ + "nanomfg" ], - "description": "The National Science Foundation (NSF) is an independent federal agency created by Congress in 1950 \"to promote the progress of science; to advance the national health, prosperity, and welfare; to secure the national defense...\"", - "homepage": "https://nsf.gov/", - "permission_groups": [ - "public" - ] -}, { + "domains": ["materials"], + "curation": true + }, + { "canonical_name": "NIST Materials Data Repository", "aliases": [ - "NIST MDR", - "MDR" + "NIST MDR", + "MDR" ], "description": "The National Institute of Standards and Technology has created a materials science data repository as part of an effort in coordination with the Materials Genome Initiative (MGI) to establish data exchange protocols and mechanisms that will foster data sharing and reuse across a wide community of researchers, with the goal of enhancing the quality of materials data and models.", "homepage": "https://materialsdata.nist.gov/", + "mint_doi": false, "permission_groups": [ - "public" + "public" ], - "parent_organizations": [ - "National Institute of Standards and Technology" - ] -}, { - "canonical_name": "Polymer Property Predictor and Database", - "aliases": [ - "PPPDB" - ], - "description": "An organization to support the Polymer Property Predictor and Database", - "permission_groups": [ - "5773d4af-d316-11e9-9c88-0ad4acb67ed4" + "visible_to": [ + "public" ], - "acl": [ - "public" + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/mdf_open/" ], - "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/pppdb/" - } - } -}, { + "domains": ["materials"], + "curation": false + }, + { "canonical_name": "Virtual Excited State Reference for the Discovery of Electronic Materials Database", "aliases": [ - "VERDE", - "VERDE DB", - "VERDE Materials DB" + "VERDE", + "VERDE DB", + "VERDE Materials DB" ], "description": "An organization to support the VERDE Materials DB", "permission_groups": [ - "cc35fe9d-d312-11e9-9c88-0ad4acb67ed4" + "cc35fe9d-d312-11e9-9c88-0ad4acb67ed4" ], - "acl": [ - "public" + "visible_to": [ + "public" ], "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/verde/" - } - } -}, -{ - "canonical_name": "XPCS 8-ID", - "description": "XPCS Beamline 8-ID at Argonne National Laboratory's Advanced Photon Source (APS)", - "permission_groups": [ - "13d05c3b-0a3e-11ea-94e3-0a9045086069" - ], - "acl": [ - "13d05c3b-0a3e-11ea-94e3-0a9045086069" + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/verde/" ], - "curation": true, - "parent_organizations": [ - "Advanced Photon Source" - ], - "services": { - "mdf_publish": { - "publication_location": "globus://e55b4eab-6d04-11e5-ba46-22000b92c6ec/XPCSDATA/MDF/" - } - } -},{ + "domains": ["materials"] + }, + { "canonical_name": "Hersam Group", "description": "Hersam Group organization", "permission_groups": [ - "a422c034-13a3-11e6-8367-22000ab80e73" + "a422c034-13a3-11e6-8367-22000ab80e73" ], - "acl": [ - "ea14d488-13a3-11e6-81e9-22000aef184d" - ], - "dataset_acl":[ - "public" + "visible_to": [ + "public" ], "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/hersam_protected/" - } - } -},{ + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/hersam_protected/" + ] + }, + { "canonical_name": "Lauhon Group", "description": "Lauhon Group organization", "permission_groups": [ - "8eca1609-0994-11eb-ab07-0a15f6c86f93" + "8eca1609-0994-11eb-ab07-0a15f6c86f93" ], - "acl": [ - "b62955ff-0994-11eb-a171-0aba59fa28e5" - ], - "dataset_acl":[ - "public" + "visible_to": [ + "public" ], "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/lauhon_protected/" - } - } -},{ + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/lauhon_protected/" + ], + "domains": ["materials"] + }, + { "canonical_name": "Foundry", "description": "Foundry data package organization", "permission_groups": [ - "42a7a77c-4789-11ea-95b7-0ef992ed7ca1" + "42a7a77c-4789-11ea-95b7-0ef992ed7ca1" ], - "acl": [ - "public" + "visible_to": [ + "public" ], - "dataset_acl":[ - "public" + "curation": true, + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/foundry/" + ], + "domains": ["materials"] + }, + { + "canonical_name": "Foundry-dev", + "description": "Foundry dataset organization", + "permission_groups": [ + "cc192dca-3751-11e8-90c1-0a7c735d220a" + ], + "visible_to": [ + "public" ], "curation": true, - "project_blocks":["foundry"], - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/foundry/" - } - } -}, -{ + "mint_doi": true, + "project_blocks": [ + "foundry-dev" + ], + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/foundry/" + ], + "domains": ["materials"] + }, + { "canonical_name": "Electrochemical Energy Lab", "description": "Electrochemical Energy Lab at MIT", "permission_groups": [ - "cd106a54-6635-11eb-bfe2-0aa21a0136a3" + "cd106a54-6635-11eb-bfe2-0aa21a0136a3" ], - "acl": [ - "cd106a54-6635-11eb-bfe2-0aa21a0136a3" - ], - "dataset_acl":[ - "cd106a54-6635-11eb-bfe2-0aa21a0136a3" + "visible_to": [ + "urn:globus:groups:id:cd106a54-6635-11eb-bfe2-0aa21a0136a3" ], "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/EEL_protected/" - } - } -}, -{ + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/EEL_protected/" + ], + "domains": ["materials"] + }, + { "canonical_name": "Differentiate Catalysis", "description": "Differentiate Catalysis Team", "permission_groups": [ - "4421683d-665e-11eb-b92d-0a4debe59093" + "4421683d-665e-11eb-b92d-0a4debe59093" ], - "acl": [ - "4421683d-665e-11eb-b92d-0a4debe59093" - ], - "dataset_acl":[ - "4421683d-665e-11eb-b92d-0a4debe59093" + "visible_to": [ + "urn:globus:groups:id:4421683d-665e-11eb-b92d-0a4debe59093" ], "curation": true, - "services": { - "mdf_publish": { - "publication_location": "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/differentiate_protected/" - } - } -} -] + "mint_doi": true, + "data_destinations": [ + "globus://82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/differentiate_protected/" + ], + "domains": ["materials"] + } +] \ No newline at end of file diff --git a/schemas/connect_submission.json b/schemas/connect_submission.json index ad337ef..fcc47b4 100644 --- a/schemas/connect_submission.json +++ b/schemas/connect_submission.json @@ -23,13 +23,9 @@ "type": "string", "description": "A unique program-friendly name for this dataset (will be generated from the title if not specified)." }, - "organizations": { - "type": "array", - "description": "The organizations responsible for dataset creation. Adding organizations here will apply any organizational rules and requirements to the dataset.", - "items": { - "type": "string", - "description": "Name of an organization (e.g., NIST)." - } + "organization": { + "type": "string", + "description": "The organization responsible for dataset creation. Will apply any organizational rules and requirements to the dataset." } }, "additionalProperties": false @@ -248,14 +244,14 @@ "type": "boolean", "description": "Must be true for dataset updates, and false for new datasets. Serves as a check against accidental dataset overwriting." }, - "incremental_update": { - "type": "string", - "description": "Set to a source_id previously submitted to perform an incremental update of that source_id, changing only the other metadata provided in this submission." - }, - "curation": { + "update_metadata_only": { "type": "boolean", - "description": "When true, trigger curation for this submission. This is normally set by an organization." + "description": "When true performs an update on the metadata only with no file transfer." }, + "mint_doi": { + "type": "boolean", + "description": "When true mints doi for file." + }, "dataset_acl": { "type": "array", "description": "The UUIDs of Users or Groups allowed to view only the dataset entry, or the special (and default) value 'public'. This does not grant permission to view records or files in the dataset, only the dataset entry itself.", diff --git a/schemas/internal_status.json b/schemas/internal_status.json index f376b2d..17a5cba 100644 --- a/schemas/internal_status.json +++ b/schemas/internal_status.json @@ -73,6 +73,22 @@ "type": "string", "description": "The original Connect submission, as a JSON string." }, + "action_id": { + "type": "string", + "description": "The Globus Automate ID of the action processing this record." + }, + "version": { + "type": "string", + "description": "SemVer version string for this submission" + }, + "previous_versions": { + "type": "array", + "description": "Ordered list of previous versions", + "items": { + "type": "string", + "description": "Versioned SourceID" + } + }, "updates": { "type": "array", "description": "Any submitted updates ot the original submission." @@ -88,6 +104,10 @@ "hibernating": { "type": "boolean", "description": "True for submission processes that appear dead, but are still active. This flag will prevent a submission from being cancelled when its process dies." + }, + "update_metadata_only": { + "type": "boolean", + "description": "True when update without file transfer" } }, "additionalProperties": false, @@ -103,6 +123,7 @@ "submitter", "test", "title", - "user_id" + "user_id", + "version" ] } diff --git a/schemas/mdf.json b/schemas/mdf.json index 66484c4..71809f4 100644 --- a/schemas/mdf.json +++ b/schemas/mdf.json @@ -28,6 +28,14 @@ }, "minItems": 1 }, + "domains": { + "type": "array", + "description": "Facility domains of the dataset. e.g., materials, chemistry.", + "items": { + "type": "string", + "description": "One facility domain. e.g., materials" + } + }, "ingest_date": { "type": "string", "format": "date-time", diff --git a/schemas/organization.json b/schemas/organization.json index 6f668a6..0504f3b 100644 --- a/schemas/organization.json +++ b/schemas/organization.json @@ -34,28 +34,14 @@ }, "minItems": 1 }, - "acl": { + "visible_to": { "type": "array", - "description": "The minimum Access Control List for full access to datasets in this organization.", + "description": "This is a list of security principals allowed to read the metadata.", "items": { "type": "string", - "description": "One Globus Auth UUID or the special value 'public' to require all datasets be fully public." + "description": "Each string will be in the form of a Principal URN, or the special string \"public\"" } }, - "dataset_acl": { - "type": "array", - "description": "The minimum Access Control List for access to dataset entries in this organization. This does not grant permission to access records or files from datasets, only permission to see the dataset entry itself.", - "items": { - "type": "string", - "description": "One Globus Auth UUID (for one Globus Auth identity or Globus Group) or the special value 'public' to require all dataset entries be public." - } - }, - "rightsList": { - "$ref": "dc.json#/properties/dc/properties/rightsList" - }, - "fundingReferences": { - "$ref": "dc.json#/properties/dc/properties/fundingReferences" - }, "data_destinations": { "type": "array", "description": "Data locations (which must be Globus endpoints) to send data for this organization.", @@ -68,37 +54,33 @@ "type": "boolean", "description": "Whether or not curation is required for all datasets in this organization." }, - "project_blocks": { - "type": "array", - "description": "The special project blocks associated with this organization's metadata.", - "items": { - "type": "string", - "description": "One project block name." - } + "mint_doi": { + "type": "boolean", + "description": "Whether datasets submitted to this organization mint a Digital Object Identifier" }, - "required_fields": { + "domains": { "type": "array", - "description": "Fields or blocks in the dataset metadata that are required for an organizational dataset to be valid, using dot syntax.", + "description": "Facility domains of the submission. e.g., materials, chemistry.", "items": { "type": "string", - "description": "One required field or block in the dataset metadata." + "description": "One facility domain. e.g., materials" } }, - "parent_organizations": { + "project_blocks": { "type": "array", - "descriptions": "The organization(s) that are direct parents to this one. Grandparent organizations are implied and should not be specified.", + "description": "The special project blocks associated with this organization's metadata.", "items": { "type": "string", - "description": "The canonical_name of one parent organization." + "description": "One project block name." } - }, - "services": { - "$ref": "services.json#/properties/services" } }, - "additionalProperties": false, "required": [ "canonical_name", - "permission_groups" + "permission_groups", + "visible_to", + "data_destinations", + "mint_doi", + "curation" ] } diff --git a/schemas/projects.json b/schemas/projects.json index 621bce6..1ba897c 100644 --- a/schemas/projects.json +++ b/schemas/projects.json @@ -110,61 +110,110 @@ }, "foundry": { "type": "object", - "description": "Project block for Foundry data packages.", + "description": "Project block for Foundry datasets.", + "additionalProperties": false, "properties": { - "inputs":{ - "type":"array", - "items": { - "type": "string" - } + "short_name": { + "type": "string" }, - "input_descriptions":{ - "type":"array", - "items": { - "type": "string" - } + "data_type": { + "type": "string", + "description": "The kind of data in the dataset, e.g. tabular, json, hdf5" }, - "input_units":{ - "type":"array", - "items": { + "task_type": { + "type": "array", + "description": "The type of task. e.g., supervised, unsupervised, generative.", + "items": { "type": "string" } }, - "outputs":{ - "type":"array", - "items": { + "domain": { + "type": "array", + "description": "The domain of applicability. e.g., materials science, chemistry, machine vision", + "items": { "type": "string" } }, - "output_descriptions":{ - "type":"array", - "items": { - "type": "string" - } + "n_items": { + "description": "The number of total items in the dataset including all splits.", + "type": "number" }, - "output_units":{ - "type":"array", - "items": { - "type": "string" + "splits": { + "type": "array", + "description": "Define all partitions of the dataset (train, test, validation, etc.)", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": "The kind of partition of the dataset (train, test, validation, etc)" + }, + "path": { + "type": "string", + "description": "The full filepath to the dataset file or directory" + }, + "label": { + "type": "string", + "description": "A label to assign to this split" + } + } } }, - "output_labels":{ - "type":"array", - "items": { - "type": "string" + "keys": { + "type": "array", + "description": "Keys describing how to load the data", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "key": { + "type": "array", + "description": "Column or header name for tabular data, key/path for HDF5 data", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "description": "Whether input or target" + }, + "filter": { + "type": "string", + "description": "How apply the defined key" + }, + "description": { + "type": "string", + "description": "Free text description of the key" + }, + "units": { + "type": "string", + "description": "The units associated with the key" + }, + "classes": { + "type": "array", + "items": { + "type": "object" + }, + "additionalProperties": false, + "properties": { + "label": { + "type": "string", + "description": "The label that exists in the data" + }, + "name": { + "type": "string", + "description": "The name the label maps onto." + } + } + } + } } - }, - "short_name":{ - "type":"string" - }, - "package_type":{ - "type":"string" } - }, - "additionalProperties": false + } } }, "additionalProperties": false } } -} +} \ No newline at end of file diff --git a/tests/test_files/connect_submission/success_max_alt.json b/tests/test_files/connect_submission/success_max_alt.json index bf90def..101f574 100644 --- a/tests/test_files/connect_submission/success_max_alt.json +++ b/tests/test_files/connect_submission/success_max_alt.json @@ -113,7 +113,7 @@ }, "mdf": { "acl": ["public"], - "organizations": ["Org1", "Org2"], + "organization": "Org1", "source_name": "src_nm" }, "mrr": { diff --git a/tests/test_files/connect_submission/success_maximal.json b/tests/test_files/connect_submission/success_maximal.json index 16b6094..857daf1 100644 --- a/tests/test_files/connect_submission/success_maximal.json +++ b/tests/test_files/connect_submission/success_maximal.json @@ -112,7 +112,7 @@ }, "mdf": { "acl": ["public"], - "organizations": ["Org1", "Org2"], + "organization": "Org1", "source_name": "src_nm" }, "mrr": { diff --git a/tests/test_files/internal_status/success_maximal.json b/tests/test_files/internal_status/success_maximal.json index b953c3b..8b68e0f 100644 --- a/tests/test_files/internal_status/success_maximal.json +++ b/tests/test_files/internal_status/success_maximal.json @@ -18,6 +18,7 @@ "user_email": "test@example.com", "user_id": "abc123", "original_submission": "{...}", + "version": "1.0", "extensions": [ "json" ], diff --git a/tests/test_files/internal_status/success_minimal.json b/tests/test_files/internal_status/success_minimal.json index c7dd914..e37c4df 100644 --- a/tests/test_files/internal_status/success_minimal.json +++ b/tests/test_files/internal_status/success_minimal.json @@ -14,5 +14,6 @@ "submitter": "Tester McPerson", "user_id": "abc123", "test": true, + "version": "1.0", "title": "Thing" } diff --git a/tests/test_schemas.py b/tests/test_schemas.py index 17fb400..bce2284 100644 --- a/tests/test_schemas.py +++ b/tests/test_schemas.py @@ -31,6 +31,7 @@ def test_sample_validation(): "internal_status" ] for schema_name in jsonschemas_to_test: + print("Schema ", schema_name) # Get schema with open(os.path.join(SCHEMA_PATH, schema_name+".json")) as f: schema = json.load(f) @@ -40,6 +41,7 @@ def test_sample_validation(): # Run all test cases test_files_dir = os.path.join(TEST_FILES_PATH, schema_name) for test_file in os.listdir(test_files_dir): + print("....Test ", test_file) with open(os.path.join(test_files_dir, test_file)) as t: test_case = json.load(t) # Success cases start with "success", failure cases start with "failure"