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 (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Fediverse
  3. Fedi
  4. I have deeply mixed feelings about #ActivityPub's adoption of JSON-LD, as someone who's spent way too long dealing with it while building #Fedify.

I have deeply mixed feelings about #ActivityPub's adoption of JSON-LD, as someone who's spent way too long dealing with it while building #Fedify.

Scheduled Pinned Locked Moved Fedi
fedifyjsonldfedidevactivitypub
115 Posts 26 Posters 469 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.
  • mcc@mastodon.socialM mcc@mastodon.social

    @hongminhee How hard would it be for a future version of ActivityPub to simply back out JSON-LD support? Would there be a downside to this?

    julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.space
    wrote last edited by
    #82

    @mcc@mastodon.social asking the important questions 🤣

    @hongminhee@hollo.social

    1 Reply Last reply
    0
    • raphael@mastodon.communick.comR This user is from outside of this forum
      raphael@mastodon.communick.comR This user is from outside of this forum
      raphael@mastodon.communick.com
      wrote last edited by
      #83

      @silverpill @hongminhee @mariusor

      I don't remember the details, but
      Mastodon and Takahe were definitely giving responses in different shapes for a question object.

      raphael@mastodon.communick.comR 1 Reply Last reply
      0
      • ? Guest

        @julian Yes, POST to personal inbox sends a 404, POST to group inbox sends a 202 (I guess group inbox is how we communicate now).

        julian@activitypub.spaceJ This user is from outside of this forum
        julian@activitypub.spaceJ This user is from outside of this forum
        julian@activitypub.space
        wrote last edited by
        #84

        @silverpill@mitra.social okay! That's a little concerning because all of those routes just end up going to the same controller... but this gives me enough to debug, so thank you!

        1 Reply Last reply
        0
        • raphael@mastodon.communick.comR raphael@mastodon.communick.com

          @silverpill @hongminhee @mariusor

          I don't remember the details, but
          Mastodon and Takahe were definitely giving responses in different shapes for a question object.

          raphael@mastodon.communick.comR This user is from outside of this forum
          raphael@mastodon.communick.comR This user is from outside of this forum
          raphael@mastodon.communick.com
          wrote last edited by
          #85

          @silverpill @hongminhee @mariusor

          > There might be small variations in how a protocol feature (such as polls) is implemented, but they are not difficult to deal with.

          This becomes a matter of opinion. You say "not hard to deal with" and "dealing with JSON-LD is a burden".

          I think that being able to throw (valid) json-ld in any shape and letting the processor deal with it and have only one set of class to represent the types is well off the trade off of having a few extra bytes.

          raphael@mastodon.communick.comR 1 Reply Last reply
          0
          • raphael@mastodon.communick.comR raphael@mastodon.communick.com

            @silverpill @hongminhee @mariusor

            > There might be small variations in how a protocol feature (such as polls) is implemented, but they are not difficult to deal with.

            This becomes a matter of opinion. You say "not hard to deal with" and "dealing with JSON-LD is a burden".

            I think that being able to throw (valid) json-ld in any shape and letting the processor deal with it and have only one set of class to represent the types is well off the trade off of having a few extra bytes.

            raphael@mastodon.communick.comR This user is from outside of this forum
            raphael@mastodon.communick.comR This user is from outside of this forum
            raphael@mastodon.communick.com
            wrote last edited by
            #86

            @silverpill @hongminhee @mariusor

            > To be honest, I can't even imagine how JSON-LD could help with that instead of making it harder.

            https://activitypub.mushroomlabs.com/topics/reference_context_architecture/

            1 Reply Last reply
            0
            • mcc@mastodon.socialM mcc@mastodon.social

              @hongminhee How hard would it be for a future version of ActivityPub to simply back out JSON-LD support? Would there be a downside to this?

              hongminhee@hollo.socialH This user is from outside of this forum
              hongminhee@hollo.socialH This user is from outside of this forum
              hongminhee@hollo.social
              wrote last edited by
              #87

              @mcc@mastodon.social I'm not sure, but that would break some ActivityPub implementations relying on JSON-LD processors. 🤔

              1 Reply Last reply
              0
              • mcc@mastodon.socialM mcc@mastodon.social

                @hongminhee How hard would it be for a future version of ActivityPub to simply back out JSON-LD support? Would there be a downside to this?

                cochise@social.subversida.deC This user is from outside of this forum
                cochise@social.subversida.deC This user is from outside of this forum
                cochise@social.subversida.de
                wrote last edited by
                #88

                @mcc @hongminhee Mastodon, Fedify and other implementations that treat LD as mandatory (MUST) even if it's optional (SHOULD) will be non conformant. As Mastodon is the biggest implementation by far margin, deprecating it is no small feat.

                mcc@mastodon.socialM 1 Reply Last reply
                0
                • cochise@social.subversida.deC cochise@social.subversida.de

                  @mcc @hongminhee Mastodon, Fedify and other implementations that treat LD as mandatory (MUST) even if it's optional (SHOULD) will be non conformant. As Mastodon is the biggest implementation by far margin, deprecating it is no small feat.

                  mcc@mastodon.socialM This user is from outside of this forum
                  mcc@mastodon.socialM This user is from outside of this forum
                  mcc@mastodon.social
                  wrote last edited by
                  #89

                  @cochise @hongminhee But Mastodon famously doesn't actually *support* LD right? That's the point of the thread? So wouldn't they be the easiest to convince to stop supporting the thing they never supported?

                  cochise@social.subversida.deC 1 Reply Last reply
                  0
                  • mcc@mastodon.socialM mcc@mastodon.social

                    @cochise @hongminhee But Mastodon famously doesn't actually *support* LD right? That's the point of the thread? So wouldn't they be the easiest to convince to stop supporting the thing they never supported?

                    cochise@social.subversida.deC This user is from outside of this forum
                    cochise@social.subversida.deC This user is from outside of this forum
                    cochise@social.subversida.de
                    wrote last edited by
                    #90

                    @mcc @hongminhee Don't really support, but discards activities without @context anyway.

                    I suspect JSON-LD was a way to have extensibility and escape XMPP's XEP hell with servers and clients not supporting or disabling features in an infinite matrix.
                    But seems community favors FEPs describing JSON schemas and hardcoding it over getting them from a server and mapping the object at runtime.

                    trwnh@mastodon.socialT 1 Reply Last reply
                    0
                    • kanru@g0v.socialK This user is from outside of this forum
                      kanru@g0v.socialK This user is from outside of this forum
                      kanru@g0v.social
                      wrote last edited by
                      #91

                      @hongminhee I had a similar realization early on when implementing Pinka. I almost went full JSON-LD but found that to properly expand the document I might need to make network calls. I stopped worrying about unknown terms and just hard coded a list of well-known AS and APub terms for interoperability.

                      trwnh@mastodon.socialT 1 Reply Last reply
                      0
                      • incentiveI incentive moved this topic from Uncategorized
                      • trwnh@mastodon.socialT This user is from outside of this forum
                        trwnh@mastodon.socialT This user is from outside of this forum
                        trwnh@mastodon.social
                        wrote last edited by
                        #92

                        @hongminhee what i have found necessary (sadly) is to sometimes ignore what @\context a software produces and simply inject a corrected @\context describing what they *actually* meant instead of what they said they meant. x_x

                        https://gist.github.com/trwnh/d2f6fb1c87465baab8231427013a36a8

                        it would be an Exercise to sit down and map out the actual contexts of softwares like mastodon 4.5, mastodon 4.4, misskey 2025.12, akkoma 3.10.2, and so on...

                        for all else, there's shacl i guess, if you want to beat things into the correct shapes.

                        julian@activitypub.spaceJ 1 Reply Last reply
                        0
                        • kanru@g0v.socialK kanru@g0v.social

                          @hongminhee I had a similar realization early on when implementing Pinka. I almost went full JSON-LD but found that to properly expand the document I might need to make network calls. I stopped worrying about unknown terms and just hard coded a list of well-known AS and APub terms for interoperability.

                          trwnh@mastodon.socialT This user is from outside of this forum
                          trwnh@mastodon.socialT This user is from outside of this forum
                          trwnh@mastodon.social
                          wrote last edited by
                          #93

                          @kanru @hongminhee ironically this is what you're supposed to do! preload the terms you understand into local contexts. newer jsonld-adjacent specs (vc, cid, and so on) tell you that you MUST NOT fetch the contexts over the network at runtime, and instead MUST treat them as already fetched with a given sha256sum. https://www.w3.org/TR/cid-1.0/#json-ld-context

                          1 Reply Last reply
                          0
                          • trwnh@mastodon.socialT This user is from outside of this forum
                            trwnh@mastodon.socialT This user is from outside of this forum
                            trwnh@mastodon.social
                            wrote last edited by
                            #94

                            @julian @mcc @hongminhee the downside is that you now need a central registry of allowed terms and what they mean.

                            the way to avoid that is to always use "expanded" form, i.e. use full IRIs as property keys (and types) and {"id": "foo"} over "foo". in effect, you treat the http(s) authority as the social entity defining the term.

                            1 Reply Last reply
                            0
                            • cochise@social.subversida.deC cochise@social.subversida.de

                              @mcc @hongminhee Don't really support, but discards activities without @context anyway.

                              I suspect JSON-LD was a way to have extensibility and escape XMPP's XEP hell with servers and clients not supporting or disabling features in an infinite matrix.
                              But seems community favors FEPs describing JSON schemas and hardcoding it over getting them from a server and mapping the object at runtime.

                              trwnh@mastodon.socialT This user is from outside of this forum
                              trwnh@mastodon.socialT This user is from outside of this forum
                              trwnh@mastodon.social
                              wrote last edited by
                              #95

                              @cochise @mcc @hongminhee mastodon is one of the "better" ones in that regard, but famously requires you to have the same context as it (instead of expanding shorthand terms to the full IRIs and comparing those...)

                              1 Reply Last reply
                              0
                              • kopper@not-brain.d.on-t.workK kopper@not-brain.d.on-t.work
                                @hongminhee if i can give one piece of advice to devs who want to process JSON-LD: dont bother compacting. you already know the schema you output (or you're just passing through what the user gives and it doesn't matter to you), serialize directly to the compacted representation, and only run expansion on incoming data

                                expansion is the cheapest JSON-LD operation (since all other operations depend on it and run it internally anyhow), and this will get you all the compatibility benefits of JSON-LD with little downsides (beyond more annoying deserialization code, as you have to map the expanded representation to your internal structure which will likely be modeled after the compacted one)
                                trwnh@mastodon.socialT This user is from outside of this forum
                                trwnh@mastodon.socialT This user is from outside of this forum
                                trwnh@mastodon.social
                                wrote last edited by
                                #96

                                @kopper @hongminhee

                                generally agreed except

                                > you have to map the expanded representation to your internal structure which will likely be modeled after the compacted one

                                this is compaction but manual instead of using a jsonld processor to do it. maybe the more precise argument is "don't bother with auto/native compaction"?

                                with that said: you also lose out on flattening and framing, which are pretty cool features for transforming the serialization. if you don't care about those, ok fine

                                kopper@not-brain.d.on-t.workK 1 Reply Last reply
                                0
                                • trwnh@mastodon.socialT This user is from outside of this forum
                                  trwnh@mastodon.socialT This user is from outside of this forum
                                  trwnh@mastodon.social
                                  wrote last edited by
                                  #97

                                  @julian @mat atproto lets you section things off by "app" roughly, which is something that could be done with "plain old http" using content-types and well-known uris.

                                  json-ld makes it so that you don't have to use those -- the uris can be anything you'd like, including more natural names.

                                  the problem is that people can and will disagree. "talk it out" is not a complete solution. the "talk it out" solution is things like central registries managed by the IANA which most treat as consensus.

                                  1 Reply Last reply
                                  0
                                  • raphael@mastodon.communick.comR raphael@mastodon.communick.com

                                    @silverpill

                                    The problem is rarely in parsing as2 context, but dealing with how different implementations decide to create projections from the data.

                                    Take a simple poll. The 3 diffferent servers I saw were generating the text, the choices, and the replies collection in completely different ways. Without JSON-LD, each separate system would be fighting to figure out how to present the data.

                                    @hongminhee @mariusor

                                    trwnh@mastodon.socialT This user is from outside of this forum
                                    trwnh@mastodon.socialT This user is from outside of this forum
                                    trwnh@mastodon.social
                                    wrote last edited by
                                    #98

                                    @raphael @silverpill @hongminhee @mariusor most often the trouble i see is with ignoring the fact that everyone is using the same terms with different meanings, and pretending that we all agree when we actually do not.

                                    the second most common issue i see is with the complete lack of any guarantees beyond "this thing is probably an activity" (which even that small bit is often discarded!)

                                    json-ld is so far down the list of pain points, and the pain comes from ignoring it or misusing it.

                                    trwnh@mastodon.socialT 1 Reply Last reply
                                    0
                                    • trwnh@mastodon.socialT trwnh@mastodon.social

                                      @raphael @silverpill @hongminhee @mariusor most often the trouble i see is with ignoring the fact that everyone is using the same terms with different meanings, and pretending that we all agree when we actually do not.

                                      the second most common issue i see is with the complete lack of any guarantees beyond "this thing is probably an activity" (which even that small bit is often discarded!)

                                      json-ld is so far down the list of pain points, and the pain comes from ignoring it or misusing it.

                                      trwnh@mastodon.socialT This user is from outside of this forum
                                      trwnh@mastodon.socialT This user is from outside of this forum
                                      trwnh@mastodon.social
                                      wrote last edited by
                                      #99

                                      @raphael @silverpill @hongminhee @mariusor example: if you took lemmy's use of as:Group you might assume that every as:Group is a lemmy-style "community" and that it always produces 1b12-style Announce activities, and that "Announce" means how they use it and not its actual definition.

                                      now if lemmy had used their own vocabulary, it might be easier to understand that "this is a lemmy-style community".

                                      the activity processing model shouldn't care what lemmy properties are used.

                                      trwnh@mastodon.socialT 1 Reply Last reply
                                      0
                                      • trwnh@mastodon.socialT trwnh@mastodon.social

                                        @raphael @silverpill @hongminhee @mariusor example: if you took lemmy's use of as:Group you might assume that every as:Group is a lemmy-style "community" and that it always produces 1b12-style Announce activities, and that "Announce" means how they use it and not its actual definition.

                                        now if lemmy had used their own vocabulary, it might be easier to understand that "this is a lemmy-style community".

                                        the activity processing model shouldn't care what lemmy properties are used.

                                        trwnh@mastodon.socialT This user is from outside of this forum
                                        trwnh@mastodon.socialT This user is from outside of this forum
                                        trwnh@mastodon.social
                                        wrote last edited by
                                        #100

                                        @raphael @silverpill @hongminhee @mariusor what is far more powerful is drawing *equivalences* between values. you might say every lemmy:Community is also always as:Group, but not every as:Group is always a lemmy:Community. in this case we are basically saying lemmy:Community is rdfs:subClassOf as:Group.

                                        separately we might say every as:Group is also a vcard:Group, and vice versa -- that might make them owl:equivalentClass, but that doesn't mean the "activity model" and "vcard model" are equal!

                                        1 Reply Last reply
                                        0
                                        • trwnh@mastodon.socialT trwnh@mastodon.social

                                          @hongminhee what i have found necessary (sadly) is to sometimes ignore what @\context a software produces and simply inject a corrected @\context describing what they *actually* meant instead of what they said they meant. x_x

                                          https://gist.github.com/trwnh/d2f6fb1c87465baab8231427013a36a8

                                          it would be an Exercise to sit down and map out the actual contexts of softwares like mastodon 4.5, mastodon 4.4, misskey 2025.12, akkoma 3.10.2, and so on...

                                          for all else, there's shacl i guess, if you want to beat things into the correct shapes.

                                          julian@activitypub.spaceJ This user is from outside of this forum
                                          julian@activitypub.spaceJ This user is from outside of this forum
                                          julian@activitypub.space
                                          wrote last edited by
                                          #101

                                          @trwnh@mastodon.social it's not an exercise, not anymore, with the Fediverse Observatory!

                                          1 Reply Last reply
                                          1
                                          0
                                          • R relay@relay.an.exchange shared this topic
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

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