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

media type / content type / MIME type for Croissant (JSON-LD "profile" parameter) #792

Open
pdurbin opened this issue Jan 10, 2025 · 2 comments

Comments

@pdurbin
Copy link
Member

pdurbin commented Jan 10, 2025

tl;dr

Can the Croissant spec be updated to formally state that the media type for Croissant is application/ld+json; profile="http://mlcommons.org/croissant/1.0" (the value from "conformsTo": "http://mlcommons.org/croissant/1.0")?

Long version

During the excellent presentation @stain gave this week on Signposting I learned that JSON-LD allows you use a "profile" parameter to help distinguish between formats that are all "application/ld+json" (such as Croissant, CodeMeta, RO-Crate, etc.).

For example, the RO-Crate docs have a section called RO-Crate JSON-LD Media type that shows the following example (note the use of "profile"):

HEAD http://example.com/ro-123/ro-crate-metadata.json HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/ld+json; profile="http://www.w3.org/ns/json-ld#flattened http://www.w3.org/ns/json-ld#compacted https://w3id.org/ro/crate"

During the call I asked what I should use for "profile" for Croissant. @benjelloun indicated I should use the value from "conformsTo": "http://mlcommons.org/croissant/1.0" like this:

Content-Type: application/ld+json; profile="http://mlcommons.org/croissant/1.0"

This makes complete sense and I'll try it but it would be nice to see this mentioned specifically in the spec. I'm happy to create a pull request if you like!

For more on the JSON-LD "profile" parameter, here's a screenshot of some docs from https://www.w3.org/TR/json-ld/#application-ld-json

Screenshot 2025-01-10 at 3 47 13 PM

@benjelloun
Copy link
Contributor

Hi Phil,

Your proposal makes sense to me. I suggest we add a small section about signposting to the next version of the Croissant spec, where we recommend using profile in this way. Would you like to send a PR for that?

Best,
Omar

@pdurbin
Copy link
Member Author

pdurbin commented Jan 21, 2025

Sure, I'm happy to. However, profile is more generic than Signposting so maybe the PR would have two main points:

That is, yes, I can imagine Signposting could have its own section in the spec, but perhaps we can talk about Croissant's profile in a more generic place. 🤔

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

2 participants