Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • 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
We Distribute
  1. Home
  2. Technical Discussion
  3. Today I discovered an interesting inconsistency in Activity Streams specs while investigating [a Fedify issue].

Today I discovered an interesting inconsistency in Activity Streams specs while investigating [a Fedify issue].

Scheduled Pinned Locked Moved Technical Discussion
fedifyfedidevactivitypubspecificationsactivitystreams
25 Posts 6 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.
  • mariusor@metalhead.clubM mariusor@metalhead.club

    @trwnh well, I'll agree to disagree with you.

    GoActivityPub has as a first order type representation the json-ld document, which for this specific type (Image, well, others too) can be represented *also* as a binary. So we just do that.

    This is simpler, bidirectional in ensuring both the info about a thing, and the thing itself can be reached knowing only *one* piece of information (it's ID/URL), and is supported by long existing HTTP mechanisms, like content-negotiating.

    For me pragmatism trumps whatever philosophical reasons people can come up with for it being incorrect. So that's where I'm at. 🙇

    @thisismissem @oranadoz @hongminhee

    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
    #15

    @trwnh sorry to be snarky, but you'll probably have a fit when I'll tell you that the on-disk representation for these json-ld documents representing binary stuff, actually hold the binary data as base64 encoded data URLs inside of their content properties. (This is *one* direction in which I went which I kinda regret, and hope to find a better method for storing binaries)

    Link Preview Image
    data: URLs - URIs | MDN

    Data URLs, URLs prefixed with the data: scheme, allow content creators to embed small files inline in documents. They were formerly known as "data URIs" until that name was retired by the WHATWG.

    favicon

    MDN Web Docs (developer.mozilla.org)

    @thisismissem @oranadoz @hongminhee

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

      @trwnh sorry to be snarky, but you'll probably have a fit when I'll tell you that the on-disk representation for these json-ld documents representing binary stuff, actually hold the binary data as base64 encoded data URLs inside of their content properties. (This is *one* direction in which I went which I kinda regret, and hope to find a better method for storing binaries)

      Link Preview Image
      data: URLs - URIs | MDN

      Data URLs, URLs prefixed with the data: scheme, allow content creators to embed small files inline in documents. They were formerly known as "data URIs" until that name was retired by the WHATWG.

      favicon

      MDN Web Docs (developer.mozilla.org)

      @thisismissem @oranadoz @hongminhee

      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
      #16

      @trwnh and one final thing.

      This insistence of thinking of the underlying data for ActivityPub as separate from it's document representation makes it so the fediverse is as fractured as it is.

      ActivityPub deals only with these documents and yet every service, maps whatever data they store, to these imperfect representations which sometimes are very far from the spec, because contorting existing data paradigms into RDF triplets and JSON-LD is cumbersome.

      Storing json-ld metadata, or the full document itself, like I do, allows you to think in clearer terms about addressability, access, location, etc..

      @thisismissem @oranadoz @hongminhee

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

        @trwnh and one final thing.

        This insistence of thinking of the underlying data for ActivityPub as separate from it's document representation makes it so the fediverse is as fractured as it is.

        ActivityPub deals only with these documents and yet every service, maps whatever data they store, to these imperfect representations which sometimes are very far from the spec, because contorting existing data paradigms into RDF triplets and JSON-LD is cumbersome.

        Storing json-ld metadata, or the full document itself, like I do, allows you to think in clearer terms about addressability, access, location, etc..

        @thisismissem @oranadoz @hongminhee

        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
        #17

        @mariusor @thisismissem @oranadoz @hongminhee i don't think it's cumbersome at all. if people used the as2 data model directly and operated on activities instead of transforming statuses, they wouldn't have that issue (and it is a different issue).

        the issue i'm talking about is ambiguity. when you use the same identifier for two different things, you can no longer distinguish between them. this is known as equivocation.

        example: does an Image have a width of 800 pixels? no. the repr does.

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

          @mariusor @thisismissem @oranadoz @hongminhee i don't think it's cumbersome at all. if people used the as2 data model directly and operated on activities instead of transforming statuses, they wouldn't have that issue (and it is a different issue).

          the issue i'm talking about is ambiguity. when you use the same identifier for two different things, you can no longer distinguish between them. this is known as equivocation.

          example: does an Image have a width of 800 pixels? no. the repr does.

          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
          #18

          @mariusor @thisismissem @oranadoz @hongminhee using content negotiation as an example: i can ask for the same Image as either image/png or image/jpg, right?

          ```
          GET /image
          Accept: image/png

          303 See Other
          Location: /image.png
          ```

          or...

          ```
          GET /image

          200 OK
          Content-Type: image/png
          ```

          the Image is the same Image even if i resize it, or convert it to a different format. we are generally uninterested in reasoning about representations instead of reasoning about the thing itself.

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

            @mariusor @thisismissem @oranadoz @hongminhee using content negotiation as an example: i can ask for the same Image as either image/png or image/jpg, right?

            ```
            GET /image
            Accept: image/png

            303 See Other
            Location: /image.png
            ```

            or...

            ```
            GET /image

            200 OK
            Content-Type: image/png
            ```

            the Image is the same Image even if i resize it, or convert it to a different format. we are generally uninterested in reasoning about representations instead of reasoning about the thing itself.

            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
            #19

            @trwnh you seem to be speaking of "a platonic ideal" of the internet.

            Tell me which ActivityPub service is capable of giving you png or jpeg versions of an image just because you ask for it. The same for the sizes. Nobody serves you different sized images from the same "resource", because computing that at access time is expensive to do, there's no standard way to ask for a specific size, etc.

            While in my case, there is a standard way: content negotiation.

            Please understand that you won't convince me. Like I keep saying: pragmatism should trump the philosophy of identity when we program applications.

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

              @trwnh you seem to be speaking of "a platonic ideal" of the internet.

              Tell me which ActivityPub service is capable of giving you png or jpeg versions of an image just because you ask for it. The same for the sizes. Nobody serves you different sized images from the same "resource", because computing that at access time is expensive to do, there's no standard way to ask for a specific size, etc.

              While in my case, there is a standard way: content negotiation.

              Please understand that you won't convince me. Like I keep saying: pragmatism should trump the philosophy of identity when we program applications.

              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
              #20

              @mariusor it's perfectly practical to serve what the requester asked for. it's not very practical to serve something they *didn't* ask for, instead of the thing they asked for.

              any http server is capable of this. maybe they use query strings, maybe they don't. there are defaults in any case.

              i mean, you probably encounter a cdn serving images like this multiple times every day, without even realizing it.

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

                @mariusor it's perfectly practical to serve what the requester asked for. it's not very practical to serve something they *didn't* ask for, instead of the thing they asked for.

                any http server is capable of this. maybe they use query strings, maybe they don't. there are defaults in any case.

                i mean, you probably encounter a cdn serving images like this multiple times every day, without even realizing it.

                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
                #21

                @trwnh I'm starting to feel you just like being contrarian.

                I just said I serve what requesters ask for because my service employs content-negotiation. So if they ask for an image they get an image and if they ask for a document they get a document.

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

                  @trwnh I'm starting to feel you just like being contrarian.

                  I just said I serve what requesters ask for because my service employs content-negotiation. So if they ask for an image they get an image and if they ask for a document they get a document.

                  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
                  #22

                  @mariusor no, i'm just trying to reach a mutual understanding.

                  content negotiation is fine if you are serving the same information for the same identifier. you have this idea of images being documents, people being documents, etc., and i have the idea that the representations are not the thing itself.

                  take for example the very popular and common pattern of doing something like this:

                  /image
                  /image.avif
                  /image?width=600
                  /image/thumbnail
                  /image@2x

                  these might all be "the same image" at the end.

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

                    @mariusor no, i'm just trying to reach a mutual understanding.

                    content negotiation is fine if you are serving the same information for the same identifier. you have this idea of images being documents, people being documents, etc., and i have the idea that the representations are not the thing itself.

                    take for example the very popular and common pattern of doing something like this:

                    /image
                    /image.avif
                    /image?width=600
                    /image/thumbnail
                    /image@2x

                    these might all be "the same image" at the end.

                    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
                    #23

                    @mariusor again, this isn't theoretical, there are plenty of web servers doing exactly this.

                    you can find services of this sort all over the place:

                    Link Preview Image
                    Placehold

                    Placehold is a simple, fast and free image placeholder service to generate SVG, PNG, JPEG, GIF, WebP and AVIF placeholder images for your project.

                    favicon

                    (placehold.co)

                    Link Preview Image
                    Lorem Picsum

                    Lorem Ipsum... but for photos

                    favicon

                    Lorem Picsum (picsum.photos)

                    and many widely-used softwares as well:

                    Link Preview Image
                    Images API

                    The Contentful Images API allows the retrieval and manipulation of image files referenced from assets.

                    favicon

                    (www.contentful.com)

                    Link Preview Image
                    GitHub - imgproxy/imgproxy: Fast and secure standalone server for resizing and converting remote images

                    Fast and secure standalone server for resizing and converting remote images - imgproxy/imgproxy

                    favicon

                    GitHub (github.com)

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

                      @mariusor again, this isn't theoretical, there are plenty of web servers doing exactly this.

                      you can find services of this sort all over the place:

                      Link Preview Image
                      Placehold

                      Placehold is a simple, fast and free image placeholder service to generate SVG, PNG, JPEG, GIF, WebP and AVIF placeholder images for your project.

                      favicon

                      (placehold.co)

                      Link Preview Image
                      Lorem Picsum

                      Lorem Ipsum... but for photos

                      favicon

                      Lorem Picsum (picsum.photos)

                      and many widely-used softwares as well:

                      Link Preview Image
                      Images API

                      The Contentful Images API allows the retrieval and manipulation of image files referenced from assets.

                      favicon

                      (www.contentful.com)

                      Link Preview Image
                      GitHub - imgproxy/imgproxy: Fast and secure standalone server for resizing and converting remote images

                      Fast and secure standalone server for resizing and converting remote images - imgproxy/imgproxy

                      favicon

                      GitHub (github.com)

                      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
                      #24

                      @mariusor the problem (for others) is that when you use the same URI to refer to different things, you can no longer distinguish between them. it's why the naive approach is to just use file extensions -- less ambiguity. you can trade content negotiation for explicit identification ahead-of-time. but it's quite tenuous to say that foo.jsonld and foo.png are "the same" in any meaningful sense. one is a description of an image, the other is a representation of the image. neither are the real thing

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

                        @mariusor the problem (for others) is that when you use the same URI to refer to different things, you can no longer distinguish between them. it's why the naive approach is to just use file extensions -- less ambiguity. you can trade content negotiation for explicit identification ahead-of-time. but it's quite tenuous to say that foo.jsonld and foo.png are "the same" in any meaningful sense. one is a description of an image, the other is a representation of the image. neither are the real thing

                        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
                        #25

                        @trwnh who are these "others" that have issues with content negotiation?

                        The target for my software - this particular one I gave the icon example from - are browsers. And in a browser this content negotiation works perfectly fine, have a look see -> https://releases.bruta.link

                        Can you see the icon? You can. Can you open the icon in the browser in a new tab and still see it. Yes you can. Can you use curl on the icon URL, yes, and as it defaults to json, you get the JSON-LD representation. I think that's good enough for me. I accept that it's not for you and wish you good luck with the software that you're developing. I'll stop engaging now.

                        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