Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
TallTed authored Jul 31, 2019
2 parents f17e084 + 103b1e0 commit d45a512
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
17 changes: 14 additions & 3 deletions api-rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ Slug: data
HTTP/1.1 201 Created
```

### Deleting containers
A container can only be deleted if it contains no resources.

### Creating documents (files)

To create a new resource, the `Link` header value must be set to the following
Expand Down Expand Up @@ -269,10 +272,10 @@ More examples can be found in the LDP [Primer document](http://www.w3.org/TR/ldp

#### HTTP `PUT` to create

An alternative (though not standard) way of creating new resources is to use
An alternative (though not common) way of creating new resources is to use
HTTP `PUT`. Although HTTP `PUT` is commonly used to overwrite resources, this way is
usually preferred when creating new non-RDF resources (i.e., using a MIME type
other than `text/turtle`).
usually preferred when creating new non-RDF resources (i.e., using a different MIME
type than `text/turtle`).

**REQUEST**

Expand Down Expand Up @@ -409,3 +412,11 @@ Allow: OPTIONS, HEAD, GET, PATCH, POST
MS-Author-Via: SPARQL
```

### WAC-Allow headers
Servers SHOULD send a WAC-Allow response header on HEAD and GET, with a value like:

```http
WAC-Allow: user="read write append control",public="read"
```
In general, the format is `user="` + user-permissions = `",public="` + public-permissions + `"`. User-permissions and public-permissions should both be space-separated lists, containing a subset of ['read', 'write', 'append', 'control']. If 'write' is present then 'append' should also be present.
6 changes: 4 additions & 2 deletions api-websockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ versioned as a whole.

Live updates are currently only supported through WebSockets. This describes a
subscription mechanism through which clients can be notified in real time of
changes affecting a give resource.
changes affecting a given resource.

The PubSub system is very basic. Clients only need to open a WebSocket
connection and *sub*(scribe) to a given resource URI. If any change occurs in
that resource, a *pub*(lish) event will be sent to all the subscribed clients.

The WebSocket server URI is the same for any resource located on a given data
space (same hostname). To discover the URI of the WebSocket server, clients can
send an HTTP OPTIONS. The server will then include an `Updates-Via` header in
send an HTTP OPTIONS request. The server will then include an `Updates-Via` header in
the response:

REQUEST:
Expand Down Expand Up @@ -49,6 +49,8 @@ space and the URI of the resource that has changed:
pub https://example.org/data/test
```

Only absolute URIs should be used in both the `sub` and the `pub` message.

Subscribing to a container can also be really useful, since all CRUD operations
(POST, PUT, PATCH, DELETE) performed on resources of that container will trigger
a notification for the container URI. This makes synchronization between
Expand Down
2 changes: 1 addition & 1 deletion content-representation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Our motivation is threefold:
even though the resource is stored as a Turtle file).

3. Direct mapping: the URLs map directly to the file system resources -- i.e.
`https://example.org/test.ttl` maps to `/home/user/www/test.ttl`
`https://example.org/avatar.png` maps to `/home/user/www/avatar.png`

Servers must support the HEAD method for reading data. This returns a list of
headers related to the resource in question. Among these headers, two very
Expand Down
18 changes: 9 additions & 9 deletions recommendations-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ space#preferencesFile](http://www.w3.org/ns/pim/space#preferencesFile) property.

```ttl
<#me>
<http://www.w3.org/ns/pim/space#preferencesFile> <../settings/preferences.ttl> ;
<http://www.w3.org/ns/pim/space#preferencesFile> <../settings/preferences> ;
```

##### `/inbox/` (Inbox)
Expand All @@ -75,29 +75,29 @@ clients).

**1)** When the `Origin` header is set:

1. Client (browser) loads an app from `https://app.org` and wants to send an XHR
(ajax) request to the server at `https://example.org`. Before sending the
1. Client (browser) loads an app from `https://app.example` and wants to send an XHR
(ajax) request to the server at `https://server.example`. Before sending the
request over the wire, the browser adds the `Origin` header: `Origin:
https://app.org`, which corresponds to the domain from where the app was loaded.
https://app.example`, which corresponds to the domain from where the app was loaded.

2. The server running on https://example.org receives the request and looks at the
`Origin` header. It sees `https://app.org`, stores the value and handles the
2. The server running on `https://server.example` receives the request and looks at the
`Origin` header. It sees `https://app.example`, stores the value and handles the
request.

3. The server responds to the request and sets the value of the request `Origin`
header to the CORS header in the HTTP response:

```http
Access-Control-Allow-Origin: https://app.org
Access-Control-Allow-Origin: https://app.example
```

**2)** Without an `Origin` header:

1. A curl request is sent from the terminal to `https://example.org`. Unless
1. A curl request is sent from the terminal to `https://server.example`. Unless
explicitly specified though a curl parameter, the `Origin` header will not be
set.

2. The server running on `https://example.org` receives the request and does not
2. The server running on `https://server.example` receives the request and does not
find an `Origin` header.

3. The server responds to the request and sets a default "all" value for the
Expand Down
8 changes: 4 additions & 4 deletions solid-webid-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ across several RDF documents:

* `/profile/card` - their primary (public-readable) WebID Profile.
Which would contain a `space:preferencesFile` link to:
* `/settings/prefs.ttl` - a private (only the user has read/write access)
* `/settings/preferences` - a private (only the user has read/write access)
Preferences file which contains further profile-related statements.

### Extended Profile
Expand Down Expand Up @@ -282,16 +282,16 @@ For example, a link to the Listed Type Index in the main profile document:
<#me>
a foaf:Person ;
<http://www.w3.org/ns/solid/terms#publicTypeIndex>
</settings/publicTypeIndex.ttl> .
</settings/publicTypeIndex> .
```

And an example corresponding link to the Unlisted Type Index, in a private
resources of the Extended Profile, such as the Preferences file
(in `/settings/prefs.ttl`):
(in `/settings/preferences`):

```ttl
# ...
<#me>
<http://www.w3.org/ns/solid/terms#privateTypeIndex>
</settings/privateTypeIndex.ttl> .
</settings/privateTypeIndex> .
```

0 comments on commit d45a512

Please sign in to comment.