Skip to content

JSON-LD cannot validate, only JSON Schema can #88

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

Closed
VladimirAlexiev opened this issue Jan 25, 2022 · 4 comments
Closed

JSON-LD cannot validate, only JSON Schema can #88

VladimirAlexiev opened this issue Jan 25, 2022 · 4 comments
Assignees
Labels

Comments

@VladimirAlexiev
Copy link

JSON-LD is completely orthogonal to JSON Schema:

  • JSON-LD cannot validate, JSON Schema can
  • JSON-LD explicates JSON terms to URLs, and can add conveniences like datatype info, name graph, container (set/list), etc. JSON Schema doesn't

In addition, while the use of credentialSchema (in particular JSON Schema) is optional in VC, JSON-LD is necessary.

So I'm puzzled by these statements:

A new version could be introduced that supports [JSON-LD] and removes support for [JSON_SCHEMA].

[JSON-LD] is the most prominent alternative, though it does not provide the same functionality in regards to strict data validation

In particular, the latter should be changed to refer to the RDF Shape languages (SHACL and SHEX), which provide data validation features comparable to JSON Schema

Closely related to #16

@decentralgabe
Copy link
Collaborator

So I'm puzzled by these statements:

A new version could be introduced that supports [JSON-LD] and removes support for [JSON_SCHEMA].

My intention, which I can see is less-than-clear, was to state that an LD schema could be embedded into a JSON schema so there's a 1 - 1 mapping between the two.

[JSON-LD] is the most prominent alternative, though it does not provide the same functionality in regards to strict data validation

In particular, the latter should be changed to refer to the RDF Shape languages (SHACL and SHEX), which provide data validation features comparable to JSON Schema

Yeah I wasn't really aware of these. They could be OK to add but seem quite complex and (potentially) unnecessary compared to JSON Schema which is quite widely adopted.

@VladimirAlexiev
Copy link
Author

What is LD Schema?

If you don't like RDF Shapes then delete section Alternatives

@decentralgabe
Copy link
Collaborator

What is LD Schema?

Any schema that uses JSON LD, like those here https://schema.org/docs/schemas.html

If you don't like RDF Shapes then delete section Alternatives

My personal preferences have little to do with the specification. It would be dishonest to not share alternatives. If you believe there's an error, please make a contribution.

@decentralgabe decentralgabe self-assigned this Nov 9, 2022
@decentralgabe
Copy link
Collaborator

Closing and will be handled in #122

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

No branches or pull requests

2 participants