Description
The API provides an option for setting the processing mode to
json-ld-1.0
, which will prevent JSON-LD 1.1 features from being activated, or error if@version
entry in a context is explicitly set to1.1
.
JSON-LD processors are required to check @version
value if it is found at appropriate place, but floating-point number comparison is unnecessarily complex for this purpose.
IEEE 754 floating point number cannot represent exact 1.1
, and programs may use various (not same) representation very close to 1.1 (but not exact 1.1).
This can make straightforward implementation (for example doing if (version == 1.1) { ... }
) to fail checking version correctly.
To deal with this problem, processors are forced to compare values in complex way (such as if (version >= 1.1 - EPSILON && version <= 1.1 + EPSILON) { ... }
).
JSON-LD version is neither a real number nor a floating-point number.
I think it should be string "1.1"
or something exactly representable value, instead of floating-point number.