The Activity Streams 2.0 context document is a definition file maintained by the W3C Social Web Community Group (SocialCG). This document describes the process and criteria for approving extensions for inclusion in the main Activity Streams 2.0 context document.

Motivation

Activity Streams 2.0, as described in [[activitystreams-core]] and [[activitystreams-vocabulary]] is a vocabulary for representing social data. It is used by, among others, the [[activitypub]] API and protocol. It is designed to be extensible, so that new terms can be used by publishers and consumers.

Extensions provide at least the following benefits:

Any publisher can define an extension to Activity Streams 2.0, and use it in published documents. For example, a publisher could define an extension that provides a term for the favorite ice cream flavor of a person.

Context document for the example favorite ice cream flavor context.
              {
                  "@context": {
                      "ic": "https://flavors.example/ns/icecream#",
                      "favoriteIceCreamFlavor": {
                          "@id": "ic:favoriteIceCreamFlavor",
                          "@type": "@id"
                      },
                      "Chocolate": "ic:Chocolate",
                      "Vanilla": "ic:Vanilla",
                      "Strawberry": "ic:Strawberry",
                      "Pistachio": "ic:Pistachio"
                  }
              }
            

This publisher, or any other publisher, can create Activity Streams 2.0 documents that use this extension.

Example of a person with a favorite flavor of ice cream term.
              {
                  "@context": [
                      "https://www.w3.org/ns/activitystreams",
                      "https://favorites.example/ns/icecream"
                  ],
                  "id": "https://example.com/people/evan",
                  "type": "Person",
                  "name": "Evan Prodromou",
                  "favoriteIceCreamFlavor": "Pistachio"
              }
            

If the publisher uses different extensions in the same document with the same term(s), they will need to resolve those naming conflicts by hand.

Example of using two extensions with conflicting terms for "Chocolate" as an ice cream flavor and as a color of a horse's coat.
              {
                  "@context": [
                      "https://www.w3.org/ns/activitystreams",
                      "https://favorites.example/ns/icecream",
                      "https://horse.example/ns/colors"
                  ],
                  "id": "https://example.com/people/evan",
                  "type": "Person",
                  "name": "Evan Prodromou",
                  "favoriteIceCreamFlavor": "ic:Chocolate",
                  "horseCoatColor": "horse:Chocolate"
              }
            

Any publisher or consumer can implement this extension, subject to the terms of the creator's license(s), if any.

Referencing many extensions can be a burden for publishers and consumers. Although one or two lines in the @context property of the Activity Streams 2.0 document may not be a problem, ten or twenty could be. In addition, the more extensions that are used, the more likely it is that there will be conflicts between terms.

If an extension becomes very popular, it may be useful to include its terms and namespace in the main Activity Streams 2.0 context document. The W3C Social Web Community Group (SocialCG) is responsible for maintaining the Activity Streams 2.0 context document, and can add terms for popular extensions.

Adding the extension terms to the main context document has several benefits. It lets publishers use the extension without having to include an additional line of context. The extension's terms will be available for all documents that use the Activity Streams 2.0 context, without requiring a namespace prefix. It also provides an opportunity for the SocialCG to resolve conflicts between terms in different extensions.

Theoretical example of using the favorite ice cream flavor term after it has been included in the main Activity Streams 2.0 context document.
              {
                  "@context": "https://www.w3.org/ns/activitystreams",
                  "id": "https://example.com/people/evan",
                  "type": "Person",
                  "name": "Evan Prodromou",
                  "favoriteIceCreamFlavor": "Chocolate"
              }
            

This inclusion does not come without a price. First, the Activity Streams 2.0 context document is that much larger, which has a cost in terms of readability, maintainability, and bandwidth used. In addition, there is work for the SocialCG in updating, documenting, harmonizing, and maintaining the context document.

This Report describes the criteria that the SocialCG will use to decide whether the benefits of simplicity and clarity from adding extension terms to the main context document outweigh the costs of doing so. It is a refinement of the W3C's Adding to W3C RDF Namespaces document to the specific needs of the SocialCG, Activity Streams 2.0, and ActivityPub.

Properly implemented, this process provides a way to make Activity Streams 2.0 a continuously evolving vocabulary, serving new needs for developers and users, while maintaining the stability of the core terms.

Adding terms

These are the steps to including an extension in the Activity Streams 2.0 context document.

  1. Publish the extension for review. Extensions can be published through the Federation Enhancement Proposal (FEP) process, as Reports of the SocialCG, through another standardisation process, or by any other organisations or individuals. See "Criteria" below for required content.
  2. Implement the extension. See "Criteria" below for implementation requirements.
  3. List the extension in the Activity Streams 2.0 extensions registry.
  4. Propose the extension for inclusion. The proposal should include a justification for inclusion of the extension.
  5. Vote on the extension. The SocialCG will vote on whether to include the extension in the Activity Streams 2.0 context document.
  6. Create a version of the Activity Streams 2.0 context document including the extension terms and namespace. Versions of the Activity Streams 2.0 context document are published at https://www.w3.org/ns/activitystreams-history/. Note that the canonical version of the Activity Streams 2.0 context document at https://www.w3.org/ns/activitystreams should not be changed at this point.
  7. Test the version of the Activity Streams 2.0 context document. Implementers should test the new version of the Activity Streams 2.0 context document. If there are problems, additional versions can be added and tested.
  8. Publish the new version as the canonical version of the Activity Streams 2.0 context document. At this point, the canonical version of the Activity Streams 2.0 context document will include the new terms.
  9. Publish a new version of the Activity Streams 2.0 Terms document. This HTML document is served at the https://www.w3.org/ns/activitystreams URL when HTML is requested, providing documentation about all the terms in the context. The new version should include the new terms, and a link to the SocialCG resolution approving the new terms.

Criteria

To be included in the Activity Streams 2.0, extensions SHOULD meet these requirements.

Extensions to be included MAY meet these criteria:

Reviews may be provided by the submitter, other members of the SocialCG, or by one of the dedicated groups that provide horizontal review of W3C specifications. For instructions, see How to get horizontal review, which also includes instructions for self-reviews.

Modifying and removing terms

The W3C policy on namespaces has specific requirements for modifying or removing terms from a namespace document such as a JSON-LD context document. In short, terms defined in a Recommendation may not be modified or removed. This would include all published Activity Streams 2.0 and ActivityPub terms.

The SocialCG MAY remove or modify extension terms, recognizing that this will be disruptive to publishers and consumers who depend on the extension term being in the context document. The SocialCG SHOULD NOT remove extension terms without a strong justification. Serious security issues or legal issues, for example, may justify removal. Modifying or removing an extension term MUST be approved by a resolution of the SocialCG.

The SocialCG MAY mark terms as deprecated. Deprecated terms are still part of the context document, but are documented as deprecated. Deprecating a term MUST be approved by a resolution of the SocialCG.

Previous Work

The section on Extensibility in [[activitystreams-core]] says, in part, "Some popular extensions are included in the Activity Streams 2.0 namespace document [...]". It does not define how extensions are added and which criteria are used to decide whether an extension is popular enough to be included.

The section on Extensions in the Activity Streams 2.0 namespace document says, in part, "The extensions must document their terms in a spec-like way at a persistant [sic] URL. Approval of extensions will be by the Social Web WG until it closes, and after that by the followup Community Group. Process and criteria for extensions approval is being finalised and will be described or linked to here in due course."

Changelog