A JSON Schema is a useful mechanism for specifying and verifying the structure of an Atom. A Schema can specify which elements are 'required', but specifying interdependency or mutual-exclusion (e.g. ContextTag IFF ContextValue; DeviceID XOR ConsumerID) is not straightforward. Some small changes to the structure of the Atom would make development of a schema easier - and as a consequence lighten the burden of validation in Atom processors.
Suggestions include:
1 Implement WHAT as an array of integers rather than four discrete elements. No need for complicated 'SubClass' is required if 'Element' is present.
2 Implement Extension like the following:
{
"Int":{"IntTag": N, "IntValue": N}},
"Str":{"StrTag": N, "StrValue": N}},
"Flt":{"FltTag": N, "FltValue": N}}
}
...so that we can make the elements Int, Str, Flt 'optional', but within them make the Tag and Value elements 'mandatory'
3. Implement Context as
{
"Weather": N ### Optional
"Ext":
### Optional Ext with mandatory Tag/Value
}