Solid-PREP

Editor’s Draft,

More details about this document
This version:
https://solid.github.io/solid-prep/protocol
Issue Tracking:
GitHub
Editor:
Rahul Gupta
Authors:
Rahul Gupta
elf Pavlik

Abstract

Solid-PREP defines representation and semantics for notifications sent from LDP Resources hosted on Solid PODS using the Per Resource Events Protocol.

Status of this document

This section describes the status of this document at the time of its publication.

The information in this document is still subject to change. You are invited to contribute any feedback, comments, or questions you might have.

This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Conformance

Document Conventions

All of the text of this specification is normative except assertions, diagrams, examples, notes and sections explicitly marked as non-normative as described in [RFC2119].

The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT" and "MAY" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

The above-mentioned key words are used exclusively in the normative parts of this document and appear only in all capitals.

Specification Category

The Solid-PREP identifies the following Specification Category to distinguish the types of conformance:

Classes of Products

The Solid-PREP identifies the following Classes of Products for conforming implementations. These products are referenced throughout this specification.

Solid Server

A Solid server that builds on a server [SOLID-PROTOCOL] and resource server [PREP] by defining the behaviour of resources.

Solid Client

A Solid client that builds on a client [SOLID-PROTOCOL] and application client [PREP].

Interoperability

Interoperability occurs between Solid Client—Solid Server as defined by the Solid-PREP.

Solid Client—Solid Server Interoperability

Interoperability of implementations for Solid clients and Solid servers is tested by evaluating an implementation’s ability to transmit and receive PREP Notifications that conform to Solid-PREP.

Namespaces

This document uses the following RDF vocabularies and corresponding namespace prefix bindings:

Prefixes and Namespaces
Prefix Namespace Description
xs http://www.w3.org/2001/XMLSchema# [XMLSCHEMA11-1]
as https://www.w3.org/ns/activitystreams# [ACTIVITYSTREAMS-VOCABULARY]

1. Introduction

This section is non-normative.

Solid [SOLID-PROTOCOL] uses linked data to interconnect data across decentralized data stores called PODS. Per Resource Events Protocol [PREP] allows servers to transmit notifications over HTTP that can be customized for any given resource. This specification defines representation and semantics for PREP notifications sent from linked data resources hosted on Solid PODS.

1.1. Audience

This section is non-normative.

This specification is for:

2. Request

A Solid server implementing Per Resource Events Protocol on an LDP Resource MUST accept requests [PREP] when the accept event-field associated with the PREP list item in the Accept-Events header field indicates a preferred media type of application/ld+json [JSON-LD11].

3. Format

A Solid server implementing Per Resource Events Protocol on an LDP Resource MUST be able to transmit PREP notifications using the application/ld+json [JSON-LD11] media type. It MAY also support other media types to transmit PREP notifications.

4. Triggers

A Solid server implementing the Per Resource Events Protocol on an LDP Resource SHOULD send a PREP notification when the state of the said resource is modified.

A Solid server MUST NOT transmit a PREP notification before the resource has been modified and a confirmation (if necessary) has been sent to (but might not have been received by) the agent that initiated the resource modification.

Implementation Guidance

The Solid Protocol [SOLID-PROTOCOL] requires an LDP container’s state is modified when certain HTTP events occur on a contained resource. Thus, an HTTP event on a resource can trigger a Solid server to transmit a PREP notification on that resource or its container or both.

It follows that a Solid server ought to send PREP notification(s) on an resource and/or its container, when a request with one of the following HTTP methods generates a response with any of the following HTTP status codes:

HTTP Notification Triggers
Request Method Response Status Notify
Resource Container
PUT
PATCH
200 (OK)
204 (No Content)
205 (Reset Content)
201 (Created)
POST 200 (OK)
204 (No Content)
205 (Reset Content)
201 (Created)
DELETE 200 (OK)
204 (No Content)

Additionally, a Solid server ought to send PREP notification(s) on a resource and/or its container when modified at a later time as result of HTTP request that generates a 202 (Accepted) status code.

A Solid server needs to ensure that a PREP notification is not transmitted before a response has been sent to the user agent that initiated the HTTP request that triggered the said notification.

5. Data Model

The core notification data is expressed with the Activity Streams [ACTIVITYSTREAMS-VOCABULARY] and Solid Notifications [SOLID-NOTIFICATIONS] vocabularies.

5.1. Properties

A PREP notification from an LDP Resource on a Solid server MUST have the following properties:

id <xs:string>
an opaque identifier for the notification. Can be used to set Last-Event-ID in a subsequent PREP notifications request.
type <as:Activity>
the type of activity that triggered the notification.
published <xs:dateTime>
the date and time of the notification.

A PREP notification from an LDP Resource on a Solid server SHOULD have the following properties:

state <xs:string>
an opaque identifier for the last known state of the resource.

5.2. Extended Content

A Solid server MAY augment the JSON-LD Context [JSON-LD11] definition and extend the content of notifications.

NOTE: See examples of using multiple vocabularies in the Activity Streams [ACTIVITYSTREAMS-CORE] specification.

Implementation Guidance
Solid clients are encouraged to be aware that anything can be included in the notification. Clients might want to take suitable precautions when ascertaining the veracity of the contents.

6. Activity Mapping

A Solid server sending a PREP notification as a result of some activity on an LDP Resource MUST set the type property as the type of activity that triggered the notification as specified by the Activity Streams vocabulary [ACTIVITYSTREAMS-VOCABULARY].

Implementation Guidance

When an LDP resource is modified by virtue of an HTTP request, the activity type ought to be set as follows:

  1. When the PREP notification is triggered by a request on the resource with one of the following HTTP methods:

    Activity Mapping for LDP Resources
    Request Method Activity Type
    POST
    (Containers)
    as:Add
    PUT as:Update
    PATCH
    POST
    (Not Containers)
    DELETE as:Delete

  2. When the PREP notification is triggered on a container, by a request on a contained resource with one of the following HTTP methods:

    Activity Mapping for LDP Containers when contained resources change
    Request Method Activity Type
    PUT as:Update
    PATCH
    DELETE as:Remove

  3. When the PREP notification is triggered on a container, by a request to create a new resource inside that container (resource) with one of the following HTTP methods:

    Activity Mapping for LDP Containers when contained resources are created
    Request Method Activity Type
    PUT as:Add
    PATCH

Considerations

This section is non-normative.

This section details security and privacy considerations.

Some of the normative references within this specification point to documents with a Living Standard or Draft status, meaning their contents can still change over time. It is advised to monitor these documents, as such changes might have implications.

Since Solid-PREP defines representation and semantics for the use of Per Resource Events Protocol to transmit notifications from Solid resources, it follows that the Solid-PREP inherits security and privacy considerations of both the Per Resource Events Protocol and the Solid Protocol. Considerations relevant to the use of Per Resource Events Protocol for transmitting notifications are discussed in [PREP] § 11 Considerations, and considerations relevant to Solid Protocol are discussed in [SOLID-PROTOCOL] § 10 Considerations.

Security Considerations

This section is non-normative.

Solid servers are strongly discouraged from exposing information beyond the minimum amount necessary in a notification. Solid clients are strongly discouraged from exposing information beyond the minimum amount necessary to receive notifications from particular resources.

Solid clients are discouraged from sending requests for notifications to untrusted Solid servers, including localhost or any other loopback IP address, in order to avoid making arbitrary requests.

References

Normative References

[ACTIVITYSTREAMS-VOCABULARY]
James Snell; Evan Prodromou. Activity Vocabulary. URL: https://w3c.github.io/activitystreams/vocabulary/
[JSON-LD11]
Gregg Kellogg; Pierre-Antoine Champin; Dave Longley. JSON-LD 1.1. URL: https://w3c.github.io/json-ld-syntax/
[PREP]
Rahul Gupta. Per Resource Events. URL: https://cxres.github.io/prep/draft-gupta-httpbis-per-resource-events.html
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[RFC5789]
L. Dusseault; J. Snell. PATCH Method for HTTP. March 2010. Proposed Standard. URL: https://httpwg.org/specs/rfc5789.html
[RFC8174]
B. Leiba. Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. May 2017. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc8174
[RFC9110]
R. Fielding, Ed.; M. Nottingham, Ed.; J. Reschke, Ed.. HTTP Semantics. June 2022. Internet Standard. URL: https://httpwg.org/specs/rfc9110.html
[SOLID-NOTIFICATIONS]
Sarven Capadisli, Ed.; et al. Solid Notifications Protocol. Draft Community Group Report. URL: https://solidproject.org/TR/notifications-protocol
[SOLID-PROTOCOL]
Sarven Capadisli, Ed.; Tim Berners-Lee, Ed.; Kjetil Kjernsmo, Ed.. Solid Protocol. Draft Community Group Report. URL: https://solidproject.org/TR/protocol
[XMLSCHEMA11-1]
Sandy Gao; et al. W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures. 5 April 2012. REC. URL: https://www.w3.org/TR/xmlschema11-1/

Informative References

[ACTIVITYSTREAMS-CORE]
James Snell; Evan Prodromou. Activity Streams 2.0. URL: https://w3c.github.io/activitystreams/core/