Salta al contenuto
0
  • Home
  • Piero Bosio
  • Blog
  • Mondo
  • Fediverso
  • News
  • Categorie
  • Old Web Site
  • Recenti
  • Popolare
  • Tag
  • Utenti
  • Home
  • Piero Bosio
  • Blog
  • Mondo
  • Fediverso
  • News
  • Categorie
  • Old Web Site
  • Recenti
  • Popolare
  • Tag
  • Utenti
Skin
  • Chiaro
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Scuro
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Predefinito (Cerulean)
  • Nessuna skin
Collassa

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone
  1. Home
  2. Categorie
  3. Technical Discussion
  4. There are two kinds of "collections" in ActivityPub:

There are two kinds of "collections" in ActivityPub:

Pianificato Fissato Bloccato Spostato Technical Discussion
16 Post 2 Autori 74 Visualizzazioni
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • silverpill@mitra.socialundefined Questo utente è esterno a questo forum
    silverpill@mitra.socialundefined Questo utente è esterno a questo forum
    silverpill@mitra.social
    scritto su ultima modifica di
    #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.clubundefined 1 Risposta Ultima Risposta
    0
    • silverpill@mitra.socialundefined 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.clubundefined Questo utente è esterno a questo forum
      mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
      mariusor@metalhead.club
      scritto su ultima modifica di
      #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.socialundefined 1 Risposta Ultima Risposta
      0
      • mariusor@metalhead.clubundefined 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.socialundefined Questo utente è esterno a questo forum
        silverpill@mitra.socialundefined Questo utente è esterno a questo forum
        silverpill@mitra.social
        scritto su ultima modifica di
        #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.clubundefined 1 Risposta Ultima Risposta
        0
        • silverpill@mitra.socialundefined 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.clubundefined Questo utente è esterno a questo forum
          mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
          mariusor@metalhead.club
          scritto su ultima modifica di
          #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.clubundefined 1 Risposta Ultima Risposta
          0
          • mariusor@metalhead.clubundefined 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.clubundefined Questo utente è esterno a questo forum
            mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
            mariusor@metalhead.club
            scritto su ultima modifica di
            #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.clubundefined 1 Risposta Ultima Risposta
            0
            • mariusor@metalhead.clubundefined 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.clubundefined Questo utente è esterno a questo forum
              mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
              mariusor@metalhead.club
              scritto su ultima modifica di
              #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.socialundefined 1 Risposta Ultima Risposta
              0
              • mariusor@metalhead.clubundefined 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.socialundefined Questo utente è esterno a questo forum
                silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                silverpill@mitra.social
                scritto su ultima modifica di
                #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?

                mariusor@metalhead.clubundefined 1 Risposta Ultima Risposta
                0
                • silverpill@mitra.socialundefined silverpill@mitra.social

                  @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?

                  mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                  mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                  mariusor@metalhead.club
                  scritto su ultima modifica di
                  #8

                  @silverpill only an actor that owns the collection can operate on it, and only the server that resides on the same host can operate on collections with that host. Ie, all the logic I'm describing refers to client to server, collections that reside on other servers are not really relevant.

                  And I don't know if I mentioned it before, mostly GoActivityPub focuses on the vanilla specification, the fancy use-cases in FEPs, like nomadic identity, are outside the scope until we can make use dynamic object types - which is not the case at the moment, we're limited to plain Activity vocabulary.

                  silverpill@mitra.socialundefined 1 Risposta Ultima Risposta
                  0
                  • mariusor@metalhead.clubundefined mariusor@metalhead.club

                    @silverpill only an actor that owns the collection can operate on it, and only the server that resides on the same host can operate on collections with that host. Ie, all the logic I'm describing refers to client to server, collections that reside on other servers are not really relevant.

                    And I don't know if I mentioned it before, mostly GoActivityPub focuses on the vanilla specification, the fancy use-cases in FEPs, like nomadic identity, are outside the scope until we can make use dynamic object types - which is not the case at the moment, we're limited to plain Activity vocabulary.

                    silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                    silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                    silverpill@mitra.social
                    scritto su ultima modifica di
                    #9

                    @mariusor I understand, and this is not a criticism of your implementation. I think the problem I described is not limited to nomadic AP, the vanilla specification doesn't tell us how clients should work with collections, so we need to figure it out by ourselves and document in a FEP.

                    >we're limited to plain Activity vocabulary.

                    replies is a part of the vocabulary. Does your server support it?

                    mariusor@metalhead.clubundefined 1 Risposta Ultima Risposta
                    0
                    • silverpill@mitra.socialundefined silverpill@mitra.social

                      @mariusor I understand, and this is not a criticism of your implementation. I think the problem I described is not limited to nomadic AP, the vanilla specification doesn't tell us how clients should work with collections, so we need to figure it out by ourselves and document in a FEP.

                      >we're limited to plain Activity vocabulary.

                      replies is a part of the vocabulary. Does your server support it?

                      mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                      mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                      mariusor@metalhead.club
                      scritto su ultima modifica di
                      #10

                      @silverpill yes, I was thinking of the nomadic identity aspect when I said that.

                      So, for GoAP: a user wants to upload an image, it can specify recipients, the client builds an Image AP object out of that (including a reply collection) and wraps it in a Create collection, sends it to the server (C2S).

                      Server saves Image locally, creates all collections for the Image that are not empty in the Image (like replies, likes, shares, etc) adds it to outbox of user's Actor, adds it to local follower's Inbox or sends it to remote followers Inbox (S2S). If it's in reply to something(s) loads the object(s) and disseminates it to the recipients.

                      silverpill@mitra.socialundefined 2 Risposte Ultima Risposta
                      0
                      • mariusor@metalhead.clubundefined mariusor@metalhead.club

                        @silverpill yes, I was thinking of the nomadic identity aspect when I said that.

                        So, for GoAP: a user wants to upload an image, it can specify recipients, the client builds an Image AP object out of that (including a reply collection) and wraps it in a Create collection, sends it to the server (C2S).

                        Server saves Image locally, creates all collections for the Image that are not empty in the Image (like replies, likes, shares, etc) adds it to outbox of user's Actor, adds it to local follower's Inbox or sends it to remote followers Inbox (S2S). If it's in reply to something(s) loads the object(s) and disseminates it to the recipients.

                        silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                        silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                        silverpill@mitra.social
                        scritto su ultima modifica di
                        #11

                        @mariusor I've started to collect information here: https://codeberg.org/silverpill/feps/src/branch/main/9f9f/fep-9f9f.md

                        mariusor@metalhead.clubundefined 1 Risposta Ultima Risposta
                        0
                        • silverpill@mitra.socialundefined silverpill@mitra.social

                          @mariusor I've started to collect information here: https://codeberg.org/silverpill/feps/src/branch/main/9f9f/fep-9f9f.md

                          mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                          mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                          mariusor@metalhead.club
                          scritto su ultima modifica di
                          #12

                          @silverpill regarding pagination, I do

                          next=URL encoded ID of the latest item in the items' collection

                          prev=URL encoded ID of the first item in the items' collection.

                          This is very verbose, but I haven't found a better solution that doesn't require additional storage or context (like DB ids for example).

                          As always, for examples you can look at federated.id:

                          https://federated.id/inbox?maxItems=100

                          1 Risposta Ultima Risposta
                          0
                          • mariusor@metalhead.clubundefined mariusor@metalhead.club

                            @silverpill yes, I was thinking of the nomadic identity aspect when I said that.

                            So, for GoAP: a user wants to upload an image, it can specify recipients, the client builds an Image AP object out of that (including a reply collection) and wraps it in a Create collection, sends it to the server (C2S).

                            Server saves Image locally, creates all collections for the Image that are not empty in the Image (like replies, likes, shares, etc) adds it to outbox of user's Actor, adds it to local follower's Inbox or sends it to remote followers Inbox (S2S). If it's in reply to something(s) loads the object(s) and disseminates it to the recipients.

                            silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                            silverpill@mitra.socialundefined Questo utente è esterno a questo forum
                            silverpill@mitra.social
                            scritto su ultima modifica di
                            #13

                            @mariusor Could you tell me more about how replies and similar properties are treated by GoAP servers?

                            I initially imagined that clients would put collection ID there, but regular ActivityPub clients (not FEP-ae97) are not supposed to mint identifiers.

                            So I decided to remove this from my Collections FEP and recommend explicit creation instead (via Create activity).

                            One possible solution is to introduce a special value (such as null), that tells server that it should create a collection:

                            {
                              "type": "Note",
                              "replies": null
                            }
                            

                            cc @trwnh

                            mariusor@metalhead.clubundefined 2 Risposte Ultima Risposta
                            0
                            • silverpill@mitra.socialundefined silverpill@mitra.social

                              @mariusor Could you tell me more about how replies and similar properties are treated by GoAP servers?

                              I initially imagined that clients would put collection ID there, but regular ActivityPub clients (not FEP-ae97) are not supposed to mint identifiers.

                              So I decided to remove this from my Collections FEP and recommend explicit creation instead (via Create activity).

                              One possible solution is to introduce a special value (such as null), that tells server that it should create a collection:

                              {
                                "type": "Note",
                                "replies": null
                              }
                              

                              cc @trwnh

                              mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                              mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                              mariusor@metalhead.club
                              scritto su ultima modifica di
                              #14

                              @silverpill the Go ActivityPub state machine creates all collections that appear as properties in an object. So if the client has filled the replies collection with an IRI that is namespaced to the instance (or better yet, the user), it creates that an OrderedCollection using that as an ID.

                              So for your example, there would not be a replies created.

                              However the servers built with GoActivityPub have no universal rule about clients not being able to generate IDs. When they receive an object with ID they try to create it, if it fails, it fails, if it succeeds... cool. This helps with allowing users to have nice URLs for their content.

                              @trwnh

                              mariusor@metalhead.clubundefined 1 Risposta Ultima Risposta
                              0
                              • mariusor@metalhead.clubundefined mariusor@metalhead.club

                                @silverpill the Go ActivityPub state machine creates all collections that appear as properties in an object. So if the client has filled the replies collection with an IRI that is namespaced to the instance (or better yet, the user), it creates that an OrderedCollection using that as an ID.

                                So for your example, there would not be a replies created.

                                However the servers built with GoActivityPub have no universal rule about clients not being able to generate IDs. When they receive an object with ID they try to create it, if it fails, it fails, if it succeeds... cool. This helps with allowing users to have nice URLs for their content.

                                @trwnh

                                mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                                mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                                mariusor@metalhead.club
                                scritto su ultima modifica di
                                #15

                                @silverpill basically I did it like this because I wanted to short-circuit clients having to send Create activities that create the collections at the same time.

                                I can think of a flow where you create all collections that you want the actor/object to have, then you create the actor/object by setting those collections' ids in the right places, but it feels a little unwholesome.

                                With the automatic creation, I can also set ownership on the collections to the actor that created them, or the actor that they belong to.

                                In GoAP this relies a lot on URL paths having meaning and not being opaque blobs as the specs say, which might not be for everyone...

                                @trwnh

                                1 Risposta Ultima Risposta
                                0
                                • silverpill@mitra.socialundefined silverpill@mitra.social

                                  @mariusor Could you tell me more about how replies and similar properties are treated by GoAP servers?

                                  I initially imagined that clients would put collection ID there, but regular ActivityPub clients (not FEP-ae97) are not supposed to mint identifiers.

                                  So I decided to remove this from my Collections FEP and recommend explicit creation instead (via Create activity).

                                  One possible solution is to introduce a special value (such as null), that tells server that it should create a collection:

                                  {
                                    "type": "Note",
                                    "replies": null
                                  }
                                  

                                  cc @trwnh

                                  mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                                  mariusor@metalhead.clubundefined Questo utente è esterno a questo forum
                                  mariusor@metalhead.club
                                  scritto su ultima modifica di
                                  #16

                                  @silverpill PS. did I miss where the spec forbids clients passing IDs to the Create objects, or am I right that it could be a valid mechanism?

                                  @trwnh

                                  1 Risposta Ultima Risposta
                                  0

                                  Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

                                  Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

                                  Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

                                  Registrati Accedi
                                  Rispondi
                                  • Risposta alla discussione
                                  Effettua l'accesso per rispondere
                                  • Da Vecchi a Nuovi
                                  • Da Nuovi a Vecchi
                                  • Più Voti


                                  Feed RSS
                                  There are two kinds of "collections" in ActivityPub:
                                  @pierobosio@soc.bosio.info
                                  V4.10.1 Contributors
                                  • Accedi

                                  • Accedi o registrati per effettuare la ricerca.
                                  • Primo post
                                    Ultimo post