Activity Streams/Primer/Activity Streams 1.0 to Activity Streams 2.0

From W3C Wiki

From Appendix B of AS2 Vocabulary

While the syntax defined by this specification diverges from that defined by JSON Activity Streams 1.0, the fundamental model defined by that original specification remains intact. Specific processing rules are defined by this specification that allow existing Activity Streams 1.0 documents to be mapped to and processed as an Activity Streams 2.0 document.

The JSON syntax defined by this specification differs somewhat from that defined in the original JSON Activity Streams 1.0 [ AS1] specification in ways that are not backwards compatible. Implementations can choose to continue supporting the JSON Activity Streams 1.0 syntax but ought consider it to be deprecated. This means that while implementations can continue to consume the 1.0 syntax, they should not output the 1.0 syntax unless specifically interacting with older non-2.0 compliant implementations.

Specifically:

  • Implementations can use the "application/stream+json" MIME media type when producing a JSON serialization using the Activity Streams 1.0 syntax, and "application/activity+json" when producing a serialization conforming to the 2.0 syntax.
  • Implementations that process serializations identified using either the "application/stream+json" or the more generic "application/json" MIME media type must follow the syntax and processing rules set by [AS1]. The 2.0 syntax and processing rules apply only when handling serializations using the "application/activity+json" media type.
  • When processing Activity Streams 1.0 documents using a JSON-LD processing model, implementations can use the special AS 1.0 to AS 2.0 expansion @context definition provided here to produce the JSON-LD expanded representation. Refer to the JSON-LD Processing Algorithms and API for details.
  • When processing Activity Streams 1.0 documents and converting those to 2.0, implementations ought to treat id as an alias for the JSON-LD @id key word; and the objectType and verb properties as aliases for the JSON-LD @type keyword.
  • Activity Streams 1.0 uses the displayName property which has been renamed to name in Activity Streams 2.0. Implementations ought to treat displayName as an alias for name.
  • Activity Streams 1.0 uses the title property which has been dropped from Activity Streams 2.0. Implementations processing Activity Streams 1.0 documents as Activity Streams 2.0 ought to treat instances of the title property as an extension.
  • This document redefines the content and summary properties as natural language values which means their values can be expressed as either a string or an object mapping language tags to string values. In the 1.0 syntax, these are expressed solely as String values. Because the 1.0 values are a valid subset allowed by this specification, implementations are not required to take any specific action to continue supporting those values.
  • This document redefines a large number of common properties defined originally as Objects in 1.0 as either Objects or Links. The JSON-LD serialization allows such property values to be expressed as either an IRI String, an JSON object, or an Array of IRI Strings and JSON objects. Because the 1.0 values are a valid subset allowed by this specification, existing implementations are not required to take any specific action to continue supporting those values.
  • This specification deprecates the upstreamDuplicates and downstreamDuplicates properties defined by Activity Streams 1.0 and does not provide a replacement. This is due largely to lack of any reasonable implementation evidence. While the upstreamDuplicates and downstreamDuplicates properties may continue to be used, implementations should avoid them.
  • In Activity Streams 1.0, the "post" verb was defined to describe the action of both creating an object and "posting" or uploading it to a service. This specification replaces the "post" verb with separate Create and Add Activity types. When processing Activity Streams 1.0 documents and converting those into 2.0, implementations should treat instances of the " post" verb as equivalent to Create if there is no target property specified; and equivalent to Add if there is a target property specified.

By following these guidelines, all JSON Activity Streams 1.0 serializations can be processed successfully by 2.0 implementations.

Property by property comparison

TBD, include a property by property comparison, in particular @context

External links