solid / notifications

Solid Notifications Technical Reports
https://solid.github.io/notifications/protocol
MIT License
11 stars 7 forks source link

Why do notifications use JSON-LD? #12

Closed RubenVerborgh closed 2 years ago

kjetilk commented 3 years ago

Then, I think it should also answer "why not Turtle", or "why not any choice of RDF serialization?".

I suppose you answered that already by mentioning JSON-only, but since we are in a relatively Turtle-heavy environment, I think a more elaborate answer is needed.

acoburn commented 3 years ago

There are two main reasons behind the choice of JSON-LD:

  1. There is already a linked-data friendly W3C specification for modeling these sorts of events: Activity Streams 2.0. And AS requires JSON-LD.
  2. These sorts of notifications often form the logical integration point for external systems. WebSockets is arguably not such a good example of this, since it is generally browser-based, and the integrations I'm referring to rely on bots, scripts and enterprise middleware. But there are entire ecosystems of message-oriented technologies that work quite well on JSON and not at all with RDF. By using a JSON-based serialization, we automatically achieve much better interop with these non-Solid systems, while preserving the interop with Solid-based clients.
csarven commented 2 years ago

Note that the message format could also be negotiated by clients; either during the initial negotiation phase (#296), or when setting up the WebSocket connection. There is probably a preference for the initial negotiation phase in order to not surprise clients after they have made their choice of channel.

Servers can indeed advertise their capability to accept client's preferred serialization for the notifications by including the notify:accept ( https://solidproject.org/TR/2022/notifications-protocol-20220509#feature-accept ) as part of the notification channel's notify:feature set.

csarven commented 2 years ago

It could be possible to allow a subscription type to use an alternative media type as default for notifications in addition to serializing them in JSON-LD.

This is not spelled out right now in the specification. I'd argue that we look into that if/when really needed.

Using JSON-LD is a (legitimate) design choice. Even if it or something else were pulled out of thin air would be minimal requirement for interop. Is there another media type that's more compelling for use?

Is there anything outstanding in this issue before closing?