Activity Streams/Primer/Complex Properties
Many of the terms in the Activity Streams 2.0 namespace have a @type
of @id
. There is a full list at the end of this page.
This means that the property value can be a first-class object in the AS2 system.
The possible values for these properties in an AS2 document are surprisingly varied. Here are some possibilities:
- An ID reference, represented as a string. This is the ID of the related value. It is an URI, either fully defined such as "acct:username@example.com", or a shortened version of the URI as a curie (AKA compact URI), like "as:Public", or an unprefixed term, like "Public". In ActivityPub, these IDs should be a resolvable HTTPS URI.
- An object (AKA hash). This is a representation of some or all of the properties of the object.
- An array. Unless otherwise noted, any @id property can have multiple values. These will be represented in an array. The elements of the array are commonly strings, objects, or a mix of the two.
- A literal value. For a few properties, such as
closed
, the value can alternate between one of the above, or a literal value like a datetime.
Guidance for publishers
The contents of @id properties should either be a resolvable HTTPS URI if possible, or an object.
In object format, the value should include at least the id
, type
, and one of name
, nameMap
, summary
, summaryMap
.
For values in arrays, it is easier for consumers to process array items that are of a uniform type.
For arrays of a single element, instead include that element directly. So, use "type": "Note"
instead of "type": ["Note"]
.
Guidance for consumers
Be ready to process array values for all of these properties. In particular, the type
value can be an array.
@id properties
- actor
- object
- context
- closed
TBD