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

Consider sending .jsonld files with the application/ld+json content-type #17

Closed
alrra opened this issue Jan 6, 2014 · 3 comments
Closed

Comments

@alrra
Copy link
Member

alrra commented Jan 6, 2014

Consider adding AddType application/ld+json jsonld, as JSON-LD (JSON for Linking Data) is in the final stages of standardization at W3C, and it seems the adoption is quite good.

Useful links:

My question(s): Does sending .jsonld files with a different Content-Type then application/ld+json (e.g.: application/json) have any downsides ? Or to put it differently: do we really need this new Content-Type ?

(Cc: @gkellogg, @lanthaler, @msporny)

@lanthaler
Copy link

+1 Sending a JSON-LD file with the wrong media type might mean that clients can’t interpret it as JSON-LD. It is the content type who defines the semantics of a document. JSON by itself doesn’t have any. So strictly speaking, a client wouldn’t be allowed to interpret it as JSON-LD if it isn’t served with the right content type (or an HTTP Link header pointing to a context).

@msporny
Copy link

msporny commented Jan 7, 2014

Just chiming in to agree with @lanthaler. It's considered hacky wrt. Web architecture to try to interpret documents served as one content type as another content type. Don't make the application guess, serve the document w/ the correct content type.

alrra added a commit that referenced this issue Jan 7, 2014
Ensure that clients interpret the content of `.jsonld` files correctly
by serving them with the `application/ld+json` content-type.

Also, ensure that `.jsonld` files aren't served with any of the `html`
related headers, but are served compressed, and their character encoding
is UTF-8.

See also:

  * http://json-ld.org/
  * http://json-ld.org/spec/latest/json-ld/A
  * http://www.w3.org/TR/json-ld/
  * http://www.iana.org/assignments/media-types/application/ld+json
  * https://github.com/json-ld

Ref:   #17.
Close: #17.
@alrra
Copy link
Member Author

alrra commented Jan 7, 2014

@lanthaler @msporny thanks for the comments guys, really appreciate it! (I just wanted to make sure this is worth adding, as for some file formats, web clients just ignore the Content-Type altogether).

@alrra alrra closed this as completed Jan 7, 2014
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

3 participants