Skip to content

Require LWS container shape only for application/lws+json - #253

Merged
jeswr merged 23 commits into
w3c:mainfrom
jeswr:codex/issue-246-container-negotiation
Oct 16, 2026
Merged

jeswr merged 23 commits into
w3c:mainfrom
jeswr:codex/issue-246-container-negotiation

Conversation

@jeswr

@jeswr jeswr commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Source finding

Addresses #246. The container media-type section currently requires unprofiled application/ld+json and application/json responses to use the same LWS JSON shape as application/lws+json, and requires servers to support all three media types. This is stronger than needed for clients that explicitly request the LWS format.

Change

  • Require servers to honor application/lws+json requests for containers and return the defined LWS container structure.
  • Remove the general equivalence and mandatory negotiation requirements for the unprofiled JSON media types.
  • Retain the existing SHOULD recommendation to treat application/ld+json; profile="https://www.w3.org/ns/lws/v1" as equivalent to application/lws+json.
  • Scope the read-operation and container-definition wording to the LWS container representation.

This changes protocol behavior; it is not an editorial-only correction. The profiled JSON-LD recommendation remains intact.

Validation

  • git diff --check upstream/main...HEAD passed.
  • Confirmed the upstream diff changes only the three relevant core specification source files.
  • No runtime tests apply to this specification prose change.

This wording was reviewed in the personal-fork PR.


Preview | Diff

Copilot AI lite review requested due to automatic review settings September 25, 2026 03:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Container member-metadata requirements still need to be scoped to the application/lws+json representation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Narrows mandatory LWS container shaping to explicit application/lws+json requests while retaining profiled JSON-LD equivalence guidance.

Changes:

  • Updates container media-type negotiation.
  • Scopes container representation requirements to LWS JSON.
  • Clarifies container GET wording.
File Summary
lws10-core/​Operations/​read-resource.md Updates container GET representation wording.
lws10-core/​lws-media-type.md Narrows media-type negotiation requirements.
lws10-core/​container-representation.md Scopes the representation structure to LWS JSON.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lws10-core/Operations/read-resource.md Resolved
Clarified the response details for GET requests on containers, including metadata requirements and content types.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The protocol behavior changes require final human review.

Review effort: Lite
Findings: None

Resolved since last review (1)

#### Media Type Equivalence
#### Content Negotiation

For <a>container representations</a>, the media types `application/lws+json`, `application/ld+json`, and `application/json` are equivalent: the response body is the same JSON-LD document conforming to the <a>container representation</a> structure defined in [](#container-representation), and only the `Content-Type` response header varies. Servers MUST honor a request for any of these media types and MUST set the `Content-Type` response header to the requested media type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a non-normative note that lws+json representation can be used for both ld+json and even json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ismorphic RDF we may need to requrie a profile and don't have this grarantee ld+json without a profile. Possibly another note that points out that gotcha.

@elf-pavlik

Copy link
Copy Markdown
Member

@jeswr we have this PR on Monday agenda, would you like to include

@acoburn

acoburn commented Oct 2, 2026

Copy link
Copy Markdown
Member

Adding isomorphism guarantees would be a nice addition, especially for implementations that support RDF-based conneg. There may be some gotchas, though, if some implementations add data to named graphs and also offer RDF serializations that don't support graphs (e.g. N-Triples and Turtle). Implementer feedback would be very helpful here.

@gibsonf1

gibsonf1 commented Oct 2, 2026

Copy link
Copy Markdown

Adding isomorphism guarantees would be a nice addition, especially for implementations that support RDF-based conneg. There may be some gotchas, though, if some implementations add data to named graphs and also offer RDF serializations that don't support graphs (e.g. N-Triples and Turtle). Implementer feedback would be very helpful here.

In our case, the Pod itself is the named graph, so turtle is all that is needed. I'm not sure what it would mean to save data with named graphs to a Storage other than to a file?

@jeswr

jeswr commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

@jeswr we have this PR on Monday agenda, would you like to include

Yes, I will push the changes here before Monday. I've been trying to get the text into a state that I am happy with before squashing the commits here because I don't want to spam.

Defines the LWS profile (https://www.w3.org/ns/lws/v1) and the LWS
dataset of a container. Servers MUST honor application/lws+json and
application/ld+json. Clients request the LWS profile with the profile
media type parameter (JSON-LD 1.1, RDF 1.2 Turtle, TriG, N-Triples,
N-Quads); responses in the profile MUST be isomorphic to the LWS dataset.
Unprofiled RDF representations are unconstrained. Adds request/response
examples, as discussed at the 5 October 2026 WG meeting.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
@jeswr
jeswr marked this pull request as draft October 7, 2026 10:02
claude and others added 6 commits October 7, 2026 10:16
Shorter profile and negotiation text without named graphs or JSON-LD-only
sentences; container, GET and pagination examples now tab between
application/lws+json, Turtle, N-Triples and RDF/XML (with a profile Link
header), as discussed with the editors.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
Also removes the unprofiled Solid example tab and its note, which
illustrated that paragraph.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
Removes the content negotiation examples and restores the original
pagination example; the multi-format examples now live only in the
container representation and GET-a-container sections. The GET example
gains the RDF/XML tab with the profile Link header.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
The content negotiation MUST now covers application/lws+json only.
Conforming to the LWS profile is stated as being RDF isomorphic to the
application/lws+json representation, wherever the profile is required.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
PR previews and published copies carry only index.html, so tabs.js and
the tab CSS in local.css never loaded there. Move both inline, and add a
small Turtle/N-Triples highlighter (ReSpec's highlighter has no Turtle
grammar) using the existing hljs classes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
…ation' into codex/issue-246-container-negotiation
The markup validator requires every role=tab to control a role=tabpanel.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
Each tab now shows the request, the response headers and the response
body as separate blocks, so headers always use the HTTP highlighter and
bodies use their own (JSON, Turtle, XML). The Turtle highlighter no
longer needs to handle HTTP headers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
Adds a script that parses every tab of each example-tabs block (lws+json
as JSON-LD with the context built from the vocabulary, Turtle, N-Triples,
RDF/XML) and fails if any tab's body is not RDF isomorphic to the first.
The container representation example gets a data-base attribute so its
relative IRIs resolve against the container URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VufuVyWV2G4vZcj9FSwV7n
@jeswr
jeswr marked this pull request as ready for review October 11, 2026 19:50
@jeswr
jeswr merged commit ecce8a7 into w3c:main Oct 16, 2026
3 checks passed
@jeswr
jeswr deleted the codex/issue-246-container-negotiation branch October 16, 2026 15:21
ebremer added a commit to ebremer/lws-drupal that referenced this pull request Oct 20, 2026
The drafts replaced the "as_uri" and "realm" of the 401 challenge with
OAuth 2.0 Protected Resource Metadata (w3c/lws-protocol#256). Every 401
in the LWS URL space now carries resource_metadata, the metadata URL of
the URL the client requested: the origin of the base URL, then
/.well-known/oauth-protected-resource, the base path, the raw path and
the query as sent. The Link to the storage stays; a storage without an
authorization server still answers 503.

as_uri and realm still follow by default, for clients of the earlier
drafts: lws_authz.settings:legacy_challenge (TRUE; on the authorization
settings form; update 11005) turns them off. Authentication's realm and
asUri are now storageUri and issuer, with the flag beside them, so lws
never reads lws_authz's config.

lws_authz serves the metadata at /.well-known/oauth-protected-resource
followed by any path, mapped onto one route by a path processor as
LwsPathProcessor does for the LWS URL space: resource, character for
character the requested URL; authorization_servers, the issuer of the
storage's authorization server; bearer_methods_supported, header only.
It is the same for every URL of a storage, existing or not, needs no
token (no Authorization header can make it fail), is readable cross-
origin and cached for 300 seconds, and answers 404 for a URL that names
no storage or one without an authorization server. A site below the
root of its host needs the web server to send the RFC 9728 URL there, as
for the authorization server's metadata; the status report fetches it
as a client would and says where.

An access token's aud now has to include the storage URI rather than be
it alone. The token exchange already required the storage URI as
resource; only its wording changed.

The LWS profile (w3c/lws-protocol#253): profile is read as a list of
URIs, quoted or not, with case-insensitive parameter names. Containers,
the notification service's listing and the access request and grant
listings answer ld+json with profile="https://www.w3.org/ns/lws/v1"
when it is asked for, and a range naming only other profiles does not
select ld+json. The listings in no profile never claim it. Turtle and
the other RDF syntaxes stay unoffered (406): lws-drupal has no JSON-LD
1.1 processor to derive them, and only lws+json is required.

DESIGN §6.7 and §12 rows 18-21 record the decisions. 39 more tests;
the suite passes on SQLite, MySQL 8.4, MariaDB 11.8 and PostgreSQL 17;
phpcs and phpstan are clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants