OrderedCollection is defined as an ordered set in the Activity Vocabulary, but the precise ordering is not defined. The ActivityPub specification requires that instances of OrderedCollection MUST be ordered reverse chronologically by insertion order, but a later errata was proposed to relax this restriction by only applying it to properties defined as OrderedCollection within the ActivityPub specification. Consequently, this allows for some collections to be presented forward chronologically by insertion order, and some collections to be presented reverse chronologically by insertion order. This FEP introduces an orderType
property and two vocabulary terms ForwardChronological
and ReverseChronological
to explicitly signal the ordering of a collection.
https://w3id.org/fep/1985/orderType
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/fep/1985"
],
"id": "https://domain.example/some-collection",
"type": "OrderedCollection",
"orderedItems": [
"https://domain.example/objects/1",
"https://domain.example/objects/2",
"https://domain.example/objects/3"
],
"orderType": "ForwardChronological"
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://domain.example/some-collection",
"type": "OrderedCollection",
"orderedItems": [
"https://domain.example/objects/1",
"https://domain.example/objects/2",
"https://domain.example/objects/3"
],
"https://w3id.org/fep/1985/orderType": {
"id": "https://w3id.org/fep/1985/ForwardChronological"
}
}
https://w3id.org/fep/1985/OrderingClass
orderType
property's range.(This section is non-normative.)
Example of a forward chronological OrderedCollection with additional context:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/fep/1985"
],
"id": "https://domain.example/some-collection",
"type": "OrderedCollection",
"orderedItems": [
"https://domain.example/objects/1",
"https://domain.example/objects/2",
"https://domain.example/objects/3"
],
"orderType": "ForwardChronological"
}
Example of a forward chronological OrderedCollection without additional context:
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://domain.example/some-collection",
"type": "OrderedCollection",
"orderedItems": [
"https://domain.example/objects/1",
"https://domain.example/objects/2",
"https://domain.example/objects/3"
],
"https://w3id.org/fep/1985/orderType": {
"id": "https://w3id.org/fep/1985/ForwardChronological"
}
}
Example of a reverse chronological OrderedCollection with additional context:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/fep/1985"
],
"id": "https://domain.example/some-collection",
"type": "OrderedCollection",
"orderedItems": [
"https://domain.example/objects/3",
"https://domain.example/objects/2",
"https://domain.example/objects/1"
],
"orderType": "ReverseChronological"
}
Example of a reverse chronological OrderedCollection without additional context:
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://domain.example/some-collection",
"type": "OrderedCollection",
"orderedItems": [
"https://domain.example/objects/3",
"https://domain.example/objects/2",
"https://domain.example/objects/1"
],
"https://w3id.org/fep/1985/orderType": {
"id": "https://w3id.org/fep/1985/ReverseChronological"
}
}
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
To the extent possible under law, the authors of this Fediverse Enhancement Proposal have waived all copyright and related or neighboring rights to this work.