[dxwg] Definition of dcat:spatialResolutionInMeters incopatible/problematic with JSON-LD (#1536)

jakubklimek has just created a new issue for https://github.com/w3c/dxwg:

== Definition of dcat:spatialResolutionInMeters incopatible/problematic with JSON-LD ==
There is a technical issue with the definition of `dcat:spatialResolutionInMeters` when used with JSON-LD.
Specifically, the issue is the range being `xsd:decimal`.

In JSON-LD, `xsd:decimal` is not supported for numbers, see the note [in the specification](https://www.w3.org/TR/json-ld11/#conversion-of-native-data-types). Therefore, when in JSON this number is actually a JSON number, not JSON string, even if the JSON-LD context specifies the datatype to be explicitly `xsd:decimal`, the number is treated as `xsd:double`, leading to conversions like `1.2E1` instead of `12` when loading JSON-LD as RDF, in turn leading to invalid `xsd:decimal` RDF literal `"1.2E1"^^xsd:decimal`. This can be seen e.g. in [JSON-LD playground](https://json-ld.org/playground/#startTab=tab-nquads&json-ld=%7B%22%40context%22%3A%7B%22xsd%22%3A%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%22%2C%22decimal%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Flocalhost%2Fdecimal%22%2C%22%40type%22%3A%22xsd%3Adecimal%22%7D%7D%2C%22decimal%22%3A12.1%7D).

Possible solutions:
1. We change the datatype to `xsd:integer` or `xsd:double`, which is a breaking change
2. We explicitly mention, that JSON-LD has this issue, and the property data needs to be represented as JSON String, not JSON Number

Please view or discuss this issue at https://github.com/w3c/dxwg/issues/1536 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 14 October 2022 09:13:04 UTC