Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 27 additions & 7 deletions .github/workflows/schema-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ on:
workflow_dispatch:

env:
SCHEMA_DIR: au.org.access-nri/model/output/file-metadata/2-0-0
TEST_DIR: tests/2-0-0
SCHEMA_DIRS: |
au.org.access-nri/model/output/file-metadata/2-0-0
au.org.access-nri/model/output/file-metadata/2-1-0
# TEST_DIRS need to have matching SCHEMA_DIRS in the same order
Comment thread
aidanheerdegen marked this conversation as resolved.
TEST_DIRS: |
tests/2-0-0
tests/2-1-0

jobs:
schema-tests:
Expand All @@ -18,16 +23,31 @@ jobs:
- uses: actions/checkout@v4

- name: Install the Sourcemeta JSON Schema CLI
uses: sourcemeta/jsonschema@v11.8.3
uses: sourcemeta/jsonschema@f0b6672d82955e58a73efd320068284a4e7a4483 #v14.14.2

- name: Check schemas against their metaschemas
run: jsonschema metaschema --verbose $SCHEMA_DIR
run: jsonschema metaschema --verbose $SCHEMA_DIRS

- name: Check schemas are formatted
run: jsonschema fmt --check --verbose $SCHEMA_DIR
run: jsonschema fmt --check --verbose $SCHEMA_DIRS

- name: Lint schemas
run: jsonschema lint --verbose --exclude enum_with_type $SCHEMA_DIR
run: |
jsonschema lint --verbose \
--exclude enum_with_type \
--exclude description_trailing_period \
--exclude top_level_examples \
$SCHEMA_DIRS

- name: Run test suite
run: jsonschema test --verbose $TEST_DIR --resolve $SCHEMA_DIR
run: |
# Need to iterate through each pair of DIRS since there will be name
# collisions with different versions of the same schema
# Turn the strings into arrays of strings first
test_arr=($TEST_DIRS)
schema_arr=($SCHEMA_DIRS)
for i in "${!test_arr[@]}"; do
test_dir=${test_arr[i]}
schema_dir=${schema_arr[i]}
jsonschema test --verbose $test_dir --resolve $schema_dir
done
28 changes: 28 additions & 0 deletions au.org.access-nri/model/output/file-metadata/2-1-0/2-1-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ACCESS ESM1.6 Model Output Data Specification",
"description": "The metadata associated with a file containing or referencing climate model data",
"type": "object",
"required": [ "global", "variables" ],
"properties": {
"global": {
"$ref": "global.json"
},
"variables": {
"type": "object",
"properties": {
"time": {
"$ref": "variable/time.json"
},
"time_bnds": {
"$ref": "variable/time_bnds.json"
}
},
"patternProperties": {
"^.+$": {
"$ref": "variable.json"
}
}
}
}
}
101 changes: 101 additions & 0 deletions au.org.access-nri/model/output/file-metadata/2-1-0/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global.json",
"title": "ACCESS Global Attributes",
"description": "File-level metadata for ACCESS ESM1.6 data",
"type": "object",
"required": [
"base_configuration",
"contact",
"Conventions",
"date_created",
"data_specification",
"experiment_repo",
"experiment_uuid",
"frequency",
"geospatial_lat_max",
"geospatial_lat_min",
"geospatial_lon_max",
"geospatial_lon_min",
"license",
"model_version",
"model",
"realm",
"run_id",
"title"
],
"properties": {
"title": {
"$ref": "global/title.json"
},
"Conventions": {
"$ref": "global/Conventions.json"
},
"base_configuration": {
"$ref": "global/base_configuration.json"
},
"contact": {
"$ref": "global/contact.json"
},
"data_specification": {
"$ref": "global/data_specification.json"
},
"date_created": {
"$ref": "global/date_created.json"
},
"date_metadata_modified": {
"$ref": "global/date_metadata_modified.json"
},
"date_modified": {
"$ref": "global/date_modified.json"
},
"experiment_repo": {
"$ref": "global/experiment_repo.json"
},
"experiment_uuid": {
"$ref": "global/experiment_uuid.json"
},
"frequency": {
"$ref": "global/frequency.json"
},
"geospatial_lat_max": {
"$ref": "global/geospatial_lat_max.json"
},
"geospatial_lat_min": {
"$ref": "global/geospatial_lat_min.json"
},
"geospatial_lat_units": {
"$ref": "global/geospatial_lat_units.json"
},
"geospatial_lon_max": {
"$ref": "global/geospatial_lon_max.json"
},
"geospatial_lon_min": {
"$ref": "global/geospatial_lon_min.json"
},
"geospatial_lon_units": {
"$ref": "global/geospatial_lon_units.json"
},
"grid": {
"$ref": "global/grid.json"
},
"license": {
"$ref": "global/license.json"
},
"model": {
"$ref": "global/model.json"
},
"model_version": {
"$ref": "global/model_version.json"
},
"realm": {
"$ref": "global/realm.json"
},
"run_id": {
"$ref": "global/run_id.json"
},
"variable_id": {
"$ref": "global/variable_id.json"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/Conventions.json",
"title": "Conventions",
"description": "Convention(s) used with their versions, as a comma separated list",
"examples": [ "CF-1.11,ACDD-1.3" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/base_configuration.json",
"title": "base_configuration",
"description": "Configuration modified for experiment, see configs repo: https://github.com/ACCESS-NRI/access-esm1.6-configs",
"examples": [ "release-preindustrial+concentrations-2.0" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/contact.json",
"title": "contact",
"description": "Email address or other contact details for who to contact regarding this data.",
"examples": [ "access.nri@anu.edu.au", "John Smith (john.smith@email.com)" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/data_specification.json",
"title": "data_specification",
"description": "Version of this data specification used to generate the data",
"examples": [ "ACCESS Output Data Specification v2-1-0 XX.XXXX/zenodo.XXXXX" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/date_created.json",
"title": "date_created",
"description": "Date and time the file was created. Follow ISO 8601, i.e. 'YYYY-MM-DDTHH:MM:SSZ'",
"$comment": "",
"examples": [ "2025-10-07T11:10:00Z" ],
"type": "string",
"pattern": "^\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/date_metadata_modified.json",
"title": "date_metadata_modified",
"description": "Date and time the metadata for this file was last modified. Note that this applied just to the metadata, not the data. Follow ISO 8601, i.e. 'YYYY-MM-DDTHH:MM:SSZ'",
"$comment": "",
"examples": [ "2025-10-07T11:10:00Z" ],
"type": "string",
"pattern": "^\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/date_modified.json",
"title": "date_modified",
"description": "Date and time the data for this file was last modified. Note that this applied just to the data, not the metadata. Follow ISO 8601, i.e. 'YYYY-MM-DDTHH:MM:SSZ'",
"$comment": "",
"examples": [ "2025-10-07T11:10:00Z" ],
"type": "string",
"pattern": "^\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/experiment_repo.json",
"title": "experiment_repo",
"description": "Git repository URL that describes the experiment",
"examples": [
"https://github.com/ACCESS-Community-Hub/access-esm1.6-dev-experiments"
],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/experiment_uuid.json",
"title": "experiment_uuid",
"description": "The experiment UUID generated by Payu. Note: this may be the same as id.",
"examples": [ "698E600B-BECF-4CBA-994F-A663A22FCDDF" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/frequency.json",
"title": "frequency",
"description": "Sampling frequency of the data",
"examples": [ "12hr", "1day", "1yr" ],
"type": "string",
"oneOf": [
{
"pattern": "^fx$"
},
{
"pattern": "^subhr$"
},
{
"pattern": "^\\d+min$"
},
{
"pattern": "^\\d+hr$"
},
{
"pattern": "^\\d+day$"
},
{
"pattern": "^\\d+mon$"
},
{
"pattern": "^\\d+yr$"
},
{
"pattern": "^\\d+dec$"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/geospatial_lat_max.json",
"title": "geospatial_lat_max",
"description": "Specifies the northernmost latitude covered by the dataset. Units should be \"degrees North\".",
"examples": [ 90, 12.98 ],
"type": "number"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/geospatial_lat_min.json",
"title": "geospatial_lat_min",
"description": "Specifies the southernmost latitude covered by the dataset. Units should be \"degrees North\".",
"examples": [ -90, -57.97 ],
"type": "number"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/geospatial_lat_units.json",
"title": "geospatial_lat_units",
"description": "Units for the latitude axis described in \"geospatial_lat_min\" and \"geospatial_lat_max\" attributes. These should be \"degrees_north\".",
"const": "degrees_north"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/geospatial_lon_max.json",
"title": "geospatial_lon_max",
"description": "Specifies the easternmost longitude covered by the dataset. Units should be \"degrees East\". Cases where geospatial_lon_min is greater than geospatial_lon_max indicate the bounding box extends from geospatial_lon_max, through the longitude range discontinuity meridian (e.g. the antimeridian for -180:180 values ranges) to geospatial_lon_min; for example, geospatial_lon_min=170 and geospatial_lon_max=-175 incorporates 15 degrees of longitude (ranges 170 to 180 and -180 to -175).",
"examples": [ 180, -152.61 ],
"type": "number"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/geospatial_lon_min.json",
"title": "geospatial_lon_min",
"description": "Specifies the westernmost latitude covered by the dataset. Units should be \"degrees East\". See also geospatial_lon_max.",
"examples": [ -180, 88.48 ],
"type": "number"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/geospatial_lon_units.json",
"title": "geospatial_lon_units",
"description": "Units for the longitude axis described in \"geospatial_lon_min\" and \"geospatial_lon_max\" attributes. These should be \"degrees_east\".",
"const": "degrees_east"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/grid.json",
"title": "grid",
"description": "Brief description of output grid characteristics or reference to grid specification. Should be included if the grid is not defined by the dimensions in the file.",
"examples": [],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/license.json",
"title": "license",
"description": "Information on the license for the data to ensure all users have access to the terms of use. Use SPDX license identifiers where possible. The default license for ACCESS-NRI is CC-BY-4.0, users should change as needed.",
"examples": [ "CC-BY-4.0" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/model.json",
"title": "model",
"description": "Name of the model used to create the data",
"examples": [ "ACCESS-ESM1.6" ],
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "global/model_version.json",
"title": "model_version",
"description": "Version of the model used to create the data. Please note here if the model has been modified from an official release, ideally with links to the changes.",
"$comment": "",
"examples": [
"2025.06.001",
"2025.06.001 (modified by John Smith, [link to repo/paper describing modifications])"
],
"type": "string"
}
Loading
Loading