-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from HEPData/submission-linking
Changes for related data update.
- Loading branch information
Showing
20 changed files
with
384 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,6 @@ target/ | |
|
||
# Downloaded schemas | ||
hepdata_validator/schemas_remote/ | ||
|
||
# venv | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
hepdata_validator/schemas/1.1.1/additional_info_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://hepdata.net/submission/schemas/1.1.1/additional_info_schema.json", | ||
"title": "Additional information", | ||
"description": "Optional information concerning a whole submission rather than individual data tables", | ||
"type": "object", | ||
"properties": { | ||
"record_ids": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"type": { "type": [ "string" ] }, | ||
"id": { "type": [ "string", "number" ] } | ||
}, | ||
"required": [ "type", "id" ], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"preprintyear": { | ||
"type": "string", | ||
"title": "Preprint Year", | ||
"description": "Indicates the year when the submission preprint was first available.", | ||
"name": "preprintyear" | ||
}, | ||
"publicationyear": { | ||
"type": "string", | ||
"title": "Publication Year", | ||
"description": "Indicates the year when the submission publication was available.", | ||
"name": "publicationyear" | ||
}, | ||
"dateupdated": { | ||
"type": "string", | ||
"title": "Date Updated", | ||
"description": "Indicates when the submission was last updated.", | ||
"name": "dateupdated" | ||
}, | ||
"modifications": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"action": { "type": "string" }, | ||
"who": { "type": "string" } | ||
}, | ||
"required": [ "action", "who" ] | ||
} | ||
}, | ||
"additional_resources": { | ||
"$ref": "additional_resources_schema.json" | ||
}, | ||
"comment": { | ||
"type": "string", | ||
"description": "Information that applies to all data tables." | ||
}, | ||
"related_to_hepdata_records" : { | ||
"type" : "array", | ||
"uniqueItems": true, | ||
"items" : {"type" : "integer", "minimum": 1} | ||
} | ||
}, | ||
"additionalProperties": true | ||
} |
26 changes: 26 additions & 0 deletions
26
hepdata_validator/schemas/1.1.1/additional_resources_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://hepdata.net/submission/schemas/1.1.1/additional_resources_schema.json", | ||
"title": "Additional resources", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"location": { "type": "string", "maxLength": 256 }, | ||
"description": { "type": "string" }, | ||
"type": { "type": "string", "maxLength": 64 }, | ||
"license": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "maxLength": 256 }, | ||
"url": { "type": "string", "maxLength": 256 }, | ||
"description": { "type": "string" } | ||
}, | ||
"required": [ "name", "url" ], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": [ "location", "description" ], | ||
"additionalProperties": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://hepdata.net/submission/schemas/1.1.1/data_schema.json", | ||
"title": "Data table", | ||
"description": "A HEPData table comprising independent_variables and dependent_variables", | ||
"type": "object", | ||
"properties": { | ||
"independent_variables": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"header": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"units": { "type": "string" } | ||
}, | ||
"required": [ "name" ], | ||
"additionalProperties": false | ||
}, | ||
"values": { | ||
"type": "array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"value": { "type": [ "string", "number" ] } | ||
}, | ||
"required": ["value"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"value": { "type": "number" }, | ||
"low": { "type": "number" }, | ||
"high": { "type": "number" } | ||
}, | ||
"required": ["low", "high"], | ||
"additionalProperties": false | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"required": [ "header", "values" ], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"dependent_variables": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"header": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"units": { "type": "string" } | ||
}, | ||
"required": [ "name" ], | ||
"additionalProperties": false | ||
}, | ||
"qualifiers": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"value": { "type": [ "string", "number" ] }, | ||
"units": { "type": "string" } | ||
}, | ||
"required": [ "name", "value" ], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"values": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"type": [ "string", "number" ] | ||
}, | ||
"errors": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"symerror": { "type": [ "number", "string" ] }, | ||
"asymerror": { | ||
"type": "object", | ||
"properties": { | ||
"minus": { "type": [ "number", "string" ] }, | ||
"plus": { "type": [ "number", "string" ] } | ||
}, | ||
"required": [ "minus", "plus" ], | ||
"additionalProperties": false | ||
}, | ||
"label": { "type": "string" } | ||
}, | ||
"oneOf": [{"required": [ "symerror" ]}, {"required": [ "asymerror" ]}], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": [ "value" ], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": [ "header", "values" ], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": [ "independent_variables", "dependent_variables" ], | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://hepdata.net/submission/schemas/1.1.1/submission_schema.json", | ||
"title": "Submission table", | ||
"description": "Metadata for a HEPData table apart from independent_variables and dependent_variables", | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "maxLength": 64 }, | ||
"location": { "type": "string", "maxLength": 256 }, | ||
"description": { "type": "string"}, | ||
"keywords": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "maxLength": 128, "enum": ["cmenergies", "observables", "reactions", "phrases"] }, | ||
"values": { | ||
"type": "array", | ||
"items": { "type": [ "string", "number" ], "maxLength": 128 } | ||
} | ||
}, | ||
"required": [ "name", "values" ], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"data_file": { "type": "string" }, | ||
"data_schema": { | ||
"type": "string", | ||
"description": "Remote location of the JSON schema for the data_file" | ||
}, | ||
"data_license": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "maxLength": 256 }, | ||
"url": { "type": "string", "maxLength": 256 }, | ||
"description": { "type": "string" } | ||
}, | ||
"required": [ "name", "url" ], | ||
"additionalProperties": false | ||
}, | ||
"additional_resources": { | ||
"$ref": "additional_resources_schema.json" | ||
}, | ||
"table_doi": { | ||
"type": "string", | ||
"description": "Present if a user downloads YAML from an existing HEPData record" | ||
}, | ||
"related_to_table_dois" : { | ||
"type" : "array", | ||
"uniqueItems": true, | ||
"items" : {"type" : "string", "maxLength" : 128, "pattern" : "^10\\.17182\/hepdata\\.\\d+\\.v\\d+\/t\\d+$" } | ||
} | ||
}, | ||
"required": ["name", "description", "keywords", "data_file"], | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.0/additional_info_schema.json | ||
1.1.1/additional_info_schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.0/additional_resources_schema.json | ||
1.1.1/additional_resources_schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.0/data_schema.json | ||
1.1.1/data_schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.0/submission_schema.json | ||
1.1.1/submission_schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ | |
|
||
from __future__ import absolute_import, print_function | ||
|
||
__version__ = "0.3.3" | ||
__version__ = "0.3.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
independent_variables: [] | ||
dependent_variables: | ||
- header: {name: TestData1, units: NA} | ||
qualifiers: | ||
- {name: TestData1, value: 0} | ||
values: | ||
- value: 0 |
16 changes: 16 additions & 0 deletions
16
testsuite/test_data/TestRelatedSubmissions/invalid_submission_doi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
comment: "Test Text" | ||
--- | ||
name: "Table 1" | ||
description: Words | ||
keywords: | ||
- {name: reactions, values: []} | ||
data_file: data1.yaml | ||
related_to_table_dois: | ||
- 1 | ||
- "10.17182/hepdata.1" | ||
- "10.17182/hepdata.1.v1" | ||
- "10.17182/hepdata.1.v1/" | ||
- "10.17182/hepdata.1.v1/a2" | ||
- "10.17182/hepdata.1.v1/t1" | ||
- "10.17182/hepdata.1.v1/t1" |
9 changes: 9 additions & 0 deletions
9
testsuite/test_data/TestRelatedSubmissions/invalid_submission_recid.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
comment: "Test Text" | ||
related_to_hepdata_records: ["a", b, 0, 1, 1] | ||
--- | ||
name: "Table 1" | ||
description: Words | ||
keywords: | ||
- {name: reactions, values: []} | ||
data_file: data1.yaml |
12 changes: 12 additions & 0 deletions
12
testsuite/test_data/TestRelatedSubmissions/valid_submission_related.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
description: "Test Data" | ||
comment: Test | ||
related_to_hepdata_records: | ||
- 1 | ||
--- | ||
name: "Table 1" | ||
description: Words | ||
keywords: | ||
- {name: cmenergies, values: [0]} | ||
data_file: data1.yaml | ||
related_to_table_dois: | ||
- "10.17182/hepdata.1.v1/t1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.