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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
118 changes: 118 additions & 0 deletions data/aliases.json
Original file line number Diff line number Diff line change
@@ -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": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not specifying what can be used here? Is expected? I thought point of schema was to play role of contract verification so programming code can expect things where they should be. Do we have code that specifically waits for camera? If so, should camera be mentioned explicitely as valid key here in schema?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to mention it as a valid key, without restricting any other keys? I've never written a schema before.
Currently the entity types are defined as additionalProperties, so any value is allowed.

If mentioning camera would mean switching to patternProperties and allowing only camera in the pattern, I would prefer not to do that. In that case, adding any other entity type would require updating the schema, even though nothing in the data structure actually changes.
Same way as the code expects "R", "G", "B" channels in the camera files, yet the schema doesn't require that.

"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"
}
}
}
}
}
}
102 changes: 102 additions & 0 deletions schema/aliases_1.0.0.json
Original file line number Diff line number Diff line change
@@ -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"
}
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion scripts/check_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading