Skip to content
  • Categories
  • Recent
  • Tags
  • All Topics
  • 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
Caint logo. It's just text.
  1. Home
  2. Uncategorized
  3. Today I discovered an interesting inconsistency in Activity Streams specs while investigating [a Fedify issue].
Welcome to Caint!

Issues? Post in Comments & Feedback
You can now view, reply, and favourite posts from the Fediverse. You can click here or click on the on the navigation bar on the left.

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

Scheduled Pinned Locked Moved Uncategorized
fedifyfedidevactivitypubspecificationsactivitystreams
12 Posts 6 Posters 1 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.
  • 洪 民憙 (Hong Minhee)H This user is from outside of this forum
    洪 民憙 (Hong Minhee)H This user is from outside of this forum
    洪 民憙 (Hong Minhee)
    wrote last edited by
    #1

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

    The question: How should we interpret URLs like "icon": "https://example.com/avatar.png"?

    JSON-LD context (https://www.w3.org/ns/activitystreams😞 @type: "@id" → “This is an IRI reference, dereference it to fetch an ActivityStreams object.”

    Activity Streams Primer: “assume that a bare string is the href of a Link object, not an id” (no dereferencing)

    Result: JSON-LD processor-based implementations try to parse PNG files as JSON and fail.

    Turns out w3c/activitystreams#595 already discusses the same issue for href properties. I added a note that icon, image, etc. have the same problem.

    Once again reminded of how tricky spec work can be…

    #ActivityPub #Fedify #ActivityStreams #fedidev #specifications

    Evan ProdromouE 1 Reply Last reply
    0
    • 洪 民憙 (Hong Minhee)H 洪 民憙 (Hong Minhee)

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

      The question: How should we interpret URLs like "icon": "https://example.com/avatar.png"?

      JSON-LD context (https://www.w3.org/ns/activitystreams😞 @type: "@id" → “This is an IRI reference, dereference it to fetch an ActivityStreams object.”

      Activity Streams Primer: “assume that a bare string is the href of a Link object, not an id” (no dereferencing)

      Result: JSON-LD processor-based implementations try to parse PNG files as JSON and fail.

      Turns out w3c/activitystreams#595 already discusses the same issue for href properties. I added a note that icon, image, etc. have the same problem.

      Once again reminded of how tricky spec work can be…

      #ActivityPub #Fedify #ActivityStreams #fedidev #specifications

      Evan ProdromouE This user is from outside of this forum
      Evan ProdromouE This user is from outside of this forum
      Evan Prodromou
      wrote last edited by
      #2

      @hongminhee It's a place where our loosey goosey style goes into nondeterminism. We should tighten it up in the next version. My main answer would be: publishers, don't do that.

      infinite love ⴳT 1 Reply Last reply
      1
      0
      • R ActivityRelay shared this topic
      • mariusM This user is from outside of this forum
        mariusM This user is from outside of this forum
        marius
        wrote last edited by
        #3

        @hongminhee I would assume the same URL can represent both a PNG image and a JSON-LD document.

        Here's how I do it in ONI.

        The URL https://releases.bruta.link/icon represents the icon for the application actor found at https://releases.bruta.link.

        If you fetch it using an Accept header for a json+ld document, that's what you'll get, if you ask it for an image/* document, then you'll get the raw image.

        So, from a client point of view, the server returns the raw image, unless asked specifically for a JSON-LD document.

        🏴A bas la propriété lucrativeO infinite love ⴳT 2 Replies Last reply
        1
        0
        • mariusM marius

          @hongminhee I would assume the same URL can represent both a PNG image and a JSON-LD document.

          Here's how I do it in ONI.

          The URL https://releases.bruta.link/icon represents the icon for the application actor found at https://releases.bruta.link.

          If you fetch it using an Accept header for a json+ld document, that's what you'll get, if you ask it for an image/* document, then you'll get the raw image.

          So, from a client point of view, the server returns the raw image, unless asked specifically for a JSON-LD document.

          🏴A bas la propriété lucrativeO This user is from outside of this forum
          🏴A bas la propriété lucrativeO This user is from outside of this forum
          🏴A bas la propriété lucrative
          wrote last edited by
          #4

          @mariusor Indeed the server should not return a PNG file if asked for jSON-LD doc, and instead return a 406 HTTP code.

          @hongminhee

          mariusM 1 Reply Last reply
          0
          • 🏴A bas la propriété lucrativeO 🏴A bas la propriété lucrative

            @mariusor Indeed the server should not return a PNG file if asked for jSON-LD doc, and instead return a 406 HTTP code.

            @hongminhee

            mariusM This user is from outside of this forum
            mariusM This user is from outside of this forum
            marius
            wrote last edited by
            #5

            @oranadoz you say "indeed" but you end up contradicting me.

            Why do you think the server should not return a json-ld document if asked for one?

            @hongminhee

            🏴A bas la propriété lucrativeO Emelia 👸🏻T 2 Replies Last reply
            1
            0
            • mariusM marius

              @oranadoz you say "indeed" but you end up contradicting me.

              Why do you think the server should not return a json-ld document if asked for one?

              @hongminhee

              🏴A bas la propriété lucrativeO This user is from outside of this forum
              🏴A bas la propriété lucrativeO This user is from outside of this forum
              🏴A bas la propriété lucrative
              wrote last edited by
              #6

              @mariusor I meant: I agree that:
              - content negociation must be performed
              - if asked for JSON-LD, the server returns JSON-LD if available, else return 406
              - if asked for image/*, return the PNG.

              I thought this was what you meant: this is up to the client to ask for what it can handle.

              @hongminhee

              mariusM 1 Reply Last reply
              0
              • mariusM marius

                @oranadoz you say "indeed" but you end up contradicting me.

                Why do you think the server should not return a json-ld document if asked for one?

                @hongminhee

                Emelia 👸🏻T This user is from outside of this forum
                Emelia 👸🏻T This user is from outside of this forum
                Emelia 👸🏻
                wrote last edited by
                #7

                @mariusor @oranadoz @hongminhee the document describing a resource and the resource itself are not necessarily the same thing. So the response for json-ld for the icon isn't necessarily equivalent to the icon itself.

                This has been a long-standing thing in json-ld for ages: is the document describing the resource or is the document the same as the resource.

                This is perhaps best described by a document about a person, that's not the same as the person themselves, though that document may be used by that person to describe themselves.

                mariusM 1 Reply Last reply
                1
                0
                • 🏴A bas la propriété lucrativeO 🏴A bas la propriété lucrative

                  @mariusor I meant: I agree that:
                  - content negociation must be performed
                  - if asked for JSON-LD, the server returns JSON-LD if available, else return 406
                  - if asked for image/*, return the PNG.

                  I thought this was what you meant: this is up to the client to ask for what it can handle.

                  @hongminhee

                  mariusM This user is from outside of this forum
                  mariusM This user is from outside of this forum
                  marius
                  wrote last edited by
                  #8

                  @oranadoz cool, cool. That's indeed what I meant. 🙂

                  @hongminhee

                  1 Reply Last reply
                  1
                  0
                  • Emelia 👸🏻T Emelia 👸🏻

                    @mariusor @oranadoz @hongminhee the document describing a resource and the resource itself are not necessarily the same thing. So the response for json-ld for the icon isn't necessarily equivalent to the icon itself.

                    This has been a long-standing thing in json-ld for ages: is the document describing the resource or is the document the same as the resource.

                    This is perhaps best described by a document about a person, that's not the same as the person themselves, though that document may be used by that person to describe themselves.

                    mariusM This user is from outside of this forum
                    mariusM This user is from outside of this forum
                    marius
                    wrote last edited by
                    #9

                    @thisismissem I don't ascribe to the semiotic theory of the web where the map is not the territory.

                    I like to keep things simple and therefore a json-ld document is a valid representation of an object that can exist as a binary.

                    People keep forgetting that ActivityPub is meant to be used on top of other web standards like content negotiation.

                    @oranadoz @hongminhee

                    Emelia 👸🏻T 1 Reply Last reply
                    1
                    0
                    • mariusM marius

                      @thisismissem I don't ascribe to the semiotic theory of the web where the map is not the territory.

                      I like to keep things simple and therefore a json-ld document is a valid representation of an object that can exist as a binary.

                      People keep forgetting that ActivityPub is meant to be used on top of other web standards like content negotiation.

                      @oranadoz @hongminhee

                      Emelia 👸🏻T This user is from outside of this forum
                      Emelia 👸🏻T This user is from outside of this forum
                      Emelia 👸🏻
                      wrote last edited by
                      #10

                      @mariusor @oranadoz @hongminhee right, but here a description of the icon isn't the same as the binary of the icon itself.

                      The binary gives you very different data to the description of it, e.g., fetching the binary doesn't indicate where to send replies to or how to interact with it; where as html <-> json-ld generally gives you similar enough representations.

                      Generally con-neg suggests the same data just in different formats; what you're giving here is different data in different formats.

                      1 Reply Last reply
                      1
                      0
                      • Evan ProdromouE Evan Prodromou

                        @hongminhee It's a place where our loosey goosey style goes into nondeterminism. We should tighten it up in the next version. My main answer would be: publishers, don't do that.

                        infinite love ⴳT This user is from outside of this forum
                        infinite love ⴳT This user is from outside of this forum
                        infinite love ⴳ
                        wrote last edited by
                        #11

                        @evan @hongminhee more and more i am thinking that Link was a bad idea from a data modeling perspective. "assume bare href instead of bare id" is something that can never make sense. if we really want to maintain validity of Link then it should *always* be embedded as an anonymous object:

                        icon: {
                        type: Image
                        url:
                        {
                        type: Link
                        href: foo
                        height: 400
                        width: 400
                        mediaType: image/png
                        }
                        }

                        here, Image.url means "representation of the Image"

                        1 Reply Last reply
                        1
                        0
                        • mariusM marius

                          @hongminhee I would assume the same URL can represent both a PNG image and a JSON-LD document.

                          Here's how I do it in ONI.

                          The URL https://releases.bruta.link/icon represents the icon for the application actor found at https://releases.bruta.link.

                          If you fetch it using an Accept header for a json+ld document, that's what you'll get, if you ask it for an image/* document, then you'll get the raw image.

                          So, from a client point of view, the server returns the raw image, unless asked specifically for a JSON-LD document.

                          infinite love ⴳT This user is from outside of this forum
                          infinite love ⴳT This user is from outside of this forum
                          infinite love ⴳ
                          wrote last edited by
                          #12

                          @mariusor @hongminhee > the same URL can represent both

                          bad idea. an identifier should unambiguously refer to exactly 1 thing

                          1 Reply Last reply
                          1
                          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.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • All Topics
                          • Popular
                          • World
                          • Users
                          • Groups