activitystreams icon indicating copy to clipboard operation
activitystreams copied to clipboard

How can I best indicate how a Collection was filtered?

Open aschrijver opened this issue 7 years ago • 5 comments

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 id property should be the indicator, so you can dereference the filtered collection reliably
    • But this is inconsistent with inbox and outbox in ActivityPub that should be filtered by client permissions, and this is not reflected in the id (or anywhere else in the json).
  • Another object property indicates the filter, like a special tag, or the generator property
  • If the collection was represented as a Link, then the rel property could be an indicator of the filter
  • There is no best way, choose whatever suits you

aschrijver avatar Jul 04 '18 11:07 aschrijver

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"

nightpool avatar Jul 04 '18 12:07 nightpool

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)

aschrijver avatar Jul 04 '18 12:07 aschrijver

IMO "There is no best way, choose whatever suits you"

gobengo avatar Sep 12 '18 16:09 gobengo

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.

evanp avatar Nov 15 '23 17:11 evanp

I am fine with closing this issue and its related one, with that reference to the FEP as the outcome. Thank you @evanp

aschrijver avatar Nov 16 '23 07:11 aschrijver