diff --git a/lws10-core/Operations/create-resource.md b/lws10-core/Operations/create-resource.md index 07fdb8c..c212042 100644 --- a/lws10-core/Operations/create-resource.md +++ b/lws10-core/Operations/create-resource.md @@ -23,7 +23,7 @@ The **create resource** operation adds a new [served resource](#dfn-served-resou New resources are created using POST to a target container URI, with the server assigning the final identifier. Clients MAY suggest a name via the `Slug` header. Clients MAY provide initial user-managed metadata for the new resource by including one or more `Link` headers in the POST request, following the syntax of Web Linking in [[RFC8288]]. Server-managed metadata MUST be generated automatically by the server upon creation and MUST NOT be overridden by client-provided links. -On success, the server MUST return the 201 status code with the new URI in the `Location` header. The server MUST include `Link` headers for key server-managed metadata, including a link to the parent container (`rel="up"`), and a link to the created resource's dedicated linkset resource (`rel="linkset"; type="application/linkset+json"`). Additional links SHOULD include `rel="type"` (indicating `https://www.w3.org/ns/lws#Container` or `https://www.w3.org/ns/lws#DataResource`). The body MAY be empty or include a minimal representation of the resource. All metadata creation and linking MUST be atomic with the resource creation to maintain consistency. +On success, the server MUST return the 201 status code with the new URI in the `Location` header. The server MUST include `Link` headers for key server-managed metadata, including a link to the parent container (`rel="up"`), and a link to the created resource's dedicated linkset resource (`rel="linkset"; type="application/linkset+json"; profile="lws-meta"`). Additional links SHOULD include `rel="type"` (indicating `https://www.w3.org/ns/lws#Container` or `https://www.w3.org/ns/lws#DataResource`). The body MAY be empty or include a minimal representation of the resource. All metadata creation and linking MUST be atomic with the resource creation to maintain consistency. **POST (to a container URI)** – *Create with server-assigned name:* Use POST to add a new resource inside an existing container. The server assigns an identifier to the resource, optionally suggested via the `Slug` header. The server MAY honor the Slug header if it does not conflict with naming rules or existing resources. Clients indicate the type of resource to create as follows: @@ -54,7 +54,7 @@ In this example, the client is posting to the container `/alice/notes/`. HTTP/1.1 201 Created Location: /alice/notes/shoppinglist.txt Content-Type: text/plain; charset=UTF-8 -Link: ; rel="linkset"; type="application/linkset+json" +Link: ; rel="linkset"; type="application/linkset+json; profile="lws-meta" Link: ; rel="up" Link: ; rel="type" Content-Length: 0 @@ -76,7 +76,7 @@ Link: ; rel="type" ``` HTTP/1.1 201 Created Location: /alice/notes/ -Link: ; rel="linkset"; type="application/linkset+json" +Link: ; rel="linkset"; type="application/linkset+json; profile="lws-meta" Link: ; rel="up" Link: ; rel="type" Content-Length: 0 diff --git a/lws10-core/Operations/metadata.md b/lws10-core/Operations/metadata.md index 917b476..2db685c 100644 --- a/lws10-core/Operations/metadata.md +++ b/lws10-core/Operations/metadata.md @@ -9,12 +9,11 @@ All metadata in LWS is expressed as a set of typed links originating from a reso Metadata distinguishes between resources and their representations, allowing for multiple media types where applicable. For data resources, metadata includes representations, each with mediaType and optional sizeInBytes. For containers and data resources we consider the link to its parent container resource to be part of the metadata of the resource. - **The Linkset Resource** -For each resource in storage, a server MUST make metadata links available as a standalone resource according to [[!RFC9264]]. +For each resource in storage, a server MUST make metadata links available as a linkset, according to [[!RFC9264]]. - Discovery: A resource's linkset is discoverable via a Link header with the relation `rel="linkset"`. -- Media Type: A linkset resource MUST be available as `application/linkset+json`. -- Integrity: The 'linkset' link MUST point to a server-managed resource. Updates to the linkset MUST be atomic with associated resource operations to maintain consistency. +- Media Type: A linkset resource MUST be available as `application/linkset+json; profile="lws-meta"`. The `lws-meta` profile allows the server to distinguish between linksets as auxiliary resource and linksets as data resource. +- Integrity: The 'linkset' link MUST point to an LWS resource in the same storage. Updates to the linkset MUST be atomic with associated resource operations to maintain consistency. **Discovering Metadata** Clients discover metadata primarily through Link headers in response to GET or HEAD requests. diff --git a/lws10-core/Operations/read-resource.md b/lws10-core/Operations/read-resource.md index df63c44..b3b8d4d 100644 --- a/lws10-core/Operations/read-resource.md +++ b/lws10-core/Operations/read-resource.md @@ -23,7 +23,7 @@ HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 Content-Length: 34 ETag: "abc123456" -Link: ; rel="linkset"; type="application/linkset+json" +Link: ; rel="linkset"; type="application/linkset+json; profile="lws-meta" Link: ; rel="up" Link: ; rel="type" @@ -52,7 +52,7 @@ Assuming the container exists and the client has access: HTTP/1.1 200 OK Content-Type: application/lws+json ETag: "container-etag-789" -Link: ; rel="linkset"; type="application/linkset+json" +Link: ; rel="linkset"; type="application/linkset+json; profile="lws-meta" Link: ; rel="up" Link: ; rel="type" diff --git a/lws10-core/Operations/update-resource.md b/lws10-core/Operations/update-resource.md index 0209afc..82d2825 100644 --- a/lws10-core/Operations/update-resource.md +++ b/lws10-core/Operations/update-resource.md @@ -54,9 +54,9 @@ A client first fetches the linkset and receives its ETag. ``` GET /alice/personalinfo.json.meta HTTP/1.1 Authorization: Bearer -Accept: application/linkset+json +Accept: application/linkset+json; profile="lws-meta" HTTP/1.1 200 OK -Content-Type: application/linkset+json +Content-Type: application/linkset+json; profile="lws-meta" ETag: "meta-v1" { "linkset": [ @@ -71,7 +71,7 @@ The client now wants to add a license. It constructs a new, complete linkset doc ``` PUT /alice/personalinfo.json.meta HTTP/1.1 Authorization: Bearer -Content-Type: application/linkset+json +Content-Type: application/linkset+json; profile="lws-meta" If-Match: "meta-v1" { "linkset": [ @@ -92,4 +92,4 @@ ETag: "meta-v2" **Summary of Update Rules** If you want to change only the content of a resource → PUT/PATCH the resource itself. If you want to change only the links (metadata) of a resource → PUT/PATCH the resource’s associated linkset resource. -If you want to change both content and links → PUT/PATCH the resource itself, including the appropriate Link headers AND 'Prefer: set-linkset'. Setting both is off by default. \ No newline at end of file +If you want to change both content and links → PUT/PATCH the resource itself, including the appropriate Link headers AND 'Prefer: set-linkset'. Setting both is off by default. diff --git a/lws10-core/lws-media-type.md b/lws10-core/lws-media-type.md index 07981df..a425a63 100644 --- a/lws10-core/lws-media-type.md +++ b/lws10-core/lws-media-type.md @@ -67,7 +67,7 @@ Response (first page): HTTP/1.1 200 OK Content-Type: application/lws+json ETag: "photos-page1-etag" -Link: ; rel="linkset"; type="application/linkset+json" +Link: ; rel="linkset"; type="application/linkset+json"; profile="lws-meta" Link: ; rel="up" Link: ; rel="acl" Link: ; rel="type" @@ -111,7 +111,7 @@ Response (middle page): HTTP/1.1 200 OK Content-Type: application/lws+json ETag: "photos-page2-etag" -Link: ; rel="linkset"; type="application/linkset+json" +Link: ; rel="linkset"; type="application/linkset+json"; profile="lws-meta" Link: ; rel="up" Link: ; rel="acl" Link: ; rel="type"