Socialwg/Media type for AS2
Two alternative media types are discussed:
- application/activity+json (Current AS2 Editors Draft)
- application/ld+json using an AS2-specific profile (section of json-ld rec )
See also these issues (both were closed):
- Add `application/ld+json` as requirement for servers
- can media type specify default JSON-LD context?
- 1 Questions
- 2 Arguments in favor of application/activity+json
- 3 Arguments in favor of application/ld+json (using an AS2-specific profile)
- 4 RDF/JSON
elf-pavlik: "could you share with us some some clear examples where you see using [JSON-LD] profile [instead of a new AS2 media type] could come as disadvantage?" (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-74221991)
elf-pavlik: "just to clarify, do you see any use cases which require that application/activity+json response does NOT conform to JSON-LD spec? In other worlds [words], while we do NOT require JSON-LD processing, do we want it to fail if someone does try to process it as JSON-LD?" (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-74293779)
How important is it for a media type used by AS2 to imply a JSON-LD context? (See issue https://github.com/jasnell/w3c-socialwg-activitystreams/issues/132) Andreas Kuckartz (talk)
Arguments in favor of application/activity+json
- James M Snell: "I prefer the more specific media type because it allows me to easily differentiate that this is an Activity Streams 2.0 document as opposed to some other JSON-LD based thing. I don't see how using JSON-LD's media type + a profile parameter provides better interop between AS2 implementations." (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-62177194)
- dret: "the first question is what the "metamodel" of AS really is. is it some improvement/variation of AS1's JSON foundation, or is it JSON-LD and thus RDF? my claim is that it cannot reasonably be both." (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-74425512)
- sandro: Does conneg on profiles really work? James says it's often absent or buggy
Arguments in favor of application/ld+json (using an AS2-specific profile)
- Markus Lanthaler: "JSON-LD's media type has a profile parameter which would allow to convey the same information as a separate media type." (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issue-48011403)
- elf-pavlik: "this way one wouldn't need to request application/activity+json just for activities and then application/ld+json for all kind of other social data someone publishes online as JSON-LD" (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-62318461)
- Andreas Kuckartz: A new media type is not necessary but creates additional work for those who want to process JSON-LD as "just JSON-LD". This is about better interoperability between AS2 and the more general JSON-LD (and RDF) uses which are common in the Linked Data community. Andreas Kuckartz (talk)
- Melvin Carvalho: application/ld+json would allow interoperability with a host of solutions including SoLiD and others that are adopting this format, including many firms, and W3C groups. More importantly, it's the only JSON serialization that is a W3C REC. Is there any reason to make a new media type, in terms of current adoption? Melvin Carvalho (talk)
- Andrei Sambra (SoLiD): I believe it is less likely that SoLiD will support the application/activity+json media type, at least in the near future. https://github.com/linkeddata/SoLiD/issues/39#issuecomment-125329055
- dret (on implicit AS2 context): "anything that means that people cannot use off-the-shelf (i.e., non-AS-aware) JSON-LD components should be avoided. i don't know if many/most JSON-LD components allow the "injection" of external contexts, but if they do, then this is kind of ok. but it's still a horrible hack, imho, because this does go down a path where AS is not just JSON-LD, but some variant that requires special processing." (https://github.com/jasnell/w3c-socialwg-activitystreams/issues/132#issuecomment-107015979)
- Manu Sporny : Have you guys considered application/ld+json+activitystreams? Isn't that the way you're supposed to subtype? @shepazu and I were hallwaying this at W3C TPAC, he mentioned that might be a good compromise. I'm still supportive of using the profile parameter instead, but if you do decide to mint a new MIMEtype, why aren't you saying that the data is basically application/ld+json plus a few constraints? ( https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-153021330 )
- Benjamin Young (bigbluehat) : Comments re annotations WG -- https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-153050072
A URL needs to be defined for the serialization specified in the AS2 specification.
Ideally http://www.w3.org/ns/json-ld#compacted can be used. But then it is difficult to inform non-JSON-LD processors that the data is AS2.
In the future dereferencing this URL could result in a machine readable Frame (http://json-ld.org/spec/latest/json-ld-framing/). That might help to solve the "crystalization" issue described by Henry Story. Until then JSON-LD processors need to have out-of-band information about this profile.
Iterop Considerations - application/ld+json
- Google Search
- IMS Global
- Linked Data Platform based systems
- Solid based systems
- Open Annotations (possibly?)
- Mozilla Open Badges (possibly?)
Interop Considerations - application/activity+json
- Please add present and future possible deployments
Interop Considerations - AS2 and JSON LD
James Snell: None of the core vocabulary properties break with JSON-LD. AS2, however, does allow for extensions (such as GeoJSON) that are not JSON-LD compatible and currently warns against their use for exactly that reason (that's why the Place object has properties defined for instance). Even with those warnings, however, such non-JSON-LD compatible extensions are permitted under the AS2 "must ignore" policy for extensions that an implementation may not understand and implementations are required not to throw an error if such things are found. https://github.com/jasnell/w3c-socialwg-activitystreams/issues/52#issuecomment-153516084
Abstract from WG Note (direct quote)
"The Resource Description Framework (RDF) is a framework for representing information in the Web.
The syntax defined in this document should not be used unless there is a specific reason to do so. Use of JSON-LD is recommended."