Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordering user-created collections #439

Closed
trwnh opened this issue May 5, 2024 · 2 comments
Closed

Reordering user-created collections #439

trwnh opened this issue May 5, 2024 · 2 comments
Assignees
Labels
Needs FEP Needs a FEP Next version Normative change, requires new version of spec

Comments

@trwnh
Copy link

trwnh commented May 5, 2024

Collections are usually* ordered by insertion order, but there's nothing in the ActivityPub C2S API to insert at a specific point, or change the sort order of individual items.

In RDF lists (rdf:List), typically there is a singly-linked list constructed using rdf:first and rdf:next; it ends when rdf:next points to rdf:nil. Patching the rdf:List is done using the standard linked list algorithm of updating rdf:next of the previous element to the inserted element, and the previous rdf:rest becomes the rdf:rest of the inserted element.

The AS2 Collection mechanism doesn't seem to have an equivalent method.

EDIT: Schema.org seems to use a nextItem/previousItem or position, so you could do a sortIndex or weight property maybe

@evanp
Copy link
Collaborator

evanp commented May 8, 2024

I think we have what we need to read the contents of a collection -- either paged or unpaged.

So the questions becomes, for collections that don't have a prescribed order as part of the AP standard (actor collections, probably replies, shares, likes, ...), is it possible to do operations like Insert, Move within collection, or setting an automated sort order?

We don't have this in AP right now. This would need to be created as an extension; I'd be happy to collaborate on this.

Another possiblity is using Update to update the Collection or CollectionPage. So, you could change items from [A, B, C, D] to [A, D, C, B]. This kind of manipulation makes Add and Remove less useful, though. Are they even still required?

The problem with updating the collection or collection page directly is that these are only rarely representative of the internal storage on the server side, and are more likely to be abstract representations. So updating may not make sense here.

The other option @trwnh mentioned is using the sort order FEP, and including a manual property for sort order.

@evanp evanp changed the title Reordering collections? Reordering user-created collections May 8, 2024
@evanp evanp self-assigned this May 8, 2024
@evanp
Copy link
Collaborator

evanp commented Oct 4, 2024

So, this is marked as Needs FEP; @trwnh gave verbal assent on the issue triage call; so I will close this issue, with the possibility of considering working on this in a next version.

@evanp evanp added Next version Normative change, requires new version of spec and removed Waiting for Commenter labels Oct 4, 2024
@evanp evanp closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs FEP Needs a FEP Next version Normative change, requires new version of spec
Projects
None yet
Development

No branches or pull requests

2 participants