solid / notifications

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

Specify that each chunk must include one full notification. #46

Open elf-pavlik opened 2 years ago

elf-pavlik commented 2 years ago

This should streamline the processing of the stream by the client and parsing notifications.

elf-pavlik commented 1 year ago

I think streaming text/turtle should be pretty straight forward. For application/ld+json we might want to reference https://www.w3.org/TR/json-ld11-streaming/

CxRes commented 1 year ago

From what I have read, I don't think using text/turtle conforms to HTTP specifications. What you are streaming are multiple instances of text/turtle and you would thus require something like multipart/mixed.

I don't know much about it myself, and hence was asking around for an expert on the subject for guidance.

References:

elf-pavlik commented 1 year ago

I think we should be able to define chunks in a way that what is being streamed is a valid document for that content type. AFAIK in turtle prefixes can appear anywhere as long they are defined before they get used, which means that concatenating multiple text/turtle documents will still be valid text/turtle.

For JSON-LD we will need to be more careful since in the simplest case we will need to have an array of notification objects, separated by commas.

CxRes commented 1 year ago

Ok, if you want to do the text/turtle thing, I believe that there is a proper way to set headers for that as well, except I don't know how. From what I understand, you cannot just get away with setting Content-Type.

However, I don't want to discard the multipart/* approach either (at least for now) because we might also want to support diffs which might not play as nicely.

CxRes commented 1 year ago

@elf-pavlik FYI: https://www.ietf.org/rfc/rfc2387

TallTed commented 1 year ago

AFAIK in turtle prefixes can appear anywhere as long they are defined before they get used, which means that concatenating multiple text/turtle documents will still be valid text/turtle.

Yes, that is correct. PREFIX or @prefix lines may appear anywhere in a Turtle document, and affect all following lines.

It's probably also worth noting that a later PREFIX declaration may change a previous declaration for subsequent triples — i.e., an early PREFIX ex: <https://example.com/#> which is active for some number of triples may be changed by a later @prefix ex: <https://example.org/#> . which is then active for following triples, until either the end of the document or another PREFIX ex: <URL> declaration.