w3c / w3c/activitystreams

ld+json with "activitystreams profile" violates expectations of ld+json profile= parameter

Open
#685 6 comments 0 reactions 1 assignee View on GitHub

@evanp is already working on this.

Since Apr 10, 2026.

Waiting for Commenter
Dominant language
HTML
Stars
313
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Context

JSON-LD registers application/ld+json; profile= like this:

profile: A non-empty list of space-separated URIs identifying specific constraints or conventions that apply to a JSON-LD document according to [RFC6906]. A profile does not change the semantics of the resource representation when processed without profile knowledge, so that clients both with and without knowledge of a profiled resource can safely use the same representation. The profile parameter MAY be used by clients to express their preferences in the content negotiation process. If the profile parameter is given, a server SHOULD return a document that honors the profiles in the list which it recognizes, and MUST ignore the profiles in the list which it does not recognize. It is RECOMMENDED that profile URIs are dereferenceable and provide useful documentation at that URI. For more information and background please refer to [RFC6906].

AS2-Core says this in Section 8.1:

Note that while the Activity Streams 2.0 format uses JSON-LD conventions, there are a number of constraints and additional requirements for Activity Streams 2.0 implementations that justify the use of a specific media type.

Because Activity Streams 2.0 can be considered a restricted profile of JSON-LD, Implementations SHOULD consider the application/ld+json; profile="https://www.w3.org/ns/activitystreams" media type as being equivalent to application/activity+json.

The issue

If the "@context" is not included, and the application/activity+json media type is not used, then you have no way of assuming the semantics of AS2 without profile knowledge from profile="https://www.w3.org/ns/activitystreams". Thus, AS2 is a profile of JSON-LD only when the equivalent "@context" is provided; it cannot be blindly injected into every single application/ld+json document. (Context injection is still valuable for converting specific media types into application/ld+json, such as converting application/activity+json to application/ld+json with the profile.)

Recommended actions

  • Refine the guidance in Section 8.1 to clarify that application/activity+json and application/ld+json; profile="https://www.w3.org/ns/activitystreams" are only equivalent when the AS2 document contains a "@context" value of "https://www.w3.org/ns/activitystreams" that does not get overridden anywhere (via @context: null or via redefining terms in later contexts). (If the context is missing, it can only be called activity+json.)

Tags:

  • Next version
  • Errata
  • Maybe a Primer Page would help here, too?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.