From a39db11cde480772fbd11e9ca50a0d0ff1d7da4f Mon Sep 17 00:00:00 2001 From: Anton Dukhovnikov Date: Fri, 27 Mar 2026 17:29:25 +1300 Subject: [PATCH 1/3] add data/aliases.json Signed-off-by: Anton Dukhovnikov --- data/aliases.json | 110 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 data/aliases.json diff --git a/data/aliases.json b/data/aliases.json new file mode 100644 index 0000000..4ef43a3 --- /dev/null +++ b/data/aliases.json @@ -0,0 +1,110 @@ +{ + "camera": { + "make": { + "Nikon Corporation": "Nikon" + }, + "model": { + "Canon": { + "EOS 400D": { + "make": "Canon", + "model": "Digital Rebel XTi", + "comment": "same model, alternative name" + }, + "Kiss Digital X": { + "make": "Canon", + "model": "Digital Rebel XTi", + "comment": "same model, alternative name" + }, + "EOS Rebel SL1": { + "make": "Canon", + "model": "EOS 100D", + "comment": "same model, alternative name" + }, + "Kiss X7": { + "make": "Canon", + "model": "EOS 100D", + "comment": "same model, alternative name" + }, + "EOS Rebel SL2": { + "make": "Canon", + "model": "EOS 200D", + "comment": "same model, alternative name" + }, + "Kiss X9": { + "make": "Canon", + "model": "EOS 200D", + "comment": "same model, alternative name" + }, + "EOS 250D": { + "make": "Canon", + "model": "EOS 200D II", + "comment": "same model, alternative name" + }, + "EOS Rebel SL3": { + "make": "Canon", + "model": "EOS 200D II", + "comment": "same model, alternative name" + }, + "Kiss X10": { + "make": "Canon", + "model": "EOS 200D II", + "comment": "same model, alternative name" + }, + "EOS Rebel T3i": { + "make": "Canon", + "model": "EOS 600D", + "comment": "same model, alternative name" + }, + "Kiss X5": { + "make": "Canon", + "model": "EOS 600D", + "comment": "same model, alternative name" + }, + "EOS 5DS R": { + "make": "Canon", + "model": "EOS 5DS", + "comment": "different model, same sensor" + }, + "EOS R5 C": { + "make": "Canon", + "model": "EOS R5", + "comment": "different model, same sensor" + }, + "EOS R50": { + "make": "Canon", + "model": "EOS R10", + "comment": "different model, same sensor" + } + }, + "Nikon": { + "D800": { + "make": "Nikon", + "model": "D800E", + "comment": "different model, same sensor" + }, + "Z 6_2": { + "make": "Nikon", + "model": "Z f", + "comment": "different model, same sensor" + } + }, + "Sony": { + "ILCE-7RM5": { + "make": "Sony", + "model": "ILCE-7RM4", + "comment": "different model, same sensor" + }, + "ILCE-7RM4A": { + "make": "Sony", + "model": "ILCE-7RM4", + "comment": "updated model, same sensor" + }, + "ILCE-7RM3A": { + "make": "Sony", + "model": "ILCE-7RM3", + "comment": "updated model, same sensor" + } + } + } + } +} \ No newline at end of file From e76fa5f2db83ef4430a2b41c877e106453d21ac4 Mon Sep 17 00:00:00 2001 From: Anton Dukhovnikov Date: Fri, 27 Mar 2026 18:06:05 +1300 Subject: [PATCH 2/3] move schemas to subfolder Signed-off-by: Anton Dukhovnikov --- README.md | 2 +- schema_0.1.0.json => schema/spectral_0.1.0.json | 0 schema_1.0.0.json => schema/spectral_1.0.0.json | 0 scripts/check_schema.sh | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename schema_0.1.0.json => schema/spectral_0.1.0.json (100%) rename schema_1.0.0.json => schema/spectral_1.0.0.json (100%) diff --git a/README.md b/README.md index 5148bf9..178c862 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ The attributes are defined as follows: - **type**: `"string"` - **enum**: `["flux", "absorptance", "transmittance", "reflectance", "intensity", "irradiance", "radiance", "exitance", "R-Factor", "T-Factor", "relative", "other"]` -The full JSON schema for spectral datasets can be used to validate a new user file using a [validator](http://www.jsonschemavalidator.net/) and is defined in [schema_1.0.0.json](./schema_1.0.0.json) +The full JSON schema for spectral datasets can be used to validate a new user file using a [validator](http://www.jsonschemavalidator.net/) and is defined in [schema/spectral_1.0.0.json](./schema/spectral_1.0.0.json) ## Licence diff --git a/schema_0.1.0.json b/schema/spectral_0.1.0.json similarity index 100% rename from schema_0.1.0.json rename to schema/spectral_0.1.0.json diff --git a/schema_1.0.0.json b/schema/spectral_1.0.0.json similarity index 100% rename from schema_1.0.0.json rename to schema/spectral_1.0.0.json diff --git a/scripts/check_schema.sh b/scripts/check_schema.sh index 3fe3db2..5597b6e 100755 --- a/scripts/check_schema.sh +++ b/scripts/check_schema.sh @@ -5,7 +5,7 @@ error=0 for DIR in camera cmf illuminant training; do for FILE in ./data/$DIR/*; do echo "Processing file $FILE" - if ! check-jsonschema --schemafile ./schema_1.0.0.json $FILE; then + if ! check-jsonschema --schemafile ./schema/spectral_1.0.0.json $FILE; then error=1 fi done From 93d70ee55d84bd0afc7d47a868297f747db92eb9 Mon Sep 17 00:00:00 2001 From: Anton Dukhovnikov Date: Fri, 27 Mar 2026 21:31:07 +1300 Subject: [PATCH 3/3] add schema for aliases Signed-off-by: Anton Dukhovnikov --- data/aliases.json | 216 ++++++++++++++++++++------------------ schema/aliases_1.0.0.json | 102 ++++++++++++++++++ scripts/check_schema.sh | 5 + 3 files changed, 219 insertions(+), 104 deletions(-) create mode 100644 schema/aliases_1.0.0.json diff --git a/data/aliases.json b/data/aliases.json index 4ef43a3..2664dc0 100644 --- a/data/aliases.json +++ b/data/aliases.json @@ -1,110 +1,118 @@ { - "camera": { - "make": { - "Nikon Corporation": "Nikon" - }, - "model": { - "Canon": { - "EOS 400D": { - "make": "Canon", - "model": "Digital Rebel XTi", - "comment": "same model, alternative name" - }, - "Kiss Digital X": { - "make": "Canon", - "model": "Digital Rebel XTi", - "comment": "same model, alternative name" - }, - "EOS Rebel SL1": { - "make": "Canon", - "model": "EOS 100D", - "comment": "same model, alternative name" - }, - "Kiss X7": { - "make": "Canon", - "model": "EOS 100D", - "comment": "same model, alternative name" - }, - "EOS Rebel SL2": { - "make": "Canon", - "model": "EOS 200D", - "comment": "same model, alternative name" - }, - "Kiss X9": { - "make": "Canon", - "model": "EOS 200D", - "comment": "same model, alternative name" - }, - "EOS 250D": { - "make": "Canon", - "model": "EOS 200D II", - "comment": "same model, alternative name" - }, - "EOS Rebel SL3": { - "make": "Canon", - "model": "EOS 200D II", - "comment": "same model, alternative name" - }, - "Kiss X10": { - "make": "Canon", - "model": "EOS 200D II", - "comment": "same model, alternative name" - }, - "EOS Rebel T3i": { - "make": "Canon", - "model": "EOS 600D", - "comment": "same model, alternative name" - }, - "Kiss X5": { - "make": "Canon", - "model": "EOS 600D", - "comment": "same model, alternative name" - }, - "EOS 5DS R": { - "make": "Canon", - "model": "EOS 5DS", - "comment": "different model, same sensor" - }, - "EOS R5 C": { - "make": "Canon", - "model": "EOS R5", - "comment": "different model, same sensor" - }, - "EOS R50": { - "make": "Canon", - "model": "EOS R10", - "comment": "different model, same sensor" - } + "header": { + "schema_version": "1.0.0", + "document_creator": "rawtoaces", + "document_creation_date": "2026-03-27T06:11:34Z", + "license": "Apache-2.0" + }, + "data": { + "camera": { + "make": { + "Nikon Corporation": "Nikon" }, - "Nikon": { - "D800": { - "make": "Nikon", - "model": "D800E", - "comment": "different model, same sensor" - }, - "Z 6_2": { - "make": "Nikon", - "model": "Z f", - "comment": "different model, same sensor" - } - }, - "Sony": { - "ILCE-7RM5": { - "make": "Sony", - "model": "ILCE-7RM4", - "comment": "different model, same sensor" - }, - "ILCE-7RM4A": { - "make": "Sony", - "model": "ILCE-7RM4", - "comment": "updated model, same sensor" - }, - "ILCE-7RM3A": { - "make": "Sony", - "model": "ILCE-7RM3", - "comment": "updated model, same sensor" + "model": { + "Canon": { + "EOS 400D": { + "make": "Canon", + "model": "Digital Rebel XTi", + "comments": "same model, alternative name" + }, + "Kiss Digital X": { + "make": "Canon", + "model": "Digital Rebel XTi", + "comments": "same model, alternative name" + }, + "EOS Rebel SL1": { + "make": "Canon", + "model": "EOS 100D", + "comments": "same model, alternative name" + }, + "Kiss X7": { + "make": "Canon", + "model": "EOS 100D", + "comments": "same model, alternative name" + }, + "EOS Rebel SL2": { + "make": "Canon", + "model": "EOS 200D", + "comments": "same model, alternative name" + }, + "Kiss X9": { + "make": "Canon", + "model": "EOS 200D", + "comments": "same model, alternative name" + }, + "EOS 250D": { + "make": "Canon", + "model": "EOS 200D II", + "comments": "same model, alternative name" + }, + "EOS Rebel SL3": { + "make": "Canon", + "model": "EOS 200D II", + "comments": "same model, alternative name" + }, + "Kiss X10": { + "make": "Canon", + "model": "EOS 200D II", + "comments": "same model, alternative name" + }, + "EOS Rebel T3i": { + "make": "Canon", + "model": "EOS 600D", + "comments": "same model, alternative name" + }, + "Kiss X5": { + "make": "Canon", + "model": "EOS 600D", + "comments": "same model, alternative name" + }, + "EOS 5DS R": { + "make": "Canon", + "model": "EOS 5DS", + "comments": "different model, same sensor" + }, + "EOS R5 C": { + "make": "Canon", + "model": "EOS R5", + "comments": "different model, same sensor" + }, + "EOS R50": { + "make": "Canon", + "model": "EOS R10", + "comments": "different model, same sensor" + } + }, + "Nikon": { + "D800": { + "make": "Nikon", + "model": "D800E", + "comments": "different model, same sensor" + }, + "Z 6_2": { + "make": "Nikon", + "model": "Z f", + "comments": "different model, same sensor" + } + }, + "Sony": { + "ILCE-7RM5": { + "make": "Sony", + "model": "ILCE-7RM4", + "comments": "different model, same sensor" + }, + "ILCE-7RM4A": { + "make": "Sony", + "model": "ILCE-7RM4", + "comments": "updated model, same sensor" + }, + "ILCE-7RM3A": { + "make": "Sony", + "model": "ILCE-7RM3", + "comments": "updated model, same sensor" + } } } } } -} \ No newline at end of file +} diff --git a/schema/aliases_1.0.0.json b/schema/aliases_1.0.0.json new file mode 100644 index 0000000..dd81cb6 --- /dev/null +++ b/schema/aliases_1.0.0.json @@ -0,0 +1,102 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + }, + "id": "#", + "properties": { + "header": { + "id": "/properties/header", + "properties": { + "schema_version": { + "description": "Required, schema version of the current document.", + "id": "/properties/header/properties/api_version", + "type": "string", + "minLength": 1 + }, + "document_creation_date": { + "description": "Required, document creation date expressed as per RFC 3339 - Date and Time on the Internet: Timestamps, e.g. 2017-01-01T12:00:00Z.", + "id": "/properties/header/properties/document_creation_date", + "type": "string", + "format": "date-time" + }, + "document_creator": { + "description": "Required, creator of the document, e.g. company, individual, laboratory, etc.", + "id": "/properties/header/properties/document_creator", + "type": "string", + "minLength": 1 + }, + "license": { + "description": "Required, usage license of the document, e.g. CC-BY-NC-ND", + "id": "/properties/header/properties/license", + "type": "string", + "minLength": 1 + } + }, + "required": [ + "schema_version", + "document_creation_date", + "document_creator", + "license" + ], + "type": "object" + }, + "data": { + "description": "Mapping data, contains entity types.", + "additionalProperties": { + "description": "Entity type.", + "properties": { + "make": { + "description": "Optional, the current entity's make mapping.", + "additionalProperties": { + "description": "Source make, the value contains the destination make.", + "type" : "string", + "minLength": 1 + }, + "type": "object" + }, + "model": { + "description": "Optional, the current entity's model mapping.", + "type": "object", + "additionalProperties": { + "description": "Source make, contains the source models.", + "type" : "object", + "additionalProperties": { + "description": "Source model.", + "type" : "object", + "properties": { + "make": { + "description": "Required destination make", + "type": "string", + "minLength": 1 + }, + "model": { + "description": "Required, destination model", + "type": "string", + "minLength": 1 + }, + "comments": { + "description": "Optional, any comments, i.e. the reason this alias exists.", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "make", + "model" + ] + } + } + } + }, + "additionalProperties": false, + "type": "object" + }, + "type": "object" + } + }, + "required": [ + "header", + "data" + ], + "type": "object" +} diff --git a/scripts/check_schema.sh b/scripts/check_schema.sh index 5597b6e..1f6cd96 100755 --- a/scripts/check_schema.sh +++ b/scripts/check_schema.sh @@ -11,4 +11,9 @@ for DIR in camera cmf illuminant training; do done done +echo "Processing file ./data/aliases.json" +if ! check-jsonschema --schemafile ./schema/aliases_1.0.0.json "./data/aliases.json"; then + error=1 +fi + exit $error