fep

FEP-1985: Signaling how an OrderedCollection is ordered

Summary

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.

Terms defined

orderType

URI
https://w3id.org/fep/1985/orderType
Label
is ordered in
Comment
Indicates the type of ordering for an OrderedCollection.
Domain
OrderedCollection
Range
OrderingClass (@vocab)
Required
No
Functional
Yes
See also
ForwardChronological | ReverseChronological
Is defined by
FEP-1985

{
	"@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"
	}
}

OrderingClass

URI
https://w3id.org/fep/1985/OrderingClass
Label
OrderingClass
Comment
Abstract base class for the orderType property's range.
See also
ForwardChronological | ReverseChronological
Is defined by
FEP-1985

ForwardChronological

URI
https://w3id.org/fep/1985/ForwardChronological
Label
forward chronological order
Comment
This OrderedCollection is ordered forward chronologically, and adding an item to this collection will add it at the end.
Subclass of
OrderingClass
See also
orderType
Is defined by
FEP-1985

ReverseChronological

URI
https://w3id.org/fep/1985/ReverseChronological
Label
reverse chronological order
Comment
This OrderedCollection is ordered reverse chronologically, and adding an item to this collection will add it at the start.
Subclass of
OrderingClass
See also
orderType
Is defined by
FEP-1985

Examples

(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"
	}
}

References

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.