-
Notifications
You must be signed in to change notification settings - Fork 7
Update Delta Feature #61
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
Open
jaxoncreed
wants to merge
1
commit into
main
Choose a base branch
from
update-delta
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,129 @@ | ||||||
| # Update Delta | ||||||
|
|
||||||
| ## 1. Abstract | ||||||
| When an RDF resource is updated on a storage server, a notification is sent to a subscribing client, but this notification does not tell the client how the resource was updated. As a result, the client must make another request to the storage server to retieve the document and reconcile its updates. Update Delta is a notifications feature that tells the client change, or delta between the document pre-update and post-update in the notification activity. | ||||||
|
|
||||||
| ## 2. Status of the Document | ||||||
| TODO | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## 3. Notification Feature | ||||||
| Update Delta is a notification feature. As such, any compliant storage server MUST list it among other features during the notification discover phase as the URL `http://www.w3.org/ns/solid/notifications#updateDelta`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| For example, a compliant storage server could have a document like the following: | ||||||
|
|
||||||
| ```turtle | ||||||
| @prefix notify: <http://www.w3.org/ns/solid/notifications#> . | ||||||
| <> | ||||||
| notify:notificationChannel <#websocketNotification> . | ||||||
| <#websocketNotification> | ||||||
| a notify:WebSocketSubscription2021 ; | ||||||
| notify:subscription <https://websocket.example/subscription> ; | ||||||
| notify:features notify:state, notify:rate, notify:expiration, notify:updateDelta . | ||||||
| ``` | ||||||
|
|
||||||
| ## 4. Update Activity | ||||||
|
|
||||||
| Any Update activity (including updates to containers) MUST include the [`result`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-result) field. | ||||||
|
|
||||||
| > Is the `result` field the most appropriate one for this? I didn't see an ActivityStreams property that was really appropriate. Should we make a new property? | ||||||
|
|
||||||
| The `result` field MUST be mapped to [`Add` type](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-add) and/or [`Remove` type](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-remove) activities. | ||||||
|
|
||||||
| The `object` field of the `Add` and `Remove` activities MUST map to a graph distinct from the default graph. | ||||||
|
|
||||||
| Each graph referenced by the `Add` and `Remove` activities must contain the respective triples that were added and removed. | ||||||
|
|
||||||
|
|
||||||
| In this example, the triple `<http://example.com/prince> <http://xmlns.com/foaf/0.1/name> "Prince Rogers Nelson"^^xsd:string` was removed, and the triple `<http://example.com/prince> <http://xmlns.com/foaf/0.1/name> "Ƭ̵̬̊"^^xsd:string` was added. | ||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "@context": [ | ||||||
| "https://www.w3.org/ns/activitystreams", | ||||||
| "https://www.w3.org/ns/solid/notification/v1" | ||||||
| ], | ||||||
| "id":"urn:uuid:<uuid>", | ||||||
| "type": [ | ||||||
| "Update" | ||||||
| ], | ||||||
| "actor": [ | ||||||
| "<WebID>" | ||||||
| ], | ||||||
| "object": { | ||||||
| "id":"https://example.org/<user>/some-container/resource1.ttl", | ||||||
| "type": [ | ||||||
| "http://www.w3.org/ns/ldp#Resource" | ||||||
| ] | ||||||
| }, | ||||||
| "published":"2021-08-05T01:01:49.550044Z", | ||||||
| "result": [ | ||||||
| { | ||||||
| "type": "Remove", | ||||||
| "object": { | ||||||
| "@id": "<Graph1Name>", | ||||||
| "@graph": [ | ||||||
| { | ||||||
| "@id": "http://example.com/prince", | ||||||
| "http://xmlns.com/foaf/0.1/name": "Prince Rogers Nelson" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "type": "Add", | ||||||
| "object": { | ||||||
| "@id": "<Graph2Name>", | ||||||
| "@graph": [ | ||||||
| { | ||||||
| "@id": "http://example.com/prince", | ||||||
| "http://xmlns.com/foaf/0.1/name": "Ƭ̵̬̊" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| > Alternatively, we could create some terms outside of Activity Streams. The example would look like this: | ||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "@context": [ | ||||||
| "https://www.w3.org/ns/activitystreams", | ||||||
| "https://www.w3.org/ns/solid/notification/v1" | ||||||
| ], | ||||||
| "id":"urn:uuid:<uuid>", | ||||||
| "type": [ | ||||||
| "Update" | ||||||
| ], | ||||||
| "actor": [ | ||||||
| "<WebID>" | ||||||
| ], | ||||||
| "object": { | ||||||
| "id":"https://example.org/<user>/some-container/resource1.ttl", | ||||||
| "type": [ | ||||||
| "http://www.w3.org/ns/ldp#Resource" | ||||||
| ] | ||||||
| }, | ||||||
| "published":"2021-08-05T01:01:49.550044Z", | ||||||
| "added": { | ||||||
| "@id": "<Graph1Name>", | ||||||
| "@graph": [ | ||||||
| { | ||||||
| "@id": "http://example.com/prince", | ||||||
| "http://xmlns.com/foaf/0.1/name": "Prince Rogers Nelson" | ||||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| "removed": { | ||||||
| "@id": "<Graph2Name>", | ||||||
| "@graph": [ | ||||||
| { | ||||||
| "@id": "http://example.com/prince", | ||||||
| "http://xmlns.com/foaf/0.1/name": "Ƭ̵̬̊" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.