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. In ActivityPub, these are all equivalent:

In ActivityPub, these are all equivalent:

Pianificato Fissato Bloccato Spostato Technical Discussion
activitypubactivitystreamsfedidevjsonld
13 Post 5 Autori 1 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.
  • reiver@mastodon.socialundefined Questo utente è esterno a questo forum
    reiver@mastodon.socialundefined Questo utente è esterno a questo forum
    reiver@mastodon.social
    scritto su ultima modifica di
    #1

    In ActivityPub, these are all equivalent:

    "type":"Banana"

    "type":["Banana"]

    "type":{"@ID":"Banana"}

    "type":[{"@ID":"Banana"}]

    "type":{"id":"Banana"}

    "type":[{"id":"Banana"}]

    "@type":"Banana"

    "@type":["Banana"]

    "@type":{"@ID":"Banana"}

    "@type":[{"@ID":"Banana"}]

    "@type":{"id":"Banana"}

    "@type":[{"id":"Banana"}]

    #ActivityPub #ActivityStreams #FediDev #JSONLD

    oliviavespera@spacey.spaceundefined steve@social.technoetic.comundefined evan@activitypub.spaceundefined 3 Risposte Ultima Risposta
    2
    • reiver@mastodon.socialundefined reiver@mastodon.social

      In ActivityPub, these are all equivalent:

      "type":"Banana"

      "type":["Banana"]

      "type":{"@ID":"Banana"}

      "type":[{"@ID":"Banana"}]

      "type":{"id":"Banana"}

      "type":[{"id":"Banana"}]

      "@type":"Banana"

      "@type":["Banana"]

      "@type":{"@ID":"Banana"}

      "@type":[{"@ID":"Banana"}]

      "@type":{"id":"Banana"}

      "@type":[{"id":"Banana"}]

      #ActivityPub #ActivityStreams #FediDev #JSONLD

      oliviavespera@spacey.spaceundefined Questo utente è esterno a questo forum
      oliviavespera@spacey.spaceundefined Questo utente è esterno a questo forum
      oliviavespera@spacey.space
      scritto su ultima modifica di
      #2

      @reiver That's... kinda shite.

      trwnh@mastodon.socialundefined 1 Risposta Ultima Risposta
      1
      • reiver@mastodon.socialundefined reiver@mastodon.social

        In ActivityPub, these are all equivalent:

        "type":"Banana"

        "type":["Banana"]

        "type":{"@ID":"Banana"}

        "type":[{"@ID":"Banana"}]

        "type":{"id":"Banana"}

        "type":[{"id":"Banana"}]

        "@type":"Banana"

        "@type":["Banana"]

        "@type":{"@ID":"Banana"}

        "@type":[{"@ID":"Banana"}]

        "@type":{"id":"Banana"}

        "@type":[{"id":"Banana"}]

        #ActivityPub #ActivityStreams #FediDev #JSONLD

        steve@social.technoetic.comundefined Questo utente è esterno a questo forum
        steve@social.technoetic.comundefined Questo utente è esterno a questo forum
        steve@social.technoetic.com
        scritto su ultima modifica di
        #3

        @reiver That's assuming "Banana" is a term defined in the JSON-LD context. Even then, the expanded "Banana" term (e.g., "https://server.example/fruits#Banana" is also valid and equivalent.

        reiver@mastodon.socialundefined trwnh@mastodon.socialundefined 2 Risposte Ultima Risposta
        0
        • steve@social.technoetic.comundefined steve@social.technoetic.com

          @reiver That's assuming "Banana" is a term defined in the JSON-LD context. Even then, the expanded "Banana" term (e.g., "https://server.example/fruits#Banana" is also valid and equivalent.

          reiver@mastodon.socialundefined Questo utente è esterno a questo forum
          reiver@mastodon.socialundefined Questo utente è esterno a questo forum
          reiver@mastodon.social
          scritto su ultima modifica di
          #4

          @steve

          Yes, you are correct, all those are equivalent, too.

          Plus any CURIE form (ex: abc:Banana).

          I couldn't fit all those in the 500 character limit.

          1 Risposta Ultima Risposta
          0
          • steve@social.technoetic.comundefined steve@social.technoetic.com

            @reiver That's assuming "Banana" is a term defined in the JSON-LD context. Even then, the expanded "Banana" term (e.g., "https://server.example/fruits#Banana" is also valid and equivalent.

            trwnh@mastodon.socialundefined Questo utente è esterno a questo forum
            trwnh@mastodon.socialundefined Questo utente è esterno a questo forum
            trwnh@mastodon.social
            scritto su ultima modifica di
            #5

            @steve @reiver See https://github.com/w3c/json-ld-syntax/issues/446 for a related issue. JSON-LD @\type IRIs get expanded against a @\vocab prefix, or if one is not present then they get expanded against the @\base, and if *that* can't be determined then they are actually not expanded.

            However, you don't have to worry about cases like "@type":{"@id":"Banana"} because those are not valid. Per https://www.w3.org/TR/json-ld11/#specifying-the-type you only have to worry about strings and arrays of strings.

            Also AS2 compacts @\type to type.

            trwnh@mastodon.socialundefined 1 Risposta Ultima Risposta
            0
            • trwnh@mastodon.socialundefined trwnh@mastodon.social

              @steve @reiver See https://github.com/w3c/json-ld-syntax/issues/446 for a related issue. JSON-LD @\type IRIs get expanded against a @\vocab prefix, or if one is not present then they get expanded against the @\base, and if *that* can't be determined then they are actually not expanded.

              However, you don't have to worry about cases like "@type":{"@id":"Banana"} because those are not valid. Per https://www.w3.org/TR/json-ld11/#specifying-the-type you only have to worry about strings and arrays of strings.

              Also AS2 compacts @\type to type.

              trwnh@mastodon.socialundefined Questo utente è esterno a questo forum
              trwnh@mastodon.socialundefined Questo utente è esterno a questo forum
              trwnh@mastodon.social
              scritto su ultima modifica di
              #6

              @steve @reiver So really, those 12 cases reduce to only the first 2.

              steve@social.technoetic.comundefined 1 Risposta Ultima Risposta
              0
              • oliviavespera@spacey.spaceundefined oliviavespera@spacey.space

                @reiver That's... kinda shite.

                trwnh@mastodon.socialundefined Questo utente è esterno a questo forum
                trwnh@mastodon.socialundefined Questo utente è esterno a questo forum
                trwnh@mastodon.social
                scritto su ultima modifica di
                #7

                @OliviaVespera @reiver It's also not correct; only the first 2 cases are valid/compliant. (If ActivityPub didn't define "type" to mean @\type, then it would be only the 7th and 8th cases in that list.)

                reiver@mastodon.socialundefined 1 Risposta Ultima Risposta
                0
                • trwnh@mastodon.socialundefined trwnh@mastodon.social

                  @steve @reiver So really, those 12 cases reduce to only the first 2.

                  steve@social.technoetic.comundefined Questo utente è esterno a questo forum
                  steve@social.technoetic.comundefined Questo utente è esterno a questo forum
                  steve@social.technoetic.com
                  scritto su ultima modifica di
                  #8

                  @trwnh @reiver The classic example of this issue is a property like `attributedTo` or its subproperty `actor` (just two of many examples). The range is Object|Link. That means the property value could be URI, an Object, a Link or an array (set) of any combination of URIs, Objects or Links where the URI could be compacted, expanded or a CURIE.

                  trwnh@mastodon.socialundefined 1 Risposta Ultima Risposta
                  0
                  • steve@social.technoetic.comundefined steve@social.technoetic.com

                    @trwnh @reiver The classic example of this issue is a property like `attributedTo` or its subproperty `actor` (just two of many examples). The range is Object|Link. That means the property value could be URI, an Object, a Link or an array (set) of any combination of URIs, Objects or Links where the URI could be compacted, expanded or a CURIE.

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

                    @steve @reiver Yup. Makes me wish we used an actual normal/canonical form that was more constrained. Even in the AS2 context I've oft thought @\type: @\id could be a mistake since {id: foo} is usually preferable; also, any non-functional property really ought to be @\container: @\set. those would be backwards-incompatible changes, though. and even if someone defined a simpler easier-to-understand profile, what's the point if people don't use it?

                    1 Risposta Ultima Risposta
                    0
                    • trwnh@mastodon.socialundefined trwnh@mastodon.social

                      @OliviaVespera @reiver It's also not correct; only the first 2 cases are valid/compliant. (If ActivityPub didn't define "type" to mean @\type, then it would be only the 7th and 8th cases in that list.)

                      reiver@mastodon.socialundefined Questo utente è esterno a questo forum
                      reiver@mastodon.socialundefined Questo utente è esterno a questo forum
                      reiver@mastodon.social
                      scritto su ultima modifica di
                      #10

                      @trwnh @OliviaVespera

                      Why do you feel that the 7th & 8th cases are not "valid"?

                      "@type":"Banana"

                      "@type":["Banana"]

                      ...

                      At the following, "type" is set as an alias for "@type":

                      https://www.w3.org/ns/activitystreams.jsonld

                      But, AFAICT, in JSON-LD creating an alias (such as "type") does not make the original form (such as "@type") invalid.

                      Are you claiming the 7th & 8th form are invalid JSON-LD?

                      Or, are you claiming the 7th & 8th form are valid JSON-LD, but invalid ActivityPub?

                      Or, something else?

                      trwnh@mastodon.socialundefined 1 Risposta Ultima Risposta
                      0
                      • reiver@mastodon.socialundefined reiver@mastodon.social

                        @trwnh @OliviaVespera

                        Why do you feel that the 7th & 8th cases are not "valid"?

                        "@type":"Banana"

                        "@type":["Banana"]

                        ...

                        At the following, "type" is set as an alias for "@type":

                        https://www.w3.org/ns/activitystreams.jsonld

                        But, AFAICT, in JSON-LD creating an alias (such as "type") does not make the original form (such as "@type") invalid.

                        Are you claiming the 7th & 8th form are invalid JSON-LD?

                        Or, are you claiming the 7th & 8th form are valid JSON-LD, but invalid ActivityPub?

                        Or, something else?

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

                        @reiver @OliviaVespera valid JSON-LD but noncompliant AS2, due to ignoring the term definition for "type".

                        1 Risposta Ultima Risposta
                        0
                        • reiver@mastodon.socialundefined reiver@mastodon.social

                          In ActivityPub, these are all equivalent:

                          "type":"Banana"

                          "type":["Banana"]

                          "type":{"@ID":"Banana"}

                          "type":[{"@ID":"Banana"}]

                          "type":{"id":"Banana"}

                          "type":[{"id":"Banana"}]

                          "@type":"Banana"

                          "@type":["Banana"]

                          "@type":{"@ID":"Banana"}

                          "@type":[{"@ID":"Banana"}]

                          "@type":{"id":"Banana"}

                          "@type":[{"id":"Banana"}]

                          #ActivityPub #ActivityStreams #FediDev #JSONLD

                          evan@activitypub.spaceundefined Questo utente è esterno a questo forum
                          evan@activitypub.spaceundefined Questo utente è esterno a questo forum
                          evan@activitypub.space
                          scritto su ultima modifica di
                          #12

                          @reiver@mastodon.social That's not true. Most of those are not correct AS2. Only '"type": "Banana"' is correct.

                          Activity Streams says, The serialized JSON form of an Activity Streams 2.0 document MUST be consistent with what would be produced by the standard JSON-LD 1.0 Processing Algorithms and API [JSON-LD-API] Compaction Algorithm using, at least, the normative JSON-LD @context definition provided here.

                          So, assuming that you've defined some Banana extension, your full code might look like this:

                          {
                            "@context": [
                              "https://www.w3.org/ns/activitystreams",
                              {
                                "ext": "https://banana.example/",
                                "Banana": {
                                  "@type": "@id",
                                  "@id": "ext:Banana"
                                }
                              }
                            ],
                            "type": "Banana"
                          }
                          

                          If you use a JSON-LD library for parsing your input, all the funky variants you're sharing get canonicalized into one easy-to-use one. And if you use it for formatting your output, you'll always produce nice, clean AS2.

                          1 Risposta Ultima Risposta
                          0
                          • evan@activitypub.spaceundefined Questo utente è esterno a questo forum
                            evan@activitypub.spaceundefined Questo utente è esterno a questo forum
                            evan@activitypub.space
                            scritto su ultima modifica di
                            #13

                            Oh, and if you're using an AS2 type, you don't have to worry about the extra context URL, obvs:

                            {
                              "@context": "https://www.w3.org/ns/activitystreams",
                              "type": "Person"
                            }
                            
                            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
                            In ActivityPub, these are all equivalent:
                            @pierobosio@soc.bosio.info
                            V4.10.1 Contributors
                            • Accedi

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