activitystreams
activitystreams copied to clipboard
How can I best indicate how a Collection was filtered?
Please Indicate One:
- [ ] Editorial
- [x] Question
- [ ] Feedback
- [ ] Blocking Issue
- [ ] Non-Blocking Issue
Please Describe the Issue:
When a (Ordered)Collection is returned by an API call, it will oftentimes be the result of a query, and only contain a filtered subset of the full collection, e.g. 'give me all items filtered by Object type' or 'give me all items published between X and Y date', etc.
My question: If I want to convey to the client what filter query was used to obtain the collection, what would be the best practice?
Some options:
- The
idproperty should be the indicator, so you can dereference the filtered collection reliably- But this is inconsistent with
inboxandoutboxin ActivityPub that should be filtered by client permissions, and this is not reflected in theid(or anywhere else in the json).
- But this is inconsistent with
- Another
objectproperty indicates the filter, like a specialtag, or thegeneratorproperty - If the collection was represented as a Link, then the
relproperty could be an indicator of the filter - There is no best way, choose whatever suits you
i think id is probably your best bet, and I don't see any conflict with "should be filtered by client permissions"—that's just saying "don't show clients activities they don't have access to"
Thanks @nightpool
I'll strongly consider id (maybe in combination with another option, if that works better for e.g. UI representation in a client)
IMO "There is no best way, choose whatever suits you"
I just commented on the similar issue on sorting, so I'll link it here.
https://github.com/w3c/activitystreams/issues/484#issuecomment-1812959870
tl;dr is to use FEP 5bf0, possibly with multiple types.
I am fine with closing this issue and its related one, with that reference to the FEP as the outcome. Thank you @evanp