Activity Streams/Primer/Terms

From W3C Wiki

Terms in Activity Streams 2.0 have one of three formats:

  1. The fully defined property name with namespace, such as "https://www.w3.org/ns/activitystreams#Follow" or "https://w3id.org/security#publicKey".
  2. The Curie format, such as "as:Follow" or "sec:publicKey". Here, the namespace prefix "https://www.w3.org/ns/activitystreams#" is replaced with a shortened version as defined in the context document.
  3. The unprefixed format, such as "Follow" or "publicKey". The context document defines aliases for these terms with a curie version.

Many consumers don't use JSON-LD for processing AS2 documents, and simply look for the unprefixed format in the JSON file.

For this reason, Activity Streams 2.0 publishers should use the unprefixed format if possible, then the curie format as a fallback, and finally the fully-defined namespace format. The unprefixed format is also the most byte-efficient, so should provide the performance.

Note that the CURIE prefix is defined in the context, and can vary from document to document. All AS2 documents should have the "as:" prefix used for the AS2 namespace, but many documents will use different prefixes for other namespaces.

Well-behaved Activity Streams 2.0 consumers should be prepared to see any of these formats in any AS2 document.