Open vcharpenay opened 4 years ago
The schema-awareness of EXI may be leveraged as well.
Since JSON-LD has no fixed schema (beyond some constraints on contexts), I am not sure exactly what you are suggesting...
A schema encoding the JSON-LD syntactic restrictions could be created and appended to the note. Examples of restrictions are available in the EXI4JSON spec.
Not all restrictions need to be encoded, though. A minima, JSON-LD keywords could be put in an enumerated type to then be encoded in a single byte, similarly to what you suggest in #5.
I still have two concerns with this proposal:
capturing the syntactic restrictions of the grammar in the form of a schema looks non-trivial to me, for a benefit that might not be so high (compared to the simpler solution of aliasing keywords, as discussed in #5);
the initial idea of this note was about CBOR itself; I see how it could be generalized to "binary representations for JSON-LD", but I'm affraid that it might "dilute" the aim the note...
It is possible to represent JSON in the Efficient XML Interchange (EXI) format as well. See the EXI4JSON note: https://www.w3.org/XML/EXI/docs/json/exi-for-json.html.
The schema-awareness of EXI may be leveraged as well.