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/data/aliases.json b/data/aliases.json new file mode 100644 index 0000000..2664dc0 --- /dev/null +++ b/data/aliases.json @@ -0,0 +1,118 @@ +{ + "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" + }, + "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" + } + } + } + } + } +} 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/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..1f6cd96 100755 --- a/scripts/check_schema.sh +++ b/scripts/check_schema.sh @@ -5,10 +5,15 @@ 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 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