Clarification on Range in ValueOnly representation
In Format "Value" (Value-Only Serialization) in JSON it says:
SubmodelElements without a value are not serialized.
Further below in the section about Ranges, it details more specifically:
Range is serialized as named JSON object with ${Range/idShort} as the name of the containing JSON property. The JSON object contains two JSON properties. The first is named "min". The second is named "max". Their corresponding values are ${Range/min} and ${Range/max}.
To me, this reads, that Range objects in ValueOnly representation always have 2 properties: "min" and "max". However, when checking the attributes of Range in the submodel elements, we see that "min" and "max" are optional, with the following additional notes:
If the min value is missing, the value is assumed to be negative infinite. If the max value is missing, the value is assumed to be positive infinite.
This raises the following questions:
- Are
{"min": "123"}and{"max": "123"}valid Value Only representations of a Range Submodel Element? (As opposed to the paragraph above where it says, that "min" and "max" should be set?) (This appears to be the case due to the formulation: "Optional elements (like for example globalAssetId for an Entity submodel element) with no value shall be omitted in the serialization.") - Is it valid to model a Range Submodel Element with unset "min" and "max", i.e., following the spec, a range from negative infinite to positive infinite?
- If the former is valid, what does the respective representation in Value Only representation look like?
Can you please clarify these questions?
Thanks for the finding.
I would consider "{min": "123"} and {"max": "123"} as valid Value Only representations of a Range Submodel Element. So this information should be added to the Value-Only-Description of Value-Only-Mapping. For example
Range is serialized as named JSON object with ${Range/idShort} as the name of the containing JSON property. The JSON object contains either two JSON properties or one of them. The first is named "min". The second is named "max". Their corresponding values are ${Range/min} and ${Range/max}.
and add two additional examples for Range
{
"min": 3,
"max": 15
}
{
"min": 3,
}
{
"max": 15
}
I would not consider "a Range Submodel Element with unset "min" and "max"" to be a valid range, espeically in value-Only it does not make any sense and would be omitted according to the rule that elements with no value are omitted. However, there is not formal constraint in the metamodel that would forbid it.
2026-01-21 Workstream AAS Sepcs
Range ist still on <If the min value is missing, the value is assumed to be negative infinite.
and
If the max value is missing, the value is assumed to be positive infinite.
No special serialization for Range
Note: some data types like float do have infinite in its value range per definition and should be used if infinite is needed.