Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round-tripping #8

Open
pchampin opened this issue Apr 16, 2020 · 0 comments
Open

Round-tripping #8

pchampin opened this issue Apr 16, 2020 · 0 comments

Comments

@pchampin
Copy link
Contributor

The current proposal raises some questions about round-tripping, as pointed out in #7.

Currently, both 42 (in JSON) and
{ "@value": "42", "@type": "http://www.w3.org/2001/XMLSchema#integer"} are encoded identically in CBOR, using a native integer representation (major type 0). Parsing it back to JSON, we transform that native integer into a JSON number 42.

Semantically, both forms are equivalent for JSON-LD. But this means that CBOR would not preserve the expanded-ness of a JSON-LD document in the expanded form.

Is that a problem? I would tend to answer "no". Anyway, it will be further (in §4) suggested to first compact the JSON-LD document into a CBOR-friendly context, to get an even smaller representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant