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.
In the related thread I describe an approach for a SortedCollection which seems to function similarly to what you describe, but I haven’t gotten around to submitting the FEP (FEP-1863 is a WIP) for that yet. It’s still on my desktop, mostly as such:
The blockers that stopped me from submitting it so far:
We could need to support custom comparison functions. It might be enough to assume numbers are sorted by magnitude and strings are sorted lexicographically, but other orderings could be useful.
I wanted to do some research into other existing vocabularies to mark equivalentClass and equivalentProperty where appropriate
I am interested to hear your feedback on this! Potentially in the linked thread. This thread is for the FEP about collections that are ordered sets but not strictly sorted sets… or at least not sorted by any given predicate. New items for this FEP (FEP-1985) are added either at the start (LIFO) or at the end (LILO).