Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. Technical Discussion
  3. There are two kinds of "collections" in ActivityPub:

There are two kinds of "collections" in ActivityPub:

Scheduled Pinned Locked Moved Technical Discussion
7 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • silverpill@mitra.socialS This user is from outside of this forum
    silverpill@mitra.socialS This user is from outside of this forum
    silverpill@mitra.social
    wrote last edited by
    #1

    There are two kinds of "collections" in ActivityPub:

    - Containers. These are basically objects that represent groups of other objects: threads, playlists and photo albums. ActivityPub clients can create, update and delete them.
    - Views. These are generated on the fly by the server, can be paginated and filtered. Inbox and outbox are most common examples.

    Both are supposed to be [Ordered]Collection objects with items property. However, in practice they are different. For example, it's reasonable to Update a playlist to change its name, but what an Update of a followers collection would mean?

    Usually, I argue that containers and views shouldn't be mixed. Don't add items to your thread/playlist/album, create a separate collection instead.

    Are there other options?

    @mariusor How do you deal with this problem in GoActivityPub?

    @dansup

    RE: https://mastodon.social/users/dansup/statuses/115596404697985830

    mariusor@metalhead.clubM 1 Reply Last reply
    0
    • silverpill@mitra.socialS silverpill@mitra.social

      There are two kinds of "collections" in ActivityPub:

      - Containers. These are basically objects that represent groups of other objects: threads, playlists and photo albums. ActivityPub clients can create, update and delete them.
      - Views. These are generated on the fly by the server, can be paginated and filtered. Inbox and outbox are most common examples.

      Both are supposed to be [Ordered]Collection objects with items property. However, in practice they are different. For example, it's reasonable to Update a playlist to change its name, but what an Update of a followers collection would mean?

      Usually, I argue that containers and views shouldn't be mixed. Don't add items to your thread/playlist/album, create a separate collection instead.

      Are there other options?

      @mariusor How do you deal with this problem in GoActivityPub?

      @dansup

      RE: https://mastodon.social/users/dansup/statuses/115596404697985830

      mariusor@metalhead.clubM This user is from outside of this forum
      mariusor@metalhead.clubM This user is from outside of this forum
      mariusor@metalhead.club
      wrote last edited by
      #2

      @silverpill I allow all collections' properties to be modified with Update activities with the exception of the items property itself. For those I allow Add/Remove/Move, etc.

      I don't see a reason to make a distinction between what you call views and containers.

      If there would be a distinction to make, I would consider views as random object arrays that are accesible at a certain URL (and I would add them in the Streams property of an Actor). Instead of a generated CollectionPage, you would only get its items.

      pro@dansup@mastodon.social

      silverpill@mitra.socialS 1 Reply Last reply
      0
      • mariusor@metalhead.clubM mariusor@metalhead.club

        @silverpill I allow all collections' properties to be modified with Update activities with the exception of the items property itself. For those I allow Add/Remove/Move, etc.

        I don't see a reason to make a distinction between what you call views and containers.

        If there would be a distinction to make, I would consider views as random object arrays that are accesible at a certain URL (and I would add them in the Streams property of an Actor). Instead of a generated CollectionPage, you would only get its items.

        pro@dansup@mastodon.social

        silverpill@mitra.socialS This user is from outside of this forum
        silverpill@mitra.socialS This user is from outside of this forum
        silverpill@mitra.social
        wrote last edited by
        #3

        @mariusor

        I allow all collections' properties to be modified with Update activities with the exception of the items property itself.

        Do you allow to update special collections like inbox and outbox?

        What about overwriting pagination properties like first and next?

        mariusor@metalhead.clubM 1 Reply Last reply
        0
        • silverpill@mitra.socialS silverpill@mitra.social

          @mariusor

          I allow all collections' properties to be modified with Update activities with the exception of the items property itself.

          Do you allow to update special collections like inbox and outbox?

          What about overwriting pagination properties like first and next?

          mariusor@metalhead.clubM This user is from outside of this forum
          mariusor@metalhead.clubM This user is from outside of this forum
          mariusor@metalhead.club
          wrote last edited by
          #4

          @silverpill yes to first question, and no to second question because collection pages are indeed dynamic. When a collection gets retrieved from storage, if there are filters on it, they get applied and the resulting object becomes a collection page where first, next, previous are computed dynamically based on the filters.

          I haven't found a good method to do away with this conceit yet.

          mariusor@metalhead.clubM 1 Reply Last reply
          0
          • mariusor@metalhead.clubM mariusor@metalhead.club

            @silverpill yes to first question, and no to second question because collection pages are indeed dynamic. When a collection gets retrieved from storage, if there are filters on it, they get applied and the resulting object becomes a collection page where first, next, previous are computed dynamically based on the filters.

            I haven't found a good method to do away with this conceit yet.

            mariusor@metalhead.clubM This user is from outside of this forum
            mariusor@metalhead.clubM This user is from outside of this forum
            mariusor@metalhead.club
            wrote last edited by
            #5

            @silverpill collections for GoActivityPub are not really special. A collection is an object which can be operated on with most of the Activity vocabulary to various degrees of success (based on what's in the spec, or based on what felt sensible at the time).

            The only way in which they are *special* is that when processing activities the collection ID gets extracted from the actor it belongs to, and gets operated on (for example to add an activity to an outbox or inbox).

            mariusor@metalhead.clubM 1 Reply Last reply
            0
            • mariusor@metalhead.clubM mariusor@metalhead.club

              @silverpill collections for GoActivityPub are not really special. A collection is an object which can be operated on with most of the Activity vocabulary to various degrees of success (based on what's in the spec, or based on what felt sensible at the time).

              The only way in which they are *special* is that when processing activities the collection ID gets extracted from the actor it belongs to, and gets operated on (for example to add an activity to an outbox or inbox).

              mariusor@metalhead.clubM This user is from outside of this forum
              mariusor@metalhead.clubM This user is from outside of this forum
              mariusor@metalhead.club
              wrote last edited by
              #6

              @silverpill basically a storage to be able to work with GoActivityPub needs only 4 operations (the docs have 5 including Create, but that will go away soon):

              Load (IRI, Filters),
              Save (Object)
              AddTo (Collection, Object)
              RemoveFrom (Collection, Object)

              https://pkg.go.dev/github.com/go-ap/processing#Store

              silverpill@mitra.socialS 1 Reply Last reply
              0
              • mariusor@metalhead.clubM mariusor@metalhead.club

                @silverpill basically a storage to be able to work with GoActivityPub needs only 4 operations (the docs have 5 including Create, but that will go away soon):

                Load (IRI, Filters),
                Save (Object)
                AddTo (Collection, Object)
                RemoveFrom (Collection, Object)

                https://pkg.go.dev/github.com/go-ap/processing#Store

                silverpill@mitra.socialS This user is from outside of this forum
                silverpill@mitra.socialS This user is from outside of this forum
                silverpill@mitra.social
                wrote last edited by
                #7

                @mariusor Do you have any other reserved properties (in addition to id, items and pagination properties)?

                This doesn't feel right to me, and creates a problem for nomadic AP where clients submit signed activities and servers can't overwrite any property.

                >the docs have 5 including Create, but that will go away soon

                That's another interesting aspect of collections. If a client submits a Note with a replies property, does the server create a replies collection automatically?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                Powered by NodeBB Contributors
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups